Mercurial > hg > Members > tatsuki > JungleXMLReader
comparison src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/functionTest/PersonIdsTest.java @ 42:c036d36c33af
function refactor
author | one |
---|---|
date | Tue, 25 Nov 2014 11:57:17 +0900 |
parents | 96dcbd8e2fcb |
children | 1bdd50e26fac |
comparison
equal
deleted
inserted
replaced
40:59a7d2cffc86 | 42:c036d36c33af |
---|---|
12 public class PersonIdsTest { | 12 public class PersonIdsTest { |
13 | 13 |
14 @Test | 14 @Test |
15 public void testPersonIds() { | 15 public void testPersonIds() { |
16 | 16 |
17 JuGrix jugrix = new JuGrix(false); | 17 JuGrix jugrix = new JuGrix(); |
18 LinkedList<String> filterIds = new LinkedList<String>(); | 18 LinkedList<String> filterIds = new LinkedList<String>(); |
19 | |
20 Iterator<String> ids = jugrix.personIds("o:2", filterIds); | |
21 Assert.assertTrue(ids.hasNext()); | |
22 Assert.assertEquals(ids.next(), "p:1"); | |
23 Assert.assertTrue(ids.hasNext()); | |
24 Assert.assertEquals(ids.next(), "p:45"); | |
25 | |
19 filterIds.add("r:9"); | 26 filterIds.add("r:9"); |
20 Iterator<String> ids = jugrix.personIds("o:2", filterIds); | 27 ids = jugrix.personIds("o:2", filterIds); |
21 | 28 |
22 Assert.assertTrue(ids.hasNext()); | 29 Assert.assertTrue(ids.hasNext()); |
23 Assert.assertEquals(ids.next(), "p:45"); | 30 Assert.assertEquals(ids.next(), "p:45"); |
31 Assert.assertTrue(ids.hasNext()); | |
24 Assert.assertEquals(ids.next(), "p:1"); | 32 Assert.assertEquals(ids.next(), "p:1"); |
33 | |
25 | 34 |
26 filterIds.add("rde:3"); | 35 filterIds.add("rde:3"); |
27 ids = jugrix.personIds("o:2", filterIds); | 36 ids = jugrix.personIds("o:2", filterIds); |
28 | 37 |
29 ids.hasNext(); | 38 ids.hasNext(); |
30 Assert.assertEquals(ids.next(), "p:45"); | 39 Assert.assertEquals(ids.next(), "p:45"); |
40 ids.hasNext(); | |
31 Assert.assertEquals(ids.next(), "p:1"); | 41 Assert.assertEquals(ids.next(), "p:1"); |
42 | |
43 | |
32 | 44 |
33 filterIds.add("rde:322"); | 45 filterIds.add("rde:322"); |
34 ids = jugrix.personIds("o:2", filterIds); | 46 ids = jugrix.personIds("o:2", filterIds); |
35 Assert.assertFalse(ids.hasNext()); | 47 Assert.assertFalse(ids.hasNext()); |
36 | 48 |
37 jugrix = new JuGrix(true); | 49 } |
38 filterIds = new LinkedList<String>(); | |
39 filterIds.add("r:9"); | |
40 ids = jugrix.personIds("o:2", filterIds); | |
41 | |
42 ids.hasNext(); | |
43 Assert.assertEquals(ids.next(), "p:45"); | |
44 Assert.assertEquals(ids.next(), "p:1"); | |
45 | |
46 filterIds.add("rde:3"); | |
47 ids = jugrix.personIds("o:2", filterIds); | |
48 | |
49 ids.hasNext(); | |
50 Assert.assertEquals(ids.next(), "p:45"); | |
51 Assert.assertEquals(ids.next(), "p:1"); | |
52 | |
53 filterIds.add("rde:322"); | |
54 ids = jugrix.personIds("o:2", filterIds); | |
55 Assert.assertFalse(ids.hasNext()); | |
56 } | |
57 } | 50 } |