org.apache.derbyTesting.functionTests.tests.jdbcapi
Class SURDataModelSetup

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.functionTests.tests.jdbcapi.SURDataModelSetup
All Implemented Interfaces:
junit.framework.Test

public class SURDataModelSetup
extends BaseJDBCTestSetup

This class is a decorator for the Scrollable Updatable Resultset tests. It sets up a datamodel and populates it with data.


Nested Class Summary
static class SURDataModelSetup.SURDataModel
          Enum for the layout of the data model
 
Field Summary
private  SURDataModelSetup.SURDataModel model
           
(package private) static int recordCount
           
 
Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
SURDataModelSetup(junit.framework.Test test, SURDataModelSetup.SURDataModel model)
          Constructor.
 
Method Summary
static void createDataModel(SURDataModelSetup.SURDataModel model, java.sql.Connection con)
          Creates a datamodel for testing Scrollable Updatable ResultSets and populates the database model with data.
static void createDataModel(SURDataModelSetup.SURDataModel model, java.sql.Connection con, int records)
          Creates a datamodel for testing Scrollable Updatable ResultSets and populates the database model with data.
(package private) static void printStackTrace(java.lang.Throwable t)
          Prints the stack trace.
protected  void setUp()
          Creates a datamodel for testing Scrollable Updatable ResultSets and populates the database model with data.
protected  void tearDown()
          Delete the datamodel
 java.lang.String toString()
           
 
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
 
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

model

private final SURDataModelSetup.SURDataModel model

recordCount

static final int recordCount
See Also:
Constant Field Values
Constructor Detail

SURDataModelSetup

public SURDataModelSetup(junit.framework.Test test,
                         SURDataModelSetup.SURDataModel model)
Constructor.

Parameters:
test - test to decorate with this setup
model - enumerator for which model to use. (Alternatively we could use a subclass for each model)
Method Detail

createDataModel

public static void createDataModel(SURDataModelSetup.SURDataModel model,
                                   java.sql.Connection con,
                                   int records)
                            throws java.sql.SQLException
Creates a datamodel for testing Scrollable Updatable ResultSets and populates the database model with data.

Parameters:
model - enumerator for which model to use
con - connection to database
records - number of records in the data model
Throws:
java.sql.SQLException

createDataModel

public static void createDataModel(SURDataModelSetup.SURDataModel model,
                                   java.sql.Connection con)
                            throws java.sql.SQLException
Creates a datamodel for testing Scrollable Updatable ResultSets and populates the database model with data. The model will be set up with the number of records as defined by the recordCount attribute.

Parameters:
model - enumerator for which model to use
con - connection to database
Throws:
java.sql.SQLException

setUp

protected void setUp()
              throws java.lang.Exception
Creates a datamodel for testing Scrollable Updatable ResultSets and populates the database model with data.

Overrides:
setUp in class junit.extensions.TestSetup
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Delete the datamodel

Overrides:
tearDown in class BaseJDBCTestSetup
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class junit.extensions.TestDecorator

printStackTrace

static void printStackTrace(java.lang.Throwable t)
Prints the stack trace. If run in the harness, the harness will mark the test as failed if this method has been called.


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.