edu.indiana.iucbrf.systemtest
Class SystemTest

java.lang.Object
  extended by edu.indiana.iucbrf.systemtest.SystemTest
Direct Known Subclasses:
LeaveOneOutTest, ProblemIteratorTest, RandomProblemTest

public abstract class SystemTest
extends java.lang.Object

This is the base component class for testing of the system.


Field Summary
protected  int progressReportFrequency
           
 
Constructor Summary
SystemTest()
          Creates new Systemtest
 
Method Summary
protected  void maybeShowProgressReport(int i, PerformanceMonitor monitor, CaseBase cb)
           
protected abstract  void runTest(CBRSystem cbrSystem)
          The system designer must provide a definition of this method in order to run a specific test.
abstract  void setDomain(Domain domain)
          Set the domain in which this test is taking place.
 void setProgressReportFrequency(int progressReportFrequency)
           
 PerformanceMonitor test(CBRSystem cbrSystem)
           
 PerformanceMonitor test(CBRSystem cbrSystem, boolean doMaintenance)
          This method merely changes the system context to Context.TESTING_CONTEXT, calls runTest(), and then restores the original context.
 PerformanceMonitor test(CBRSystem cbrSystem, PerformanceMonitor testMonitor, boolean doMaintenance)
          This method merely changes the system context to Context.TESTING_CONTEXT, calls runAndReport(), and then restores the original context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

progressReportFrequency

protected int progressReportFrequency
Constructor Detail

SystemTest

public SystemTest()
Creates new Systemtest

Method Detail

setProgressReportFrequency

public void setProgressReportFrequency(int progressReportFrequency)

test

public PerformanceMonitor test(CBRSystem cbrSystem)

test

public PerformanceMonitor test(CBRSystem cbrSystem,
                               boolean doMaintenance)
This method merely changes the system context to Context.TESTING_CONTEXT, calls runTest(), and then restores the original context. The CBRSystem's current performance monitor is used to track the results of the tests, which will be cumulative with past system experience. This is the monitor that is returned.
If, as a result of Maintenance policies, the case base is changed, these changes will be visible in the system's case base after the test is complete. To prevent this, the case base must be copied before test() is called, and restored afterwards.

Parameters:
cbrSystem - The system to be tested.
doMaintenance - Set to true to do this system's standard maintenance; set to false to disable maintenance during the test.
Returns:
The system's performance monitor, which will be updated according to the experiences of the test.

test

public PerformanceMonitor test(CBRSystem cbrSystem,
                               PerformanceMonitor testMonitor,
                               boolean doMaintenance)
This method merely changes the system context to Context.TESTING_CONTEXT, calls runAndReport(), and then restores the original context. The CBRSystem's current performance monitor is used to track the results of the tests, which will be cumulative with past system experience. This is the monitor that is returned.
If, as a result of Maintenance policies, the case base is changed, these changes will be visible in the system's case base after the test is complete. To prevent this, the case base must be copied before test() is called, and restored afterwards.

Parameters:
cbrSystem - The system to be tested.
testMonitor - The performance monitor which will record the experiences of the system during this test.
doMaintenance - Set to true to do this system's standard maintenance; set to false to disable maintenance during the test.
Returns:
The testMonitor, updated according to the experiences of the test.

runTest

protected abstract void runTest(CBRSystem cbrSystem)
The system designer must provide a definition of this method in order to run a specific test.


setDomain

public abstract void setDomain(Domain domain)
Set the domain in which this test is taking place. Some implementations of this method may not need to do anything.


maybeShowProgressReport

protected void maybeShowProgressReport(int i,
                                       PerformanceMonitor monitor,
                                       CaseBase cb)