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