public abstract class ScriptTestCase extends CanonTestCase
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
inputEncoding |
private java.util.Locale |
oldLocale |
private java.lang.String |
user |
private boolean |
useSystemProperties |
DEFAULT_ENCODING, outputEncoding
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
ScriptTestCase(java.lang.String script)
Create a ScriptTestCase to run a single test
using a connection obtained from getConnection()
|
ScriptTestCase(java.lang.String script,
boolean useSystemProperties)
Create a ScriptTestCase to run a single test
using a connection obtained from getConnection()
|
ScriptTestCase(java.lang.String script,
java.lang.String encoding)
Create a ScriptTestCase to run a single test
using a connection obtained from getConnection() with a
different encoding
|
ScriptTestCase(java.lang.String script,
java.lang.String inputEnc,
java.lang.String outputEnc,
java.lang.String user)
Create a ScriptTestCase to run a single test
using a connection obtained from getConnection() with a
different encoding.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getArea()
Return the folder (last element of the package) where
the .sql script lives, e.g. lang.
|
static junit.framework.Test |
getIJConfig(junit.framework.Test test)
Get a decorator to setup the ij in order
to run the test.
|
void |
runTest()
Run the test, using the resource as the input.
|
protected void |
setUp()
Set up the new locale for the test
|
protected void |
tearDown()
Revert the locale back to the old one
|
compareCanon, getOutputStream
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, setName, toString
private final java.lang.String inputEncoding
private final java.lang.String user
private boolean useSystemProperties
private java.util.Locale oldLocale
public ScriptTestCase(java.lang.String script, boolean useSystemProperties)
script
- Base name of the .sql scriptuseSystemProperties
- Whether to use system properties for this test
excluding the .sql suffix.public ScriptTestCase(java.lang.String script)
script
- Base name of the .sql script
excluding the .sql suffix.public ScriptTestCase(java.lang.String script, java.lang.String encoding)
script
- Base name of the .sql script
excluding the .sql suffix.public ScriptTestCase(java.lang.String script, java.lang.String inputEnc, java.lang.String outputEnc, java.lang.String user)
script
- Base name of the .sql script
excluding the .sql suffix.inputEnc
- The encoding for the script, if not null,
else use "US-ASCII"outputEnc
- The encoding for the ouput from the script,
if not null, else use "US-ASCII"user
- Run script as userprotected java.lang.String getArea()
public static junit.framework.Test getIJConfig(junit.framework.Test test)
public void runTest() throws java.lang.Throwable
runTest
in class junit.framework.TestCase
java.lang.Throwable
protected void setUp()
setUp
in class junit.framework.TestCase
protected void tearDown() throws java.lang.Exception
tearDown
in class BaseJDBCTestCase
java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.