Code Search for Developers
 
 
  

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

Kneobase

Kneobase is an enterprise search engine, based upon the Lucene search engine and the Spring framework. It allows to perform full-text search across many different content sources. It is highly adaptable out-of-the-box and has a pluggable architecture.

Project homepage: http://sourceforge.net/projects/kneobase
Programming language(s): Java,XML
License: other

  ComposedConditonTest.java
  NameConditionTest.java
  PathConditionTest.java
  SizeConditionTest.java
  TypeConditionTest.java