Mercurial > hg > Members > nobuyasu > jungle-network
view src/test/alice/jungle/core/operations/NetworkTreeOperationTest.java @ 79:5b9708d9febc
Modified NetworkTreeOperationLog NetworkNodeOperation
author | one |
---|---|
date | Wed, 16 Oct 2013 19:25:02 +0900 |
parents | 2dba7e1cf9fa |
children |
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()); } }