Mercurial > hg > Database > jungle-network
view 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 source
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()); } }