17
|
1 package jp.ac.u_ryukyu.cr.ie.tatsuki.functionTest;
|
|
2
|
|
3 import java.util.Iterator;
|
|
4 import java.util.LinkedList;
|
|
5
|
|
6 import org.junit.Test;
|
|
7
|
|
8 import jp.ac.u_ryukyu.cr.ie.tatsuki.bbs.JuGrix;
|
|
9 import junit.framework.Assert;
|
|
10
|
32
|
11 public class DeepChildOrganizationIdsTest {
|
17
|
12
|
|
13 @Test
|
32
|
14 public void TestDeepChildOrganizationIds() {
|
31
|
15 JuGrix jugrix = new JuGrix(false);
|
17
|
16 LinkedList<String> filterIds = new LinkedList<String>();
|
|
17 filterIds.add("r:5");
|
|
18 Iterator<String> childrenIds = jugrix.deepChildOrganizationIds("o:2", filterIds);
|
|
19
|
|
20 Assert.assertTrue(childrenIds.hasNext());
|
|
21 String childrenId = childrenIds.next();
|
|
22 Assert.assertEquals(childrenId, "o:4");
|
|
23
|
|
24 filterIds.add("rde:4");
|
|
25 childrenIds = jugrix.deepChildOrganizationIds("o:2", filterIds);
|
|
26
|
|
27 Assert.assertTrue(childrenIds.hasNext());
|
|
28 childrenId = childrenIds.next();
|
|
29 Assert.assertEquals(childrenId, "o:4");
|
31
|
30
|
|
31
|
|
32 jugrix = new JuGrix(true);
|
|
33 filterIds = new LinkedList<String>();
|
|
34 filterIds.add("r:5");
|
|
35 childrenIds = jugrix.deepChildOrganizationIds("o:2", filterIds);
|
|
36
|
|
37 Assert.assertTrue(childrenIds.hasNext());
|
|
38 childrenId = childrenIds.next();
|
|
39 Assert.assertEquals(childrenId, "o:4");
|
|
40
|
|
41 filterIds.add("rde:4");
|
|
42 childrenIds = jugrix.deepChildOrganizationIds("o:2", filterIds);
|
|
43
|
|
44 Assert.assertTrue(childrenIds.hasNext());
|
|
45 childrenId = childrenIds.next();
|
|
46 Assert.assertEquals(childrenId, "o:4");
|
17
|
47 }
|
|
48 }
|