org.apache.derbyTesting.functionTests.util
Class HarnessJavaTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.derbyTesting.junit.BaseTestCase
              extended by org.apache.derbyTesting.junit.BaseJDBCTestCase
                  extended by org.apache.derbyTesting.functionTests.util.CanonTestCase
                      extended by org.apache.derbyTesting.functionTests.util.HarnessJavaTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
JDBCHarnessJavaTest, LangHarnessJavaTest, NetHarnessJavaTest

public abstract class HarnessJavaTest
extends CanonTestCase

Run a '.java' test from the old harness in the Junit infrastructure. The test's output is compared to a master file using the facilities of the super class CanonTestCase.
This allows a faster switch to running all tests under a single JUnit infrastructure. Running a test using this class does not preclude it from being converted to a real JUnit assert based test.


Field Summary
private static java.lang.Object[] MAIN_ARG
           
private static java.lang.Class[] MAIN_ARG_TYPE
           
 
Fields inherited from class org.apache.derbyTesting.functionTests.util.CanonTestCase
DEFAULT_ENCODING, outputEncoding
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
protected HarnessJavaTest(java.lang.String name)
          Create a test, the name corresonds to the class name of the test (without any package information).
 
Method Summary
protected static junit.framework.Test decorate(HarnessJavaTest test)
          Decorate a HarnessJavaTest test.
protected abstract  java.lang.String getArea()
          Return the folder of the test, such as 'jdbcapi' or 'lang'.
 void runTest()
           
private  void setSystemOut(java.io.PrintStream out)
          Need to capture System.out so that we can compare it.
 
Methods inherited from class org.apache.derbyTesting.functionTests.util.CanonTestCase
compareCanon, getOutputStream, tearDown
 
Methods inherited from class org.apache.derbyTesting.junit.BaseJDBCTestCase
assertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertTableRowCount, assertUpdateCount, assertUpdateCount, checkAllConsistency, checkEstimatedRowCount, commit, createStatement, createStatement, createStatement, dropTable, dropTable, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbedded
 
Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, setName, setUp, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAIN_ARG

private static final java.lang.Object[] MAIN_ARG

MAIN_ARG_TYPE

private static final java.lang.Class[] MAIN_ARG_TYPE
Constructor Detail

HarnessJavaTest

protected HarnessJavaTest(java.lang.String name)
Create a test, the name corresonds to the class name of the test (without any package information).

Parameters:
name -
Method Detail

getArea

protected abstract java.lang.String getArea()
Return the folder of the test, such as 'jdbcapi' or 'lang'.


runTest

public void runTest()
             throws java.lang.Throwable
Overrides:
runTest in class junit.framework.TestCase
Throws:
java.lang.Throwable

decorate

protected static junit.framework.Test decorate(HarnessJavaTest test)
Decorate a HarnessJavaTest test. Any sub-class must call this decorator when adding a test to a suite. This sets up the ij system properties to setup the default connection to be to the default database. The lock timeouts are also shortened and the test will start in a clean database.


setSystemOut

private void setSystemOut(java.io.PrintStream out)
Need to capture System.out so that we can compare it.

Parameters:
out -

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.