public class BigDataTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
BIG_TABLE_NAME |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
BigDataTest(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
createTable(java.lang.String sql)
Create a new table with defined sql sentence.
|
private void |
createTable(java.lang.String tableName,
int[] lengths,
boolean[] useClob)
Create table by the name defined, and each column of the table has the type of
varchar or clob, which is determined by the element in useClob.
|
private java.lang.String[][] |
getRowsWithOnlyOneColumn(java.lang.String[] sa,
int[] timesArray)
Generate String array with two dimensions according to String array and int array
defined. i.e. calling getStringArray({"a", "b",}, {3, 4}) returns {"aaa", "bbbb",}.
|
static java.lang.String |
getSelectSql(java.lang.String tableName)
Get a String to select all records from the table defined.
|
private java.lang.String[] |
getStringArray(java.lang.String[] sa,
int[] timesArray)
Generate String array according to String array and int array defined. i.e. calling
getStringArray({"a", "b",}, {3, 4}) returns {"aaa", "bbbb",}.
|
private void |
insertMultipleRows(java.lang.String tableName,
java.lang.String[][] rows)
Insert multiple rows into one table.
|
private void |
insertOneRow(java.lang.String tableName,
java.lang.String[] columns)
Insert a row into a table named by tableName, with defined table and params.
|
private void |
insertOneRow(java.lang.String tableName,
java.lang.String[] sa,
int[] timesArray)
Insert one row into a table named by tableName, with defined table, and String
array and int array to construct params.
|
static junit.framework.Test |
suite() |
void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testBigColumn()
try a column which is > 32767
|
void |
testBigRow()
create table with row greater than 32K.
|
void |
testDefaultQueryBlock()
the overhead for DSS on QRYDTA is 15 bytes let's try a row which is exactly 32767
(default client query block size).
|
void |
testLongVarchar()
Test a table just has only one column typed long varchar.
|
void |
testMixture()
Mix clob and varchar in the table.
|
void |
testScrolling()
let's try scrolling.
|
void |
testSeveralBigColumns()
try several columns > 32767.
|
void |
testSpanQRYDTABlocks()
Various tests for JIRA-614: handling of rows which span QRYDTA blocks.
|
void |
testTooBigSQLCARD()
What happens when the row + the ending SQLCARD is too big.
|
void |
testVarchar()
Test a table just has only one column typed varchar.
|
private void |
validSingleRow(java.lang.String[] exected,
boolean[] useClob,
java.sql.ResultSet rs)
Valid the current row record of passed ResultSet.
|
private void |
validTable(java.lang.String[][] expected,
java.lang.String tableName)
Valid content in defined table.
|
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, runTest, setName, setUp, toString
private static final java.lang.String BIG_TABLE_NAME
public BigDataTest(java.lang.String name) throws java.sql.SQLException
name
- java.sql.SQLException
public static java.lang.String getSelectSql(java.lang.String tableName)
tableName
- The table to fetch records from.private void createTable(java.lang.String tableName, int[] lengths, boolean[] useClob) throws java.sql.SQLException
tableName
- lengths
- useClob
- for element of useClob, if true, use clob as an element for a column;
false, use varchar as an element for a column.java.sql.SQLException
private void createTable(java.lang.String sql) throws java.sql.SQLException
sql
- a sql sentence a create a table, which should use BIG_TABLE_NAME as new
table's name.java.sql.SQLException
private java.lang.String[] getStringArray(java.lang.String[] sa, int[] timesArray)
sa
- the sort string array to use.timesArray
- stores repeated times of String constructed by elements in sa.private java.lang.String[][] getRowsWithOnlyOneColumn(java.lang.String[] sa, int[] timesArray)
sa
- the sort string array to use.timesArray
- stores repeated times of String constructed by elements in sa.private void insertOneRow(java.lang.String tableName, java.lang.String[] sa, int[] timesArray) throws java.sql.SQLException
tableName
- can not be null.sa
- the string array to use.timesArray
- stores repeated times of String constructed by elements in sa.java.sql.SQLException
private void insertOneRow(java.lang.String tableName, java.lang.String[] columns) throws java.sql.SQLException
tableName
- can not be null.columns
- can not be null, and has a length bigger than 0.java.sql.SQLException
- if SQLException occurs.private void insertMultipleRows(java.lang.String tableName, java.lang.String[][] rows) throws java.sql.SQLException
tableName
- the table will receive new rows.rows
- new rows for the table. Each row has only one column.java.sql.SQLException
private void validTable(java.lang.String[][] expected, java.lang.String tableName) throws java.sql.SQLException
expected
- the values expected, it has the same order with the table.
i.e.expected[0] means the expected values for the first row in rs.tableName
- whose content will be compared.java.sql.SQLException
- means invalid.private void validSingleRow(java.lang.String[] exected, boolean[] useClob, java.sql.ResultSet rs) throws java.sql.SQLException
exected
- the values expected, it has the same order with the table.useClob
- for each element of useColb, true means the column is Clob, false means
varchar.rs
- whose current row will be compared.java.sql.SQLException
- means invalid.public void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public static junit.framework.Test suite()
public void testMixture() throws java.sql.SQLException
java.sql.SQLException
public void testScrolling() throws java.sql.SQLException
java.sql.SQLException
public void testBigColumn() throws java.sql.SQLException
java.sql.SQLException
public void testSeveralBigColumns() throws java.sql.SQLException
java.sql.SQLException
public void testBigRow() throws java.sql.SQLException
java.sql.SQLException
public void testDefaultQueryBlock() throws java.sql.SQLException
java.sql.SQLException
public void testSpanQRYDTABlocks() throws java.sql.SQLException
java.sql.SQLException
public void testTooBigSQLCARD() throws java.sql.SQLException
java.sql.SQLException
public void testLongVarchar() throws java.sql.SQLException
java.sql.SQLException
public void testVarchar() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.