org.apache.derbyTesting.system.oe.run
Class Checks

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.derbyTesting.junit.BaseTestCase
              extended by org.apache.derbyTesting.junit.BaseJDBCTestCase
                  extended by org.apache.derbyTesting.junit.JDBCPerfTestCase
                      extended by org.apache.derbyTesting.system.oe.run.Checks
All Implemented Interfaces:
junit.framework.Test

public class Checks
extends JDBCPerfTestCase

Do some checks on the Order Entry database.


Field Summary
private  OEChecks check
          Run checks on OE database
private  short scale
          Warehouse scaling factor
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
Checks(java.lang.String name)
           
Checks(java.lang.String name, short scale)
           
 
Method Summary
static junit.framework.Test checkAllRowCounts(short scale)
          Return suite of tests that checks the row counts for all the tables in the Order Entry bechmark.
static junit.framework.Test consistencyChecks()
          Consistency checks per Section 3.3.2 of TPC-C spec
 void setUp()
           
static junit.framework.Test suite()
           
 void testCondition1()
          Section 3.3.2.1 of TPC-C specification.
 void testCondition2()
          Section 3.3.2.2 Consistency Condition 2 (TPC-C spec) Entries in the DISTRICT, ORDER, and NEW-ORDER tables must satisfy the relationship: D_NEXT_O_ID - 1 = max(O_ID) = max(NO_O_ID) for each district defined by (D_W_ID = O_W_ID = NO_W_ID) and (D_ID = O_D_ID = NO_D_ID).
 void testCondition3()
          3.3.2.3 Consistency Condition 3 Entries in the NEW-ORDER table must satisfy the relationship: max(NO_O_ID) - min(NO_O_ID) + 1 = [number of rows in the NEW-ORDER table for this district] for each district defined by NO_W_ID and NO_D_ID.
 void testCondition4()
          3.3.2.4 Consistency Condition 4 Entries in the ORDER and ORDER-LINE tables must satisfy the relationship: sum(O_OL_CNT) = [number of rows in the ORDER-LINE table for this district] for each district defined by (O_W_ID = OL_W_ID) and (O_D_ID = OL_D_ID).
 void testCustomerRows()
          Test cardinality of CUSTOMER table
 void testDistrictRows()
          Test cardinality of DISTRICT table
 void testHistoryRows()
          Test cardinality of HISTORY table
 void testItemRows()
          Test cardinality of ITEM table
 void testNewOrdersRows()
          Test cardinality of NEWORDERS table
 void testOrderLineRows()
          Test cardinality of ORDERLINE table
 void testOrdersRows()
          Test cardinality of ORDERS table
 void testStockRows()
          Test cardinality of STOCK table
 void testWarehouseRows()
          Test cardinality of WAREHOUSE table
 
Methods inherited from class org.apache.derbyTesting.junit.JDBCPerfTestCase
runBare, runTest
 
Methods inherited from class org.apache.derbyTesting.junit.BaseJDBCTestCase
assertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertTableRowCount, assertUpdateCount, assertUpdateCount, checkAllConsistency, checkEstimatedRowCount, commit, createStatement, createStatement, createStatement, dropTable, dropTable, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbedded
 
Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, setSystemProperty, traceit
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, setName, 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

scale

private short scale
Warehouse scaling factor


check

private OEChecks check
Run checks on OE database

Constructor Detail

Checks

public Checks(java.lang.String name)

Checks

public Checks(java.lang.String name,
              short scale)
Parameters:
name - - test name
scale - -warehouse scale factor
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

checkAllRowCounts

public static junit.framework.Test checkAllRowCounts(short scale)
Return suite of tests that checks the row counts for all the tables in the Order Entry bechmark.

Parameters:
scale -

consistencyChecks

public static junit.framework.Test consistencyChecks()
Consistency checks per Section 3.3.2 of TPC-C spec


suite

public static junit.framework.Test suite()
Returns:
suite of tests that perform certain consistency checks on the OE database

testCondition1

public void testCondition1()
                    throws java.sql.SQLException
Section 3.3.2.1 of TPC-C specification. Entries in the WAREHOUSE and DISTRICT tables must satisfy the relationship: W_YTD = sum(D_YTD) for each warehouse defined by (W_ID = D_W_ID).

Throws:
java.sql.SQLException

testCondition2

public void testCondition2()
                    throws java.sql.SQLException
Section 3.3.2.2 Consistency Condition 2 (TPC-C spec) Entries in the DISTRICT, ORDER, and NEW-ORDER tables must satisfy the relationship: D_NEXT_O_ID - 1 = max(O_ID) = max(NO_O_ID) for each district defined by (D_W_ID = O_W_ID = NO_W_ID) and (D_ID = O_D_ID = NO_D_ID). This condition does not apply to the NEW-ORDER table for any districts which have no outstanding new orders (i.e., the number of rows is zero).

Throws:
java.sql.SQLException

testCondition3

public void testCondition3()
                    throws java.sql.SQLException
3.3.2.3 Consistency Condition 3 Entries in the NEW-ORDER table must satisfy the relationship: max(NO_O_ID) - min(NO_O_ID) + 1 = [number of rows in the NEW-ORDER table for this district] for each district defined by NO_W_ID and NO_D_ID. This condition does not apply to any districts which have no outstanding new orders (i.e., the number of rows is zero).

Throws:
java.sql.SQLException

testCondition4

public void testCondition4()
                    throws java.sql.SQLException
3.3.2.4 Consistency Condition 4 Entries in the ORDER and ORDER-LINE tables must satisfy the relationship: sum(O_OL_CNT) = [number of rows in the ORDER-LINE table for this district] for each district defined by (O_W_ID = OL_W_ID) and (O_D_ID = OL_D_ID).

Throws:
java.sql.SQLException

testWarehouseRows

public void testWarehouseRows()
                       throws java.lang.Exception
Test cardinality of WAREHOUSE table

Throws:
java.lang.Exception

testStockRows

public void testStockRows()
                   throws java.lang.Exception
Test cardinality of STOCK table

Throws:
java.lang.Exception

testOrdersRows

public void testOrdersRows()
                    throws java.lang.Exception
Test cardinality of ORDERS table

Throws:
java.lang.Exception

testDistrictRows

public void testDistrictRows()
                      throws java.lang.Exception
Test cardinality of DISTRICT table

Throws:
java.lang.Exception

testCustomerRows

public void testCustomerRows()
                      throws java.lang.Exception
Test cardinality of CUSTOMER table

Throws:
java.lang.Exception

testItemRows

public void testItemRows()
                  throws java.lang.Exception
Test cardinality of ITEM table

Throws:
java.lang.Exception

testNewOrdersRows

public void testNewOrdersRows()
                       throws java.lang.Exception
Test cardinality of NEWORDERS table

Throws:
java.lang.Exception

testHistoryRows

public void testHistoryRows()
                     throws java.lang.Exception
Test cardinality of HISTORY table

Throws:
java.lang.Exception

testOrderLineRows

public void testOrderLineRows()
                       throws java.lang.Exception
Test cardinality of ORDERLINE table

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.