Code Search for Developers
 
 
  

FSRobotTest.java from Kneobase at Krugle


Show FSRobotTest.java syntax highlighted

/*
 * Created on 19/05/2004
 *
 */
package com.kneobase.driver.fs;

import junit.framework.TestCase;

import com.kneobase.*;
import com.kneobase.driver.Robot;
import com.kneobase.driver.SourceConfiguration;
import com.kneobase.server.I_IndexConstants;
import com.kneobase.server.IndexSessionAux;

/**
 * @author Ernesto De Santis
 *
 */
public class FSRobotTest extends TestCase {

    private static final String TESTFOLDER = "testfolder";

    private IndexSessionAux indexSession;
    
    public void doIndex(){
        try{
            indexSession = new IndexSessionAux();

            Robot robot = new Robot();
            SourceConfiguration configuration = new SourceConfiguration(FSTests.CONFIGURATIONPATH);
            robot.setConfiguration(configuration);
            
            indexSession.setRobot(robot);
            indexSession.doIndex();
        }catch(Exception e){
            fail();
        }
    }
    
    public void testIterator(){
        this.doIndex();
        
        while(!indexSession.getStatus().equals(I_IndexConstants.INDEXATION_RUNNING)){
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                fail();
            }
        }

        assertTrue(0 != indexSession.getContentsIndexed());
        assertTrue(0 != indexSession.getContentsProcessed());
        assertTrue(0 == indexSession.getContentsSkipped());
        assertEquals(indexSession.getStatus(), I_IndexConstants.INDEXATION_FINISHOK);
    }

}




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

  FSRobotConfigurationTest.java
  FSRobotTest.java