Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/test/java/alice/jungle/core/operations/NetworkTreeOperationTest.java @ 105:f9e29a52efd3
Move some files
author | one |
---|---|
date | Tue, 26 Nov 2013 06:43:10 +0900 |
parents | src/test/alice/jungle/core/operations/NetworkTreeOperationTest.java@5b9708d9febc |
children |
comparison
equal
deleted
inserted
replaced
104:03bf62bb699e | 105:f9e29a52efd3 |
---|---|
1 package alice.jungle.core.operations; | |
2 | |
3 import java.io.IOException; | |
4 | |
5 import alice.jungle.operations.NetworkAppendChildAtOperation; | |
6 import alice.jungle.operations.NetworkNodePath; | |
7 import alice.jungle.operations.NetworkTreeOperation; | |
8 | |
9 import org.msgpack.MessagePack; | |
10 import org.msgpack.type.Value; | |
11 | |
12 import junit.framework.TestCase; | |
13 | |
14 public class NetworkTreeOperationTest 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 NetworkTreeOperation treeOp = new NetworkTreeOperation(path, op); | |
21 MessagePack msgpack = new MessagePack(); | |
22 Value v = msgpack.unconvert(treeOp); | |
23 NetworkTreeOperation mOp = msgpack.convert(v, NetworkTreeOperation.class); | |
24 assertNotNull(mOp.getNodePath()); | |
25 assertEquals(op.getCommand(), mOp.getNodeOperation().getCommand()); | |
26 } | |
27 | |
28 } |