| | |
| | | package com.mes; |
| | | |
| | | import com.mes.job.CacheGlassTask; |
| | | import com.mes.md.entity.Account; |
| | | import com.mes.md.mapper.AccountMapper; |
| | | import com.mes.md.service.AccountService; |
| | | import com.mes.tools.HexConversion; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * @Author : yanzhixin |
| | |
| | | log.info("完整路径"); |
| | | } |
| | | @Test |
| | | public void testByte() { |
| | | //String url = getClass().getResource("").getPath(); |
| | | //log.info("完整路径:{}", Arrays.asList(url)); |
| | | byte[] msgs = new byte[2048]; |
| | | msgs[0]=(byte)0; |
| | | msgs[1]=Byte.parseByte("1") ; |
| | | int g=HexConversion.bytesToInt(msgs,0); |
| | | |
| | | String message = HexConversion.byteToHexString(4, msgs); |
| | | byte font=msgs[1]; |
| | | String[] fontBit=String.format("%8s", Integer.toBinaryString((int)font)).replace(" ", "0").split(""); |
| | | byte[] bit=new byte[1]; |
| | | bit[0]=Byte.parseByte(fontBit[7]) ; |
| | | log.info("结果:{},{}",fontBit,bit); |
| | | //log.info("结果:{},{},{},{},{}",msgs,message,g,(msgs[0] & 0xFF),((msgs[1] & 0xFF)<<8)); |
| | | } |
| | | @Test |
| | | public void testFindAccount() { |
| | | Map<String, Object> Account=accountService.selectAccount("admin","12345"); |
| | | Map<String, Object> Account=accountService.selectAccount("beibo","57858555"); |
| | | if(Account.isEmpty()){ |
| | | System.out.println("成功"); |
| | | } |
| | | log.info("{}",Account); |
| | | } |
| | | |
| | | |
| | | |
| | | } |