org.apache.derbyTesting.perf.basic.jdbc
Class BaseLoad100TestSetup

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.extensions.TestDecorator
          extended by junit.extensions.TestSetup
              extended by org.apache.derbyTesting.junit.BaseTestSetup
                  extended by org.apache.derbyTesting.junit.BaseJDBCTestSetup
                      extended by org.apache.derbyTesting.junit.CleanDatabaseTestSetup
                          extended by org.apache.derbyTesting.perf.basic.jdbc.BaseLoad100TestSetup
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
BaseLoad100IdxTestSetup

public class BaseLoad100TestSetup
extends CleanDatabaseTestSetup

TestSetup decorator to load the schema that is used for some of the performance tests. Schema includes: Table: is 9 column table (100bytes) - 5 columns of type int, 4 columns of char(20)") data distribution - { column 1 has unique values,column 2 is set to 2, column 3 has 1 % of rows with same value, column 4 is set to 2, column 5 has unique values, column 6 is set to a constant value, column 7 has 1% of rows with known pattern, column 8 has constant value,column 9 has values having the same suffix. Connection props : autocommit - false, default isolation level- Read Committed. If any indexes have to be created or any other schema additions need to be made, then the decorateSQL() method needs to be overriden.


Field Summary
protected  int rowsToLoad
           
protected  java.lang.String tableName
           
 
Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
BaseLoad100TestSetup(junit.framework.Test test)
           
BaseLoad100TestSetup(junit.framework.Test test, int rowsToLoad)
           
BaseLoad100TestSetup(junit.framework.Test test, int rowsToLoad, java.lang.String tableName)
           
BaseLoad100TestSetup(junit.framework.Test test, java.lang.String tableName)
           
 
Method Summary
protected  void decorateSQL(java.sql.Statement s)
          Override the decorateSQL and create the necessary schema.
private  void loadData(java.sql.PreparedStatement insert)
          Load the data into the table.
protected  void setUp()
          Clean the default database using the default connection and calls the decorateSQL to allow sub-classes to initialize their schema requirments.
 
Methods inherited from class org.apache.derbyTesting.junit.CleanDatabaseTestSetup
cleanDatabase, tearDown
 
Methods inherited from class org.apache.derbyTesting.junit.BaseJDBCTestSetup
getConnection, getTestConfiguration, println
 
Methods inherited from class org.apache.derbyTesting.junit.BaseTestSetup
run
 
Methods inherited from class junit.extensions.TestDecorator
basicRun, countTestCases, getTest, 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

rowsToLoad

protected int rowsToLoad

tableName

protected java.lang.String tableName
Constructor Detail

BaseLoad100TestSetup

public BaseLoad100TestSetup(junit.framework.Test test)
Parameters:
test -

BaseLoad100TestSetup

public BaseLoad100TestSetup(junit.framework.Test test,
                            int rowsToLoad)
Parameters:
test - name of test
rowsToLoad - number of rows to insert

BaseLoad100TestSetup

public BaseLoad100TestSetup(junit.framework.Test test,
                            java.lang.String tableName)
Parameters:
test - name of the test
tableName - name of the table to insert the rows into

BaseLoad100TestSetup

public BaseLoad100TestSetup(junit.framework.Test test,
                            int rowsToLoad,
                            java.lang.String tableName)
Parameters:
test - name of test
rowsToLoad - number of rows to insert
tableName - name of the table to insert the rows into
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Clean the default database using the default connection and calls the decorateSQL to allow sub-classes to initialize their schema requirments.

Overrides:
setUp in class CleanDatabaseTestSetup
Throws:
java.lang.Exception

decorateSQL

protected void decorateSQL(java.sql.Statement s)
                    throws java.sql.SQLException
Override the decorateSQL and create the necessary schema.

Overrides:
decorateSQL in class CleanDatabaseTestSetup
Throws:
java.sql.SQLException
See Also:
CleanDatabaseTestSetup.decorateSQL(java.sql.Statement)

loadData

private void loadData(java.sql.PreparedStatement insert)
               throws java.lang.Exception
Load the data into the table.

Parameters:
insert - prepared statement to use for inserting data.
Throws:
java.lang.Exception

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.