mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-06-18 04:50:25 +08:00
测试利用mgmt发送注册前缀
This commit is contained in:
@@ -142,11 +142,11 @@ public class LogicFaceTest {
|
||||
data.setName(name);
|
||||
|
||||
LogicFace face=new LogicFace();
|
||||
face.initWithUdp("127.0.0.1",50000);
|
||||
face.initWithUdp("192.168.3.9",50000);
|
||||
face.sendData(data);
|
||||
|
||||
// 等待两秒钟,接收数据包
|
||||
Data data1 = face.receiveData(4000);
|
||||
Data data1 = face.receiveData(9000);
|
||||
System.out.println(Arrays.toString(
|
||||
new SelfEncodingBase().selfWireEncode(data1).getRaw()));
|
||||
}catch (LogicFaceException | ComponentException | EncoderException | BlockException | PacketException | MgmtException e){
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package mgmt;
|
||||
|
||||
import component.ComponentException;
|
||||
import component.Identifier;
|
||||
import logicface.LogicFace;
|
||||
import logicface.LogicFaceException;
|
||||
import org.junit.Test;
|
||||
import security.KeyChain;
|
||||
|
||||
|
||||
/*
|
||||
* @Author: Wang Feng
|
||||
@@ -11,7 +17,16 @@ import org.junit.Test;
|
||||
*/
|
||||
public class RegisterPrefixHelperTest {
|
||||
@Test
|
||||
public void registerPrefixTest(){
|
||||
public void registerPrefixTest() throws Exception {
|
||||
// 注册前缀Identifier
|
||||
Identifier identifier=new Identifier("/hello/wefree");
|
||||
// 初始化face
|
||||
LogicFace face=new LogicFace();
|
||||
face.initWithUdp("127.0.0.1",50000);
|
||||
// 初始化KeyChain
|
||||
// KeyChain keyChain=new KeyChain();
|
||||
|
||||
RegisterPrefixHelper helper=new RegisterPrefixHelper();
|
||||
helper.registerPrefix(identifier,face,null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user