public final class CreateTableFromQueryTest extends BaseJDBCTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
CreateTableFromQueryTest(java.lang.String name)
Public constructor required for running test as standalone JUnit.
|
Modifier and Type | Method and Description |
---|---|
static void |
decorate(java.sql.Statement stmt) |
private void |
positiveTest(java.lang.String sql,
java.lang.String[] columnNames,
java.lang.String[] nullability,
java.lang.String[] types) |
protected void |
setUp()
Set the fixture up with base tables t1 and t2.
|
static junit.framework.Test |
suite()
Create a suite of tests.
|
void |
testBaseTableDoesNotExist()
Test error when base table does not exist.
|
void |
testBasicTableCreation()
Test basic table creation.
|
void |
testColumnCountMismatch()
Test error when the number of columns in the column list does
not match the number of columns in the query expression.
|
void |
testCreateTableFromValues()
Test creating a table from a values statement.
|
void |
testCreateTableWithColumnList()
Test creating table with a list of column names.
|
void |
testCreateTableWithDerivedColumnName()
Test creating a table with a column list and system generated
column names in the query.
|
void |
testCreateTableWithGroupByInQuery() |
void |
testCreateTableWithMultipleBaseTables()
Test creating a table with multiple base tables.
|
void |
testCreateTableWithSubsetOfColumns()
Test creating a table with a subset of the base table's columns.
|
void |
testCreateTableWithSubsetOfColumnsAndColumnList()
Test creating a table with a subset of the base table's columns
and a column list.
|
void |
testDuplicateColumnName()
Test error when duplicate column names are specified in the column list.
|
void |
testInvalidDataType()
Test error for creating table where the data type is invalid.
|
void |
testNullValues()
Test error when the column type can not be determined.
|
void |
testParametersNotAllowed()
Test error when parameters are supplied in the query expression.
|
void |
testSystemGeneratedColumnName()
Test error when the query expression contains system generated
column names and no column list was provided.
|
void |
testUnimplementedWithDataClause()
Test error for unimplemented WITH DATA clause.
|
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, tearDown, 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, runTest, setName, toString
public CreateTableFromQueryTest(java.lang.String name)
public static void decorate(java.sql.Statement stmt) throws java.sql.SQLException
java.sql.SQLException
public static junit.framework.Test suite()
public void testBasicTableCreation() throws java.lang.Exception
java.lang.Exception
public void testCreateTableWithColumnList() throws java.lang.Exception
java.lang.Exception
public void testCreateTableWithSubsetOfColumns() throws java.lang.Exception
java.lang.Exception
public void testCreateTableWithSubsetOfColumnsAndColumnList() throws java.lang.Exception
java.lang.Exception
public void testCreateTableWithMultipleBaseTables() throws java.lang.Exception
java.lang.Exception
public void testCreateTableWithDerivedColumnName() throws java.lang.Exception
java.lang.Exception
public void testCreateTableFromValues() throws java.lang.Exception
java.lang.Exception
public void testCreateTableWithGroupByInQuery() throws java.lang.Exception
java.lang.Exception
public void testBaseTableDoesNotExist() throws java.lang.Exception
java.lang.Exception
public void testParametersNotAllowed() throws java.lang.Exception
java.lang.Exception
public void testDuplicateColumnName() throws java.lang.Exception
java.lang.Exception
public void testColumnCountMismatch() throws java.lang.Exception
java.lang.Exception
public void testSystemGeneratedColumnName() throws java.lang.Exception
java.lang.Exception
public void testNullValues() throws java.lang.Exception
java.lang.Exception
public void testUnimplementedWithDataClause() throws java.lang.Exception
java.lang.Exception
public void testInvalidDataType() throws java.lang.Exception
java.lang.Exception
private void positiveTest(java.lang.String sql, java.lang.String[] columnNames, java.lang.String[] nullability, java.lang.String[] types) throws java.lang.Exception
java.lang.Exception
protected void setUp() throws java.sql.SQLException
setUp
in class junit.framework.TestCase
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.