Mercurial > hg > Database > jungle-network
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/alice/jungle/core/operations/NetworkTreeOperationTest.java Tue Oct 15 16:01:11 2013 +0900 @@ -0,0 +1,29 @@ +package test.alice.jungle.core.operations; + +import java.io.IOException; + +import org.msgpack.MessagePack; +import org.msgpack.type.Value; + +import alice.jungle.operations.NetworkAppendChildAtOperation; +import alice.jungle.operations.NetworkNodePath; +import alice.jungle.operations.NetworkTreeOperation; +import junit.framework.TestCase; + +public class NetworkTreeOperationTest extends TestCase { + + public void testMsgpackConvert() throws IOException { + NetworkAppendChildAtOperation op = new NetworkAppendChildAtOperation(1); + NetworkNodePath path = new NetworkNodePath(); + path.add(1).add(2); + NetworkTreeOperation treeOp = new NetworkTreeOperation(path, op); + MessagePack msgpack = new MessagePack(); + Value v = msgpack.unconvert(treeOp); + NetworkTreeOperation mOp = msgpack.convert(v, NetworkTreeOperation.class); + assertNotNull(mOp.getNodePath()); + assertEquals(op.getCommand(), mOp.getNodeOperation().getCommand()); + + + } + +}