Mercurial > hg > Members > tatsuki > JungleXMLReader
view src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/functionTest/parentOrganizationIdsTest.java @ 31:7f70341a78bc
all function use index
author | one |
---|---|
date | Sat, 08 Nov 2014 06:31:14 +0900 |
parents | ae739e8d86a2 |
children |
line wrap: on
line source
package jp.ac.u_ryukyu.cr.ie.tatsuki.functionTest; import java.util.Iterator; import java.util.LinkedList; import jp.ac.u_ryukyu.cr.ie.tatsuki.bbs.JuGrix; import junit.framework.Assert; import org.junit.Test; public class parentOrganizationIdsTest { @Test public void parentOrganizationIdsTest() { JuGrix jugrix = new JuGrix(false); LinkedList<String> filterIds = new LinkedList<String>(); filterIds.add("r:2"); Iterator<String> childrenIds = jugrix.parentOrganizationIds("o:2", filterIds); Assert.assertTrue(childrenIds.hasNext()); Assert.assertEquals(childrenIds.next(), "o:23"); filterIds.add("r:2a"); childrenIds = jugrix.parentOrganizationIds("o:2", filterIds); Assert.assertFalse(childrenIds.hasNext()); jugrix = new JuGrix(true); filterIds = new LinkedList<String>(); filterIds.add("r:2"); childrenIds = jugrix.parentOrganizationIds("o:2", filterIds); Assert.assertTrue(childrenIds.hasNext()); Assert.assertEquals(childrenIds.next(), "o:23"); filterIds.add("r:2a"); childrenIds = jugrix.parentOrganizationIds("o:2", filterIds); Assert.assertFalse(childrenIds.hasNext()); } }