Expresso 5-5-0

com.jcorporate.expresso.core.dbobj.tests
Class DBObjectTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.jcorporate.expresso.core.dbobj.tests.DBObjectTest
All Implemented Interfaces:
junit.framework.Test

public class DBObjectTest
extends junit.framework.TestCase

DBObjectTest.java

Copyright 1999, 2000, 2001 Jcorporate Ltd.

A test case to verify the functions of DBObject. You can also use this test as


Constructor Summary
DBObjectTest(String name)
          Constructs a test case with the given name.
 
Method Summary
static void main(String[] args)
           
 void setUp()
          Sets up the fixture, for example, open a network connection.
static junit.framework.Test suite()
          Define the suite of tests that verify each function of the cache
 void tearDown()
          Tears down the fixture, for example, close a network connection.
 void testAdd()
          Test Adding the object to the database.
 void testBadRangeStrings()
          Test case that tries to set bad ranges to trip up the field range parser
 void testBatchAdd()
          Tests batch add and compares it's performance to the equivalant of adding x man records through DBObject.add();
 void testBatchUpdate()
          Tests the JDBC Executor Batch Update Capabilities.
 void testBLOBSupport()
          This test demonstrates/tests the basic functionality for binary-based data fields.
 void testCLOBSupport()
          This test demonstrates/tests the basic functionality for Text-based data fields.
 void testCustomWhereClause()
          Tests to make sure that we can work with custom where clauses and nothing breaks.
 void testDateAdd()
          This function tests adding blank dates since some databases don't tolerate it very well.
 void testDateSetField()
           
 void testFieldsToRetrieve()
          Tests the 'setFieldsToRetrieve()' functionality.
 void testGetSetFields()
          Tests to make sure get/set fields is working properly Specifically we also test that fields are appropriately set for null values.
 void testNullFields()
          Tests to make sure that after setting a null integer and adding it to the database, that the field is still null after a retrieval.
 void testNullValues()
           
 void testRangeStrings()
          This test case throws a batch of range strings into some search and retrieve calls to see if we can get improper sql generated and thus throw an exception
 void testResourceTransaction()
           
 void testRetrieve()
          Tests retrieve We also make sure that the exceptions we expect to be thrown are thrown... such as for bogus key values, keys not set.
 void testSpecialCharacters()
          This test makes sure that special characters such as backslashes or single quotes get properly escaped so we read them back properly
 void testTransactions()
          Test Transaction Capabilities
 void testUpdate()
          Tests the DBObject update routine.
 
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
 

Constructor Detail

DBObjectTest

public DBObjectTest(String name)
Constructs a test case with the given name.

Parameters:
name - The name of the test case
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

setUp

public void setUp()
           throws Exception
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.

Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.

Throws:
Exception

testGetSetFields

public void testGetSetFields()
Tests to make sure get/set fields is working properly Specifically we also test that fields are appropriately set for null values.


testAdd

public void testAdd()
Test Adding the object to the database. We also test adding duplicate keys to the database


testCustomWhereClause

public void testCustomWhereClause()
Tests to make sure that we can work with custom where clauses and nothing breaks.


testRetrieve

public void testRetrieve()
Tests retrieve We also make sure that the exceptions we expect to be thrown are thrown... such as for bogus key values, keys not set.


testFieldsToRetrieve

public void testFieldsToRetrieve()
Tests the 'setFieldsToRetrieve()' functionality.


testCLOBSupport

public void testCLOBSupport()
This test demonstrates/tests the basic functionality for Text-based data fields. You set and retrieve the text data as usual and the underlying framework saves/retrieves the CLOB field when you want it.


testSpecialCharacters

public void testSpecialCharacters()
This test makes sure that special characters such as backslashes or single quotes get properly escaped so we read them back properly


testTransactions

public void testTransactions()
Test Transaction Capabilities


testBLOBSupport

public void testBLOBSupport()
This test demonstrates/tests the basic functionality for binary-based data fields. You must use the saveBinaryField as a separate method rather than setField.


testNullFields

public void testNullFields()
Tests to make sure that after setting a null integer and adding it to the database, that the field is still null after a retrieval.


testNullValues

public void testNullValues()

testUpdate

public void testUpdate()
Tests the DBObject update routine.


testDateAdd

public void testDateAdd()
This function tests adding blank dates since some databases don't tolerate it very well.


testDateSetField

public void testDateSetField()

testRangeStrings

public void testRangeStrings()
This test case throws a batch of range strings into some search and retrieve calls to see if we can get improper sql generated and thus throw an exception


testBadRangeStrings

public void testBadRangeStrings()
Test case that tries to set bad ranges to trip up the field range parser


testBatchAdd

public void testBatchAdd()
Tests batch add and compares it's performance to the equivalant of adding x man records through DBObject.add();


testBatchUpdate

public void testBatchUpdate()
Tests the JDBC Executor Batch Update Capabilities.


testResourceTransaction

public void testResourceTransaction()

suite

public static junit.framework.Test suite()
Define the suite of tests that verify each function of the cache

Returns:
an instantiated test suite

Expresso 5-5-0

Please see www.jcorporate.com for information about new Expresso releases.