com.sun.labs.minion.test.regression
Class DeletionTest

java.lang.Object
  extended by com.sun.labs.minion.test.regression.DeletionTest

public class DeletionTest
extends java.lang.Object

Regression test to check that files are deleted from the index.


Field Summary
protected static java.lang.String charEnc
          The character encoding
protected  java.lang.String cmFile
          The filename of the configuration file if provided on the command line args
protected  java.io.File documentDirectory
          The directory containing the documents to be indexed
protected  SearchEngineImpl engine
          A search engine
protected  java.lang.String indexDir
          The directory to contain the index
protected  java.io.File outputDirectory
          The directory into which the de-indexed files should be written
 
Constructor Summary
DeletionTest()
          Default contructor.
DeletionTest(java.lang.String indexDir, int iterations, java.lang.String cmFile, java.lang.String dDir, java.lang.String oDir)
          Create a new instance of the test class
 
Method Summary
protected  void createSearchEngine(java.lang.String cmFile, java.lang.String indexDir)
          Creates a new instance of a search engines and assigns it to the field
protected  void invert()
          Takes the index and reproduces the documents that produced it.
The documents are reproduced into the output directory, with any files already there being deleted.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

charEnc

protected static java.lang.String charEnc
The character encoding


outputDirectory

protected java.io.File outputDirectory
The directory into which the de-indexed files should be written


indexDir

protected java.lang.String indexDir
The directory to contain the index


engine

protected SearchEngineImpl engine
A search engine


documentDirectory

protected java.io.File documentDirectory
The directory containing the documents to be indexed


cmFile

protected java.lang.String cmFile
The filename of the configuration file if provided on the command line args

Constructor Detail

DeletionTest

public DeletionTest()
Default contructor. Sets up the index inverter


DeletionTest

public DeletionTest(java.lang.String indexDir,
                    int iterations,
                    java.lang.String cmFile,
                    java.lang.String dDir,
                    java.lang.String oDir)
             throws java.io.FileNotFoundException
Create a new instance of the test class

Parameters:
indexDir - the location of the index directory
iterations - the number of random files to be deleted
cmFile - the file name for the configuration file
dDir - the name of the document directory
oDir - the name of the output directory
Throws:
java.io.FileNotFoundException
Method Detail

main

public static void main(java.lang.String[] args)
                 throws SearchEngineException
Parameters:
args -
Throws:
SearchEngineException

invert

protected void invert()
               throws java.io.IOException
Takes the index and reproduces the documents that produced it.
The documents are reproduced into the output directory, with any files already there being deleted.

Throws:
java.io.IOException

createSearchEngine

protected void createSearchEngine(java.lang.String cmFile,
                                  java.lang.String indexDir)
Creates a new instance of a search engines and assigns it to the field