org.jete.cases
Class ContextFileTestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.jete.cases.BaseActionTestCase
              extended byorg.jete.cases.MultiTestCase
                  extended byorg.jete.cases.ContextFileTestCase
All Implemented Interfaces:
junit.framework.Test

public class ContextFileTestCase
extends MultiTestCase

Configure with a test application file, and a list of tests within that file. When called, this will load the application context of the file specified, and if testnames are configured, execute those tests.

When no test names are configured, all test cases in the application context file will be run.

To prevent all tests from being loaded in memory and staying there, set the removeContext attribute to true. This will close the loaded application context when test execution is complete, freeing up memory.

Version:
$Id: ContextFileTestCase.html,v 1.3 2006/03/12 02:46:52 tdeast Exp $

Field Summary
 
Fields inherited from class org.jete.cases.MultiTestCase
result
 
Constructor Summary
ContextFileTestCase()
           
 
Method Summary
 java.lang.String getContextFile()
           
 java.util.List getTestNames()
           
 boolean isRemoveContext()
           
 void run(junit.framework.TestResult result)
          Override the run(TestResult) method to store the results locally, allowing the addTestCases method to pass the results to each specified sub test.
 void setContextFile(java.lang.String contextFile)
           
 void setRemoveContext(boolean removeContext)
           
 void setTestNames(java.util.List testNames)
           
protected  void tearDown()
          After running the tests, we should unload the context to preserve resources
 
Methods inherited from class org.jete.cases.MultiTestCase
getPooledExecutor, getPoolShutdownWaitTime, getTestCases, setPooledExecutor, setPoolShutdownWaitTime, setTestCases
 
Methods inherited from class org.jete.cases.BaseActionTestCase
getSetupActions, getTearDownActions, runActions, setSetupActions, setTearDownActions, setUp
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, 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

ContextFileTestCase

public ContextFileTestCase()
Method Detail

run

public void run(junit.framework.TestResult result)
Override the run(TestResult) method to store the results locally, allowing the addTestCases method to pass the results to each specified sub test.

Because this overrides the run(TestResult) method, it calls setup and teardown manually.

Specified by:
run in interface junit.framework.Test
Overrides:
run in class MultiTestCase
Parameters:
result -

tearDown

protected void tearDown()
                 throws java.lang.Exception
After running the tests, we should unload the context to preserve resources

Overrides:
tearDown in class BaseActionTestCase
Throws:
java.lang.Exception

isRemoveContext

public boolean isRemoveContext()

setRemoveContext

public void setRemoveContext(boolean removeContext)

getContextFile

public java.lang.String getContextFile()

setContextFile

public void setContextFile(java.lang.String contextFile)

getTestNames

public java.util.List getTestNames()

setTestNames

public void setTestNames(java.util.List testNames)