7
|
1 package jp.ac.u_ryukyu.cr.ie.tatsuki.functionTest;
|
|
2
|
|
3 import java.util.Iterator;
|
12
|
4 import java.util.LinkedList;
|
7
|
5
|
|
6 import jp.ac.u_ryukyu.cr.ie.tatsuki.bbs.JuGrix;
|
|
7 import junit.framework.Assert;
|
|
8
|
|
9 import org.junit.Test;
|
|
10
|
28
|
11
|
7
|
12 public class PersonIdsTest {
|
|
13
|
31
|
14 @Test
|
32
|
15 public void testPersonIds() {
|
31
|
16
|
42
|
17 JuGrix jugrix = new JuGrix();
|
31
|
18 LinkedList<String> filterIds = new LinkedList<String>();
|
42
|
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
|
31
|
26 filterIds.add("r:9");
|
42
|
27 ids = jugrix.personIds("o:2", filterIds);
|
8
|
28
|
34
|
29 Assert.assertTrue(ids.hasNext());
|
31
|
30 Assert.assertEquals(ids.next(), "p:45");
|
42
|
31 Assert.assertTrue(ids.hasNext());
|
31
|
32 Assert.assertEquals(ids.next(), "p:1");
|
|
33
|
42
|
34
|
31
|
35 filterIds.add("rde:3");
|
|
36 ids = jugrix.personIds("o:2", filterIds);
|
|
37
|
|
38 ids.hasNext();
|
|
39 Assert.assertEquals(ids.next(), "p:45");
|
42
|
40 ids.hasNext();
|
31
|
41 Assert.assertEquals(ids.next(), "p:1");
|
7
|
42
|
42
|
43
|
|
44
|
31
|
45 filterIds.add("rde:322");
|
|
46 ids = jugrix.personIds("o:2", filterIds);
|
|
47 Assert.assertFalse(ids.hasNext());
|
|
48
|
42
|
49 }
|
7
|
50 }
|