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