Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jcorporate.expresso.core.utility
Class DBToolTests  view DBToolTests download DBToolTests.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.jcorporate.expresso.services.test.ExpressoTestCase
              extended bycom.jcorporate.expresso.core.utility.DBToolTests
All Implemented Interfaces:
junit.framework.Test

public class DBToolTests
extends com.jcorporate.expresso.services.test.ExpressoTestCase

What this does:

Runs DBCreate on the schemas and makes sure that no exceptions are thrown while creating.

NOTE: Derive a class from this class to test all derived schemas.


Field Summary
private static boolean alreadyCleared
           
private static boolean failedOne
           
private  com.jcorporate.expresso.kernel.InstallLog installLog
           
protected  java.util.Vector schemaList
          Add schemas to this list to verify other schemas
 
Fields inherited from class com.jcorporate.expresso.services.test.ExpressoTestCase
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
DBToolTests(java.lang.String name)
           
 
Method Summary
protected  boolean isAlreadyCleared()
           
protected  boolean isFailedOnce()
           
static void main(java.lang.String[] args)
           
private  com.jcorporate.expresso.core.dbobj.DBObject runThroughSerializer(com.jcorporate.expresso.core.dbobj.DBObject testObject)
          Helper functino that serializes a DBOBject to a memory stream and then reads a new instance out from the stream.
protected  void setAlreadyCleared(boolean newValue)
           
protected  void setFailedOnce(boolean newValue)
           
protected  void setUp()
          Sets up and makes sure that ConfigManager is fully loaded and ready to go.
static junit.framework.Test suite()
          Creates the test cases.
 void testAddingSchemas()
          If testing multiple schemas, this will make sure that the schema has been added to the dbtable when created.
 void testCreate()
          Runs the createTables() on the schema list to make sure no exceptions are getting thrown
 void testOtherSetups()
          Runs the othersetups() on the schema list to make sure no exceptions are getting thrown
 void testPopulateTables()
          Runs the populateTables() on the schema list to make sure no exceptions are getting thrown
 void testSerialization()
          This testcase makes sure that all DBObjects within all the schemas are serializable.
 void testSetupConfigValues()
          Runs through setting up the configuration values for a particular schema
 void testSetupSecurity()
          Runs the setupSecurity() on the schema list to make sure no exceptions are getting thrown
 void testVerify()
          Call verify on all the dbobjects.
 
Methods inherited from class com.jcorporate.expresso.services.test.ExpressoTestCase
getLog, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, 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

schemaList

protected java.util.Vector schemaList
Add schemas to this list to verify other schemas


alreadyCleared

private static boolean alreadyCleared

failedOne

private static boolean failedOne

installLog

private com.jcorporate.expresso.kernel.InstallLog installLog
Constructor Detail

DBToolTests

public DBToolTests(java.lang.String name)
            throws java.lang.Exception
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception

isAlreadyCleared

protected boolean isAlreadyCleared()

setAlreadyCleared

protected void setAlreadyCleared(boolean newValue)

isFailedOnce

protected boolean isFailedOnce()

setFailedOnce

protected void setFailedOnce(boolean newValue)

suite

public static junit.framework.Test suite()
                                  throws java.lang.Exception
Creates the test cases. Order is important, thus the manual creation.


testCreate

public void testCreate()
Runs the createTables() on the schema list to make sure no exceptions are getting thrown


testAddingSchemas

public void testAddingSchemas()
If testing multiple schemas, this will make sure that the schema has been added to the dbtable when created.


testPopulateTables

public void testPopulateTables()
Runs the populateTables() on the schema list to make sure no exceptions are getting thrown


testSetupSecurity

public void testSetupSecurity()
Runs the setupSecurity() on the schema list to make sure no exceptions are getting thrown


testSetupConfigValues

public void testSetupConfigValues()
Runs through setting up the configuration values for a particular schema


testOtherSetups

public void testOtherSetups()
Runs the othersetups() on the schema list to make sure no exceptions are getting thrown


testVerify

public void testVerify()
Call verify on all the dbobjects. Code is borrowed from DBTool

Also checks for unique table names. More than one DBOBject shouldn't be pointing to the same table name.


testSerialization

public void testSerialization()
This testcase makes sure that all DBObjects within all the schemas are serializable. Helps insure that there aren't any special custom "types" that might be causing troubles.


runThroughSerializer

private com.jcorporate.expresso.core.dbobj.DBObject runThroughSerializer(com.jcorporate.expresso.core.dbobj.DBObject testObject)
                                                                  throws java.lang.Exception
Helper functino that serializes a DBOBject to a memory stream and then reads a new instance out from the stream.


setUp

protected void setUp()
              throws java.lang.Exception
Description copied from class: com.jcorporate.expresso.services.test.ExpressoTestCase
Sets up and makes sure that ConfigManager is fully loaded and ready to go.