80
|
1 package test.alice.jungle.core.operations;
|
|
2
|
|
3 import java.io.IOException;
|
|
4
|
|
5 import org.msgpack.MessagePack;
|
|
6 import org.msgpack.type.Value;
|
|
7
|
|
8 import alice.jungle.operations.NetworkAppendChildAtOperation;
|
|
9 import alice.jungle.operations.NetworkNodePath;
|
|
10 import alice.jungle.operations.NetworkTreeOperationLog;
|
|
11 import junit.framework.TestCase;
|
|
12
|
|
13 public class NetworkTreeOperationLogTest extends TestCase {
|
|
14
|
|
15 public void testMsgpackConvert() throws IOException {
|
|
16 NetworkAppendChildAtOperation op = new NetworkAppendChildAtOperation(1);
|
|
17 NetworkNodePath path = new NetworkNodePath();
|
|
18 path.add(1).add(2);
|
|
19 NetworkTreeOperationLog log = new NetworkTreeOperationLog();
|
|
20 log.add(path, op);
|
|
21 log.add(path, op);
|
|
22 MessagePack msgpack = new MessagePack();
|
|
23 Value v = msgpack.unconvert(log);
|
|
24 NetworkTreeOperationLog mLog = msgpack.convert(v, NetworkTreeOperationLog.class);
|
|
25 assertNotNull(mLog);
|
|
26
|
|
27 }
|
|
28
|
|
29 }
|