view src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/functionTest/deepParentOrganizationIdsPlusTest.java @ 31:7f70341a78bc

all function use index
author one
date Sat, 08 Nov 2014 06:31:14 +0900
parents ef3fae2e7f0c
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 deepParentOrganizationIdsPlusTest {
	@Test
	public void deepParentOrganizationIdsPlus(){
		JuGrix jugrix = new JuGrix(false);
		LinkedList<String> filterIds = new LinkedList<String>();
		//filterIds.add("r:2");
		Iterator<String> childrenIds = jugrix.deepParentOrganizationIdsPlus("o:2", filterIds);
		Assert.assertEquals(childrenIds.next(),"o:23");
		Assert.assertEquals(childrenIds.next(),"o:22");
    Assert.assertEquals(childrenIds.next(),"o:2");
		
		filterIds.add("r:2");
		childrenIds = jugrix.deepParentOrganizationIds("o:2", filterIds);
		
		Assert.assertEquals(childrenIds.next(),"o:23");

		
		jugrix = new JuGrix(true);
    filterIds = new LinkedList<String>();
    //filterIds.add("r:2");
    childrenIds = jugrix.deepParentOrganizationIdsPlus("o:2", filterIds);
    Assert.assertEquals(childrenIds.next(),"o:23");
    Assert.assertEquals(childrenIds.next(),"o:22");
    Assert.assertEquals(childrenIds.next(),"o:2");
    
    filterIds.add("r:2");
    childrenIds = jugrix.deepParentOrganizationIds("o:2", filterIds);
    
    Assert.assertEquals(childrenIds.next(),"o:23");
	}
}