修改短链接、添加测试代码

This commit is contained in:
junj2.liang
2022-08-09 15:38:34 +08:00
parent 004e6451ee
commit 5243ec1fe1
2 changed files with 35 additions and 1 deletions
+27 -1
View File
@@ -57,7 +57,7 @@ public class FuncTest {
@Test
public void origin() throws Exception {
public void originLong() throws Exception {
SydApiBuilder builder = new SydApiBuilder(new String[]{"192.168.0.200"}, new int[]{8889}, 10, 15);
SydApi.SYD_SetLogConfig("./logs/",3);
Logger log = LogFactory.getLogger();
@@ -73,4 +73,30 @@ public class FuncTest {
}, i + "t").start();
}
}
@Test
public void originShort() throws Exception {
SydApi.SYD_SetLogConfig("./logs/",3);
Logger log = LogFactory.getLogger();
String[] pcipList = {"192.168.0.200", "192.168.0.200", "192.168.0.200" };
int[] iportList ={8080,8889,8889};
for (int i = 0; i < 1000; i++) {
int tmp = i;
new Thread(() -> {
try {
SydApi api = new SydApi4Database();
for (int j = 0; j < 20; j++) {
api.SYD_Short_Connect_Ex(pcipList,iportList,10,15);
byte[] bytes = api.SYD_SM4_ShortData(0, (tmp + "t" + j).getBytes(), Consts.ECB_ENC);
byte[] result = api.SYD_SM4_ShortData(0, bytes, Consts.ECB_DEC);
System.out.println(Thread.currentThread().getName() + "," + new String(result));
}
}
finally {
if ( null != api ) {
api.SYD_Disconnect_Ex();
}
} } , i + "t").start();
}
}
}