From acf24306aa69bb7f864e9bfa59995ccece785d30 Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期六, 12 十月 2024 14:56:01 +0800 Subject: [PATCH] 打标测试更改 --- JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java index 8cc2ba9..e57dd51 100644 --- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java +++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java @@ -2,6 +2,7 @@ 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; @@ -9,7 +10,10 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import java.util.ArrayList; +import java.util.List; import java.util.Map; +import java.util.Random; /** * @Author : yanzhixin @@ -35,6 +39,23 @@ 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("beibo","57858555"); if(Account.isEmpty()){ @@ -43,4 +64,6 @@ log.info("{}",Account); } + + } -- Gitblit v1.8.0