注释掉了mapdb相关的代码,以适配安卓

This commit is contained in:
free will committed 2021-05-13 19:41:30 +08:00
1 parent 3f7104381f
commit e8e8bd5639
13 files changed
+279 -272

No files matched your search

@@ -2,7 +2,6 @@ package component;
import encoding.*;
import mgmt.MgmtException;
import org.checkerframework.checker.units.qual.K;
import org.junit.Test;
import packet.PacketException;
@@ -1,7 +1,6 @@
package component;
import encoding.*;
import org.checkerframework.checker.units.qual.A;
import org.junit.Test;
import java.util.Arrays;
+10 -1
View File
@@ -129,6 +129,7 @@ public class LogicFaceTest {
}
}
// todo: 在这里测试为何超时依然能接收到UDP包
@Test
public void testReceiveDataByUdp() throws ComponentException, LogicFaceException, EncoderException, BlockException, MgmtException, PacketException {
Data data=new Data();
@@ -244,7 +245,7 @@ public class LogicFaceTest {
* 测试结果:
* [-15, 0, -6, 25, -52, 4, 4, 5, 6, 7, -15, 0, -5, 15, -15, 0, -4, 1, 1, -15, 0, -3, 1, 1, -15, 0, -2, 1, 0]
*/
// @Test
@Test
public void startUDPServer() throws IOException {
while(true){
//1.创建服务端+端口
@@ -263,6 +264,14 @@ public class LogicFaceTest {
SocketAddress remoteHost=packet.getSocketAddress();
System.out.println("remote host: "+packet.getSocketAddress());
// 睡眠5s
try {
System.out.println("start 5s sleeping ... ");
Thread.sleep(5000);
System.out.println("After 5s, wake up now!");
} catch (InterruptedException e) {
e.printStackTrace();
}
// 做数据应答
server.connect(remoteHost);
server.send(packet);
@@ -11,7 +11,7 @@ import org.bouncycastle.crypto.InvalidCipherTextException;
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
import org.eclipse.collections.api.partition.ordered.PartitionReversibleIterable;
//import org.eclipse.collections.api.partition.ordered.PartitionReversibleIterable;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
@@ -8,18 +8,18 @@ import minsecurity.crypto.sm2.SM2Base;
import minsecurity.crypto.sm2.SM2KeyPair;
import minsecurity.crypto.sm2.SM2PrivateKey;
import minsecurity.crypto.sm2.SM2PublicKey;
import minsecurity.identity.persist.IdentitySerializer;
import minsecurity.identity.persist.MapDB;
//import minsecurity.identity.persist.IdentitySerializer;
//import minsecurity.identity.persist.MapDB;
import minsecurity.identity.persist.Persist;
import minsecurity.identity.persist.sqlite.Sqlite;
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.junit.Test;
import org.mapdb.BTreeMap;
import org.mapdb.DB;
import org.mapdb.DBMaker;
import org.mapdb.Serializer;
//import org.mapdb.BTreeMap;
//import org.mapdb.DB;
//import org.mapdb.DBMaker;
//import org.mapdb.Serializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+2 -2
View File
@@ -11,8 +11,8 @@ import minsecurity.crypto.sm2.SM2KeyPair;
import minsecurity.identity.Identity;
import minsecurity.identity.KeyParam;
import minsecurity.identity.TestIdentity;
import org.checkerframework.checker.units.qual.C;
import org.checkerframework.checker.units.qual.K;
//import org.checkerframework.checker.units.qual.C;
//import org.checkerframework.checker.units.qual.K;
import org.junit.Test;
import org.slf4j.LoggerFactory;
import packet.CPacket;
@@ -10,7 +10,7 @@ import minsecurity.certificate.cert.Certificate;
import minsecurity.crypto.sm2.SM2KeyPair;
import minsecurity.identity.Identity;
import minsecurity.identity.KeyParam;
import org.checkerframework.checker.units.qual.K;
//import org.checkerframework.checker.units.qual.K;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;