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
|
|
17 JuGrix jugrix = new JuGrix(false);
|
|
18 LinkedList<String> filterIds = new LinkedList<String>();
|
|
19 filterIds.add("r:9");
|
|
20 Iterator<String> ids = jugrix.personIds("o:2", filterIds);
|
8
|
21
|
34
|
22 Assert.assertTrue(ids.hasNext());
|
31
|
23 Assert.assertEquals(ids.next(), "p:45");
|
|
24 Assert.assertEquals(ids.next(), "p:1");
|
|
25
|
|
26 filterIds.add("rde:3");
|
|
27 ids = jugrix.personIds("o:2", filterIds);
|
|
28
|
|
29 ids.hasNext();
|
|
30 Assert.assertEquals(ids.next(), "p:45");
|
|
31 Assert.assertEquals(ids.next(), "p:1");
|
7
|
32
|
31
|
33 filterIds.add("rde:322");
|
|
34 ids = jugrix.personIds("o:2", filterIds);
|
|
35 Assert.assertFalse(ids.hasNext());
|
|
36
|
|
37 jugrix = new JuGrix(true);
|
|
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");
|
12
|
45
|
31
|
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 }
|
7
|
57 }
|