org.apache.derbyTesting.unitTests.harness
Class BasicUnitTestManager

java.lang.Object
  extended by org.apache.derbyTesting.unitTests.harness.BasicUnitTestManager
All Implemented Interfaces:
org.apache.derby.iapi.services.monitor.ModuleControl, UnitTestManager

public class BasicUnitTestManager
extends java.lang.Object
implements UnitTestManager, org.apache.derby.iapi.services.monitor.ModuleControl


Field Summary
private static boolean alreadyRun
           
private  org.apache.derby.iapi.services.context.ContextService contextService
           
private  org.apache.derby.iapi.services.stream.HeaderPrintWriter currentOutput
           
private  java.util.Hashtable namesOfTests
           
private  org.apache.derby.iapi.services.stream.HeaderPrintWriter output
           
private  boolean performanceReportOn
           
private  boolean reportOutputOn
           
private  boolean runForever
           
private  int testDuration
           
private  int testType
           
private  java.util.Vector vectorOfTests
           
 
Fields inherited from interface org.apache.derbyTesting.unitTests.harness.UnitTestManager
MODULE, RUN_FOREVER, SKIP_UNIT_TESTS
 
Constructor Summary
BasicUnitTestManager()
           
 
Method Summary
 void boot(boolean create, java.util.Properties startParams)
           
private  void emitAMessage(java.lang.String message)
          emitAMessage Convenience routine to emit messages.
private  void findTests(java.util.Properties testList, java.util.Properties startParams)
           
 void registerTest(UnitTest objectToTest, java.lang.String testName)
          register an object that has the UnitTest interface, marking what type it has and its duration.
private  boolean runATest(UnitTest aTest)
           
 boolean runTests()
          run the tests.
 boolean runTests(int testType, int testDuration)
          Convenience function to set the test type and duration for the UnitTestManager and then run the tests.
 void setPerformanceReportOn(boolean performanceReportOn)
          specify whether performance statistics should be gathered when tests are run.
 void setTestDuration(int testDuration)
          the test duration is set.
 void setTestType(int testType)
          the test duration is set.
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vectorOfTests

private java.util.Vector vectorOfTests

namesOfTests

private java.util.Hashtable namesOfTests

alreadyRun

private static boolean alreadyRun

output

private org.apache.derby.iapi.services.stream.HeaderPrintWriter output

currentOutput

private org.apache.derby.iapi.services.stream.HeaderPrintWriter currentOutput

testType

private int testType

testDuration

private int testDuration

reportOutputOn

private boolean reportOutputOn

performanceReportOn

private boolean performanceReportOn

contextService

private org.apache.derby.iapi.services.context.ContextService contextService

runForever

private boolean runForever
Constructor Detail

BasicUnitTestManager

public BasicUnitTestManager()
Method Detail

boot

public void boot(boolean create,
                 java.util.Properties startParams)
          throws org.apache.derby.iapi.error.StandardException
Specified by:
boot in interface org.apache.derby.iapi.services.monitor.ModuleControl
Throws:
org.apache.derby.iapi.error.StandardException

stop

public void stop()
Specified by:
stop in interface org.apache.derby.iapi.services.monitor.ModuleControl

registerTest

public void registerTest(UnitTest objectToTest,
                         java.lang.String testName)
Description copied from interface: UnitTestManager
register an object that has the UnitTest interface, marking what type it has and its duration. Tests are run in the order they were registered.

Specified by:
registerTest in interface UnitTestManager

findTests

private void findTests(java.util.Properties testList,
                       java.util.Properties startParams)

emitAMessage

private void emitAMessage(java.lang.String message)
emitAMessage Convenience routine to emit messages. This routine only works for messages provided by this package.

See Also:
for supported durations.

runATest

private boolean runATest(UnitTest aTest)

runTests

public boolean runTests()
Description copied from interface: UnitTestManager
run the tests. Tests are run in the order they were registered, filtered by type and duration set for the unit test manager.

Specified by:
runTests in interface UnitTestManager

runTests

public boolean runTests(int testType,
                        int testDuration)
Description copied from interface: UnitTestManager
Convenience function to set the test type and duration for the UnitTestManager and then run the tests.

Specified by:
runTests in interface UnitTestManager
See Also:
UnitTestConstants

setTestDuration

public void setTestDuration(int testDuration)
Description copied from interface: UnitTestManager
the test duration is set. This will be used when the tests are run; no tests with duration more than specified will be run.

Specified by:
setTestDuration in interface UnitTestManager

setTestType

public void setTestType(int testType)
Description copied from interface: UnitTestManager
the test duration is set. This will be used when the tests are run; no tests with duration more than specified will be run.

Specified by:
setTestType in interface UnitTestManager

setPerformanceReportOn

public void setPerformanceReportOn(boolean performanceReportOn)
Description copied from interface: UnitTestManager
specify whether performance statistics should be gathered when tests are run. The manager will collect the duration of each test, and will compare it to any previous runs it may have done of that test.

Specified by:
setPerformanceReportOn in interface UnitTestManager

Built on Sat 2009-11-28 18:44:18-0800, from revision 885187

Apache Derby V10.6 Internals - Copyright © 2004,2008 The Apache Software Foundation. All Rights Reserved.