Mercurial > hg > Database > jungle-network
changeset 80:3f8ec40d536a
Added NetworkTreeOperationlogTest
author | one |
---|---|
date | Wed, 16 Oct 2013 19:38:56 +0900 (2013-10-16) |
parents | 5b9708d9febc |
children | b9dd8ec0e66e |
files | src/alice/jungle/operations/NetworkTreeOperationLog.java src/test/alice/jungle/core/operations/NetworkTreeOperationLogTest.java |
diffstat | 2 files changed, 29 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/jungle/operations/NetworkTreeOperationLog.java Wed Oct 16 19:25:02 2013 +0900 +++ b/src/alice/jungle/operations/NetworkTreeOperationLog.java Wed Oct 16 19:38:56 2013 +0900 @@ -31,10 +31,6 @@ size = _size; } - public Iterable<TreeOperation> getOperationLogList() { - return list; - } - @Override public Iterator<TreeOperation> iterator() { return list.iterator();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/alice/jungle/core/operations/NetworkTreeOperationLogTest.java Wed Oct 16 19:38:56 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.NetworkTreeOperationLog; +import junit.framework.TestCase; + +public class NetworkTreeOperationLogTest extends TestCase { + + public void testMsgpackConvert() throws IOException { + NetworkAppendChildAtOperation op = new NetworkAppendChildAtOperation(1); + NetworkNodePath path = new NetworkNodePath(); + path.add(1).add(2); + NetworkTreeOperationLog log = new NetworkTreeOperationLog(); + log.add(path, op); + log.add(path, op); + MessagePack msgpack = new MessagePack(); + Value v = msgpack.unconvert(log); + NetworkTreeOperationLog mLog = msgpack.convert(v, NetworkTreeOperationLog.class); + assertNotNull(mLog); + + } + +}