TypeConditionTest.java from Kneobase at Krugle
Show TypeConditionTest.java syntax highlighted
/*
* Created on 18/05/2004
*
*/
package com.kneobase.driver.condition;
import java.util.Collection;
import java.util.Vector;
import junit.framework.TestCase;
import com.kneobase.driver.content.CompositeContentAux;
import com.kneobase.driver.content.ContentSourceAux;
import com.kneobase.driver.content.ContentUnitAux;
/**
* @author Ernesto De Santis
*
*/
public class TypeConditionTest extends TestCase {
public void testIncludes() {
try {
ContentSourceAux source = new ContentSourceAux();
CompositeContentAux composite = new CompositeContentAux();
ContentUnitAux cu = new ContentUnitAux();
cu.setType("zip");
TypeCondition category = new TypeCondition();
Collection types = new Vector();
types.add("zip");
category.setTypes(types);
assertTrue(category.isSatisfied(cu));
category = new TypeCondition();
Collection types2 = new Vector();
types2.add("pdf");
category.setTypes(types2);
assertFalse(category.isSatisfied(cu));
category = new TypeCondition();
Collection types3 = new Vector();
category.setTypes(types3);
assertFalse(category.isSatisfied(cu));
} catch (Exception e) {
fail();
}
}
}
See more files for this project here