Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/test/java/alice/jungle/datasegment/NetworkNodePathTest.java @ 105:f9e29a52efd3
Move some files
author | one |
---|---|
date | Tue, 26 Nov 2013 06:43:10 +0900 |
parents | src/test/alice/jungle/datasegment/NetworkNodePathTest.java@892bac9ac118 |
children |
comparison
equal
deleted
inserted
replaced
104:03bf62bb699e | 105:f9e29a52efd3 |
---|---|
1 package alice.jungle.datasegment; | |
2 | |
3 import java.io.IOException; | |
4 import java.util.Iterator; | |
5 | |
6 import alice.jungle.operations.NetworkNodePath; | |
7 | |
8 import org.msgpack.MessagePack; | |
9 import org.msgpack.type.Value; | |
10 | |
11 import junit.framework.TestCase; | |
12 | |
13 public class NetworkNodePathTest extends TestCase { | |
14 | |
15 public void testMsgpackConvert() throws IOException { | |
16 NetworkNodePath path = new NetworkNodePath(); | |
17 path = path.add(1).add(2).add(3); | |
18 MessagePack msgpack = new MessagePack(); | |
19 Value value = msgpack.unconvert(path); | |
20 NetworkNodePath mPath = msgpack.convert(value, NetworkNodePath.class); | |
21 assertEquals(path.size(), mPath.size()); | |
22 Iterator<Integer> iter1 = path.iterator(); | |
23 Iterator<Integer> iter2 = mPath.iterator(); | |
24 while(iter1.hasNext() & iter2.hasNext()) { | |
25 int i1 = iter1.next(); | |
26 int i2 = iter2.next(); | |
27 assertEquals(i1, i2); | |
28 } | |
29 } | |
30 | |
31 | |
32 | |
33 } |