mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
测试利用mgmt发送注册前缀
This commit is contained in:
1 parent
cd610d7b5e
commit
4cc1c88ed2
2 files changed
+18
-3
No files matched your search
@@ -142,11 +142,11 @@ public class LogicFaceTest {
|
|||||||
data.setName(name);
|
data.setName(name);
|
||||||
|
|
||||||
LogicFace face=new LogicFace();
|
LogicFace face=new LogicFace();
|
||||||
face.initWithUdp("127.0.0.1",50000);
|
face.initWithUdp("192.168.3.9",50000);
|
||||||
face.sendData(data);
|
face.sendData(data);
|
||||||
|
|
||||||
// 等待两秒钟,接收数据包
|
// 等待两秒钟,接收数据包
|
||||||
Data data1 = face.receiveData(4000);
|
Data data1 = face.receiveData(9000);
|
||||||
System.out.println(Arrays.toString(
|
System.out.println(Arrays.toString(
|
||||||
new SelfEncodingBase().selfWireEncode(data1).getRaw()));
|
new SelfEncodingBase().selfWireEncode(data1).getRaw()));
|
||||||
}catch (LogicFaceException | ComponentException | EncoderException | BlockException | PacketException | MgmtException e){
|
}catch (LogicFaceException | ComponentException | EncoderException | BlockException | PacketException | MgmtException e){
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
package mgmt;
|
package mgmt;
|
||||||
|
|
||||||
|
import component.ComponentException;
|
||||||
|
import component.Identifier;
|
||||||
|
import logicface.LogicFace;
|
||||||
|
import logicface.LogicFaceException;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import security.KeyChain;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @Author: Wang Feng
|
* @Author: Wang Feng
|
||||||
@@ -11,7 +17,16 @@ import org.junit.Test;
|
|||||||
*/
|
*/
|
||||||
public class RegisterPrefixHelperTest {
|
public class RegisterPrefixHelperTest {
|
||||||
@Test
|
@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