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
|
32
|
11 public class ParentOrganizationIdsTest {
|
20
|
12 @Test
|
32
|
13 public void testParentOrganizationIds() {
|
42
|
14 JuGrix jugrix = new JuGrix();
|
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
|
42
|
25 filterIds = new LinkedList<String>();
|
|
26 filterIds.add("rde:2");
|
31
|
27 childrenIds = jugrix.parentOrganizationIds("o:2", filterIds);
|
|
28 Assert.assertTrue(childrenIds.hasNext());
|
|
29 Assert.assertEquals(childrenIds.next(), "o:23");
|
42
|
30
|
20
|
31 }
|
|
32 }
|