org.jboss.test
Class AbstractTestCaseWithSetup

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.jboss.test.AbstractTestCase
              extended byorg.jboss.test.AbstractTestCaseWithSetup
All Implemented Interfaces:
junit.framework.Test

public class AbstractTestCaseWithSetup
extends AbstractTestCase

An extension of AbstractTestCase that adds AbstractTestDelegate and AbstractTestSetup delegate notions. The AbstractTestSetup is integrates with the junit junit.extensions.TestSetup setUp/tearDown callbacks to create an AbstractTestDelegate. When a testcase is run as a class with all conforming unit test methods run, a single class wide AbstractTestDelegate is created by either the fist call to the setUp method, or the suite AbstractTestSetup wrapper created by suite(Class).

Version:
$Revision: 1.5 $
Author:
Adrian Brock, Scott.Stark@jboss.org

Constructor Summary
AbstractTestCaseWithSetup(String name)
          Create a new test case
 
Method Summary
protected  void enableTrace(String name)
          Enable trace for a logging category
protected  AbstractTestDelegate getDelegate()
          Get the delegate
 org.jboss.logging.Logger getLog()
          Get the log for this test
protected  void setUp()
          Create a AbstractTestSetup wrapper for this class/instance to initialize the AbstractTestDelegate if the AbstractTestSetup.delegate singleton has not been initialized.
static junit.framework.Test suite(Class clazz)
          Bootstrap the test for the case of running all tests in clazz.
protected  void tearDown()
           
 
Methods inherited from class org.jboss.test.AbstractTestCase
assertEmpty, assertEmpty, assertEquals, assertEquals, assertEquals, assertEquals, checkThrowable, configureLogging, deserialize, findResource, getResource, serialize
 
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

AbstractTestCaseWithSetup

public AbstractTestCaseWithSetup(String name)
Create a new test case

Parameters:
name - the test name
Method Detail

getLog

public org.jboss.logging.Logger getLog()
Description copied from class: AbstractTestCase
Get the log for this test

Specified by:
getLog in class AbstractTestCase
Returns:
the log

enableTrace

protected void enableTrace(String name)
Description copied from class: AbstractTestCase
Enable trace for a logging category

Specified by:
enableTrace in class AbstractTestCase
Parameters:
name - the logging category

getDelegate

protected AbstractTestDelegate getDelegate()
Get the delegate

Returns:
the delegate

setUp

protected void setUp()
              throws Exception
Create a AbstractTestSetup wrapper for this class/instance to initialize the AbstractTestDelegate if the AbstractTestSetup.delegate singleton has not been initialized.

Overrides:
setUp in class AbstractTestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class AbstractTestCase
Throws:
Exception

suite

public static junit.framework.Test suite(Class clazz)
Bootstrap the test for the case of running all tests in clazz. This creates an AbstractTestSetup wrapper around TestSuite(clazz) to initialize the AbstractTestDelegate once for the suite.

Parameters:
clazz - the test class
Returns:
the bootstrap wrapper test


Copyright © 2004 JBoss Inc. All Rights Reserved.