Mercurial > hg > Members > nobuyasu > jungle-network
diff src/alice/jungle/operations/NetworkNodePath.java @ 68:b0af3960917f
Added NetworkNodePathTest
author | one |
---|---|
date | Thu, 10 Oct 2013 20:26:33 +0900 |
parents | 89e39301ccaa |
children | 9e3198bf9547 |
line wrap: on
line diff
--- a/src/alice/jungle/operations/NetworkNodePath.java Thu Oct 10 19:17:21 2013 +0900 +++ b/src/alice/jungle/operations/NetworkNodePath.java Thu Oct 10 20:26:33 2013 +0900 @@ -1,8 +1,13 @@ package alice.jungle.operations; +import java.io.IOException; import java.util.Iterator; import java.util.LinkedList; +import org.msgpack.MessagePack; +import org.msgpack.annotation.Message; +import org.msgpack.type.Value; + import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; @@ -11,6 +16,17 @@ { LinkedList<Integer> path; + public static void main(String[] args) throws IOException { + NetworkNodePath path = new NetworkNodePath(); + path = path.add(1).add(2).add(3); + MessagePack msgpack = new MessagePack(); + Value value = msgpack.unconvert(path); + NetworkNodePath mPath = msgpack.convert(value, NetworkNodePath.class); + for (Integer i : mPath) { + System.out.println(i); + } + } + public NetworkNodePath() { path = new LinkedList<Integer>(); }