public class ErrorStreamTest extends BaseJDBCTestCase
| Modifier and Type | Field and Description |
|---|---|
private java.io.OutputStream |
errStream
Field errStream used as redirection for System.err to be able
to checks its (non-)use in the scenarios.
|
private java.io.File |
errStreamFile |
private static java.lang.String |
FIELD_PROP |
static java.io.OutputStream |
fieldStream
Field fieldStream used by Derby when FIELD_PROP is set,
so it needs to be public and static.
|
private java.io.File |
fieldStreamFile |
private static java.lang.String |
FILE_PROP |
private java.io.File |
fileStreamFile
File used when FILE_PROP is set, it maps to file
|
private static java.lang.String |
METHOD_PROP |
private static java.io.OutputStream |
methodStream
See doc for getStream() below.
|
private java.io.File |
methodStreamFile |
private static int |
runNo
runNo keeps track of which run we are in to generate unique (within a
JUnit run) names for files that are used in the test.
|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
ErrorStreamTest(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
private static void |
assertIsDirectory(java.io.File f) |
private static void |
assertIsEmpty(java.io.File f) |
private static void |
assertIsExisting(java.io.File f) |
private static void |
assertNotDirectory(java.io.File f) |
private static void |
assertNotEmpty(java.io.File f) |
private static void |
assertNotExisting(java.io.File f) |
private void |
bootDerby() |
private void |
closeStreams() |
private static boolean |
deleteFile(java.io.File f) |
private void |
deleteStreamFiles() |
private static java.lang.String |
getCanonicalPath(java.io.File f) |
static java.io.OutputStream |
getStream()
Method getStream used by Derby when derby.stream.error.method
is set.
|
private static void |
makeDirIfNotExisting(java.lang.String filename) |
private static java.lang.String |
makeStreamFilename(java.lang.String type) |
private static java.io.FileOutputStream |
newFileOutputStream(java.io.File f) |
private void |
nullFields() |
private void |
openStreams() |
private static void |
resetProps() |
private static void |
setSystemErr(java.io.PrintStream err) |
void |
setUp() |
static junit.framework.Test |
suite() |
void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testDefault()
Test that the error stream file (derby.log) is created at database boot
and not deleted when the database is shut down, but can be deleted
afterwards.
|
void |
testField()
Test the derby.stream.error.field property.
|
void |
testFile()
Test the derby.stream.error.file property.
|
void |
testFileOverField()
Test that the derby.stream.error.file property overrides the
derby.stream.error.field property.
|
void |
testFileOverMethod()
Test that the derby.stream.error.file property overrides the
derby.stream.error.method property.
|
void |
testFileOverMethodAndField()
Test that the derby.stream.error.file property overrides the
derby.stream.error.method and the derby.stream.error.field property.
|
void |
testMethod()
Test the derby.stream.error.method property.
|
void |
testMethodOverField()
Test that the derby.stream.error.field property overrides the
derby.stream.error.method property.
|
void |
testWrongField()
Test the derby.stream.error.field property with wrong input.
|
void |
testWrongFile()
Test the derby.stream.error.file property with wrong input.
|
void |
testWrongMethod()
Test the derby.stream.error.method property with wrong input.
|
assertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, 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, runTest, setName, toStringprivate static final java.lang.String FILE_PROP
private static final java.lang.String METHOD_PROP
private static final java.lang.String FIELD_PROP
private static int runNo
private java.io.File fileStreamFile
private static java.io.OutputStream methodStream
private java.io.File methodStreamFile
public static java.io.OutputStream fieldStream
private java.io.File fieldStreamFile
private java.io.OutputStream errStream
private java.io.File errStreamFile
public static junit.framework.Test suite()
public void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exceptionpublic void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.Exceptionpublic void testDefault()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testFile()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testWrongFile()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testMethod()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testWrongMethod()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testField()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testWrongField()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testFileOverMethod()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testFileOverField()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testFileOverMethodAndField()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testMethodOverField()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic static java.io.OutputStream getStream()
private static java.lang.String makeStreamFilename(java.lang.String type)
private void openStreams()
throws java.io.IOException
java.io.IOExceptionprivate void closeStreams()
throws java.io.IOException
java.io.IOExceptionprivate static void assertIsDirectory(java.io.File f)
throws java.io.IOException
java.io.IOExceptionprivate static void assertNotDirectory(java.io.File f)
throws java.io.IOException
java.io.IOExceptionprivate static void assertIsEmpty(java.io.File f)
throws java.io.IOException
java.io.IOExceptionprivate static void assertNotEmpty(java.io.File f)
throws java.io.IOException
java.io.IOExceptionprivate static void assertIsExisting(java.io.File f)
throws java.io.IOException
java.io.IOExceptionprivate static void assertNotExisting(java.io.File f)
throws java.io.IOException
java.io.IOExceptionprivate static boolean deleteFile(java.io.File f)
private static java.lang.String getCanonicalPath(java.io.File f)
throws java.io.IOException
java.io.IOExceptionprivate static void makeDirIfNotExisting(java.lang.String filename)
private static void setSystemErr(java.io.PrintStream err)
private static java.io.FileOutputStream newFileOutputStream(java.io.File f)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprivate static void resetProps()
private void deleteStreamFiles()
private void nullFields()
private void bootDerby()
throws java.sql.SQLException
java.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.