Mercurial > hg > Database > jungle-network
comparison src/test/alice/jungle/core/operations/NetworkTreeOperationTest.java @ 77:2dba7e1cf9fa
Added NetworknodeOperation and Test
author | one |
---|---|
date | Tue, 15 Oct 2013 16:01:11 +0900 |
parents | |
children | 5b9708d9febc |
comparison
equal
deleted
inserted
replaced
76:9e3198bf9547 | 77:2dba7e1cf9fa |
---|---|
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.NetworkTreeOperation; | |
11 import junit.framework.TestCase; | |
12 | |
13 public class NetworkTreeOperationTest 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 NetworkTreeOperation treeOp = new NetworkTreeOperation(path, op); | |
20 MessagePack msgpack = new MessagePack(); | |
21 Value v = msgpack.unconvert(treeOp); | |
22 NetworkTreeOperation mOp = msgpack.convert(v, NetworkTreeOperation.class); | |
23 assertNotNull(mOp.getNodePath()); | |
24 assertEquals(op.getCommand(), mOp.getNodeOperation().getCommand()); | |
25 | |
26 | |
27 } | |
28 | |
29 } |