com.objectwave.persist.bcel.examples
Class BcelTest

java.lang.Object
  |
  +--com.objectwave.test.UnitTestBaseImpl
        |
        +--com.objectwave.persist.bcel.examples.BcelTest
All Implemented Interfaces:
UnitTest

public class BcelTest
extends UnitTestBaseImpl

A class to exercise some of the basic capabilities of the BCEL libraries.

Version:
$Id: BcelTest.java,v 1.2 2002/08/24 16:34:00 dave_hoag Exp $
Author:
dave_hoag

Field Summary
 
Fields inherited from class com.objectwave.test.UnitTestBaseImpl
testContext
 
Constructor Summary
BcelTest()
           
 
Method Summary
static void main(java.lang.String[] args)
          The main program for the BcelTest class
 void setUp(java.lang.String name, TestContext context)
          The JUnit setup method
 void tearDown(TestContext context)
          The teardown method for JUnit
 void testFactory()
          To avoid casting all of the time, you could create type specific factories.
 void testSaveAndFind()
          A unit test for JUnit
 
Methods inherited from class com.objectwave.test.UnitTestBaseImpl
createTest, removeFile, writeFile, writeFileResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BcelTest

public BcelTest()
Method Detail

setUp

public void setUp(java.lang.String name,
                  TestContext context)
The JUnit setup method

Specified by:
setUp in interface UnitTest
Overrides:
setUp in class UnitTestBaseImpl
Parameters:
name - The new up value
context - The new up value

main

public static void main(java.lang.String[] args)
The main program for the BcelTest class

Parameters:
args - The command line arguments

tearDown

public void tearDown(TestContext context)
              throws java.lang.Exception
The teardown method for JUnit

Specified by:
tearDown in interface UnitTest
Overrides:
tearDown in class UnitTestBaseImpl
Parameters:
context -
Throws:
java.lang.Exception

testSaveAndFind

public void testSaveAndFind()
                     throws java.lang.Exception
A unit test for JUnit

Throws:
java.lang.Exception

testFactory

public void testFactory()
                 throws java.lang.Exception
To avoid casting all of the time, you could create type specific factories. This does, however, require you to create a newInstance method in your domain object. Also note, while the PersistenceFactory requires some exception handling, the factory approach does not.

java.lang.Exception
See Also:
com.objectwave.persist.examples.Person#newInstance