com.objectwave.test
Class UnitTestBaseImpl

java.lang.Object
  |
  +--com.objectwave.test.UnitTestBaseImpl
All Implemented Interfaces:
UnitTest
Direct Known Subclasses:
AccessObjectFormatter.Test, BasicTestBroker, BcelTest, BufferedRandomAccessFile.Test, CachedRandomAccessFile.Test, CallbackHolder.Test, CallbackService.Test, ClassFile.Test, ConsoleImpl.Test, ConstraintAnyOf.Test, ConstraintBetween.Test, ConstraintBoolean.Test, CrossField.Test, DefaultConfigurationService.Test, DomainObject.Test, ExtensiveTest, FileFinder.Test, FilePropertySource.Test, Generator.Test, InvertTest, JoinObject.Test, JspStyleRead.Test, Log4jImpl.Test, LoggingPropertyDetail.Test, MapInformation.Test, MethodBuilder.Test, MethodDef.Test, MethodDefParser.Test, MultiplePrimaryKeyTest, NoFieldObjectEditor.Test, NoFieldObjectModified.Test, ObjectEditor.Test, ObjectFormatter.Test, ObjectFormatter.Test, ObjectModified.Test, ObjectQuerySupport.Test, OracleBroker.Test, ParallelTransactionTest.Test, Person.Test, PopupMenu.Test, ProcessResultSet.Test, PropertyObjects.Test, RDBBroker.Test, RDBConnectionPool.Test, RDBPersistentAdapter.Test, RecordHeader.Test, RecordIterator.Test, SerIt.Test, Session.Test, SkipListMap.Test, SourceCodeReader.Test, SqlModifierBuilder.Test, SQLQuery.Test, SqlQueryBuilder.Test, SQLSelect.Test, StatementFactory.Test, StatusManager.Test, StringCalculator.Test, StringManipulator.Test, TagReplace.Test, Test, TestXMLCompany.Test, TestXMLPerson.Test, ThreadPoolManager.Test, Timer.Test, TransactionLog.Test, ValueObjectTest.Test, XmlConfigurationService.Test, XMLDecoder.Test, XMLTemplateRead.Test

public class UnitTestBaseImpl
extends java.lang.Object
implements UnitTest

Provide all of the default implementation code. All a subclass needs to do is extend this and provide a main method.

Version:
$Id: UnitTestBaseImpl.java,v 2.0 2001/06/11 15:46:53 dave_hoag Exp $
Author:
dhoag

Field Summary
 TestContext testContext
           
 
Constructor Summary
UnitTestBaseImpl()
           
 
Method Summary
 UnitTest createTest(java.lang.String methodName, TestContext context)
           
 void removeFile(java.lang.String fileName)
          If the file provided exists, remove it from the system.
 void setUp(java.lang.String methodName, TestContext context)
          The JUnit setup method
 void tearDown(TestContext context)
          The teardown method for JUnit
 void writeFile(java.lang.String fileName, java.lang.String contents)
          Helper method to allow a quick creation of a file.
 java.io.File writeFileResource(java.lang.String fileName, java.lang.Class resourceTarget, java.lang.String contents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testContext

public TestContext testContext
Constructor Detail

UnitTestBaseImpl

public UnitTestBaseImpl()
Method Detail

setUp

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

Specified by:
setUp in interface UnitTest
Parameters:
methodName - The new Up value
context - The new Up value
Throws:
java.lang.Exception

tearDown

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

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

createTest

public UnitTest createTest(java.lang.String methodName,
                           TestContext context)
Specified by:
createTest in interface UnitTest
Parameters:
methodName -
context -
Returns:

writeFileResource

public java.io.File writeFileResource(java.lang.String fileName,
                                      java.lang.Class resourceTarget,
                                      java.lang.String contents)
                               throws java.io.IOException
Parameters:
fileName -
resourceTarget -
contents -
Returns:
Throws:
java.io.IOException

writeFile

public void writeFile(java.lang.String fileName,
                      java.lang.String contents)
               throws java.io.IOException
Helper method to allow a quick creation of a file.

Parameters:
fileName -
contents -
Throws:
java.io.IOException

removeFile

public void removeFile(java.lang.String fileName)
If the file provided exists, remove it from the system.

Parameters:
fileName -