com.sun.labs.minion.test.regression.merge
Class MergeTestReplayer

java.lang.Object
  extended by com.sun.labs.minion.test.regression.merge.MergeTest
      extended by com.sun.labs.minion.test.regression.merge.MergeTestReplayer

public class MergeTestReplayer
extends MergeTest

MergeTestReplayer replays the log from MergeTest and recreates the run of files indexed. It emits its results on the console.


Nested Class Summary
 class MergeTestReplayer.MergeReplayReporter
          MergeTestReporter is a TestReporter that emits its report to the console.
 
Field Summary
 
Fields inherited from class com.sun.labs.minion.test.regression.merge.MergeTest
charEnc, cmFile, documentCount, documentDirectory, engine, indexDir, iterations, logger, logTag, outputDirectory, reporter
 
Constructor Summary
MergeTestReplayer(java.lang.String indexDir, java.lang.String cmFile, java.lang.String string)
          Create a new instance of me
 
Method Summary
 void addArgument(java.lang.String entryKey, java.lang.String entryValue)
          Add an option to the table of arguments
 void checkEnvironment(java.lang.String entryKey, java.lang.String entryValue)
          Compare the value of an environment key with the environment at startup.
If the values differ, writes an entry to system.err
 void checkMemory(java.lang.String entryKey, java.lang.String entryValue)
          Compare the value for a memory setting from the log with the same setting at startup.
If the values differ, writes an entry to system.err
 void checkProperty(java.lang.String entryKey, java.lang.String entryValue)
          Compare the value of a system property from the log with the same property at startup.
If the values differ, writes an entry to system.err
 void completeConfiguration()
          All the information about the configuration has been read from the log, so now we read the arguments, and create the search engine
 com.sun.labs.minion.test.regression.merge.ElementHandler getElementHandler(java.lang.String string)
           
 void index(java.util.Map<java.lang.String,java.lang.Boolean> fileTable)
           
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)
          Start the application.
protected  void openReporter(java.lang.String[] args)
          Open the test reporter.
protected  void optimize()
          Merges the partitions of the index.
 java.lang.Object peekHandlerStack()
          Return the entry that's at the top of the handlerStack for the content handler
 
Methods inherited from class com.sun.labs.minion.test.regression.merge.MergeTest
createSearchEngine, diff, diff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeTestReplayer

public MergeTestReplayer(java.lang.String indexDir,
                         java.lang.String cmFile,
                         java.lang.String string)
Create a new instance of me

Parameters:
string - the location of the XML file containing the log of a MergeTest
Method Detail

addArgument

public void addArgument(java.lang.String entryKey,
                        java.lang.String entryValue)
Add an option to the table of arguments

Parameters:
entryKey - the argument flag, e.g. '-x'
entryValue - the value of the argument, e.g. '10'

checkEnvironment

public void checkEnvironment(java.lang.String entryKey,
                             java.lang.String entryValue)
Compare the value of an environment key with the environment at startup.
If the values differ, writes an entry to system.err

Parameters:
entryKey - the key for the environment value
entryValue - the environment value

checkProperty

public void checkProperty(java.lang.String entryKey,
                          java.lang.String entryValue)
Compare the value of a system property from the log with the same property at startup.
If the values differ, writes an entry to system.err

Parameters:
entryKey - the key of the system property
entryValue - the value of the system property

checkMemory

public void checkMemory(java.lang.String entryKey,
                        java.lang.String entryValue)
Compare the value for a memory setting from the log with the same setting at startup.
If the values differ, writes an entry to system.err

Parameters:
entryKey - the key for the memory setting (currently total, free and max)
entryValue - the value for a memory setting

invert

protected void invert()
Description copied from class: MergeTest
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.

Overrides:
invert in class MergeTest

optimize

protected void optimize()
Description copied from class: MergeTest
Merges the partitions of the index.

Overrides:
optimize in class MergeTest

main

public static void main(java.lang.String[] args)
Start the application. Provide the location of the log file using the -r option.

Parameters:
args -

peekHandlerStack

public java.lang.Object peekHandlerStack()
Return the entry that's at the top of the handlerStack for the content handler

Returns:
the object at the top of the handler stack

completeConfiguration

public void completeConfiguration()
All the information about the configuration has been read from the log, so now we read the arguments, and create the search engine

Throws:
SearchEngineException
com.sun.labs.util.props.PropertyException
java.io.IOException

openReporter

protected void openReporter(java.lang.String[] args)
Description copied from class: MergeTest
Open the test reporter.

Overrides:
openReporter in class MergeTest
Parameters:
args - the arguments that started the execution of the program

getElementHandler

public com.sun.labs.minion.test.regression.merge.ElementHandler getElementHandler(java.lang.String string)

index

public void index(java.util.Map<java.lang.String,java.lang.Boolean> fileTable)