org.aspectj.testing
Class XMLBasedAjcTestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.aspectj.tools.ajc.AjcTestCase
              extended byorg.aspectj.testing.XMLBasedAjcTestCase
All Implemented Interfaces:
junit.framework.Test

public abstract class XMLBasedAjcTestCase
extends org.aspectj.tools.ajc.AjcTestCase

Root class for all Test suites that are based on an AspectJ XML test suite file. Extends AjcTestCase allowing a mix of programmatic and spec-file driven testing. See org.aspectj.systemtest.incremental.IncrementalTests for an example of this mixed style.

The class org.aspectj.testing.MakeTestClass will generate a subclass of this class for you, given a suite spec. file as input...


Nested Class Summary
 
Nested classes inherited from class org.aspectj.tools.ajc.AjcTestCase
org.aspectj.tools.ajc.AjcTestCase.Message, org.aspectj.tools.ajc.AjcTestCase.MessageSpec, org.aspectj.tools.ajc.AjcTestCase.RunResult
 
Field Summary
 
Fields inherited from class org.aspectj.tools.ajc.AjcTestCase
ajc
 
Constructor Summary
XMLBasedAjcTestCase()
           
 
Method Summary
 void addTest(org.aspectj.testing.AjcTest test)
          For use by the Digester.
protected  org.aspectj.testing.AjcTest getCurrentTest()
          Get the currently executing test.
protected abstract  java.io.File getSpecFile()
          The file containing the XML specification for the tests.
static junit.framework.Test loadSuite(java.lang.Class testCaseClass)
          You must define a suite() method in subclasses, and return the result of calling this method.
protected  void runTest(java.lang.String title)
          This helper method runs the test with the given title in the suite spec file.
protected  void setUp()
           
 
Methods inherited from class org.aspectj.tools.ajc.AjcTestCase
ajc, assertMessages, assertMessages, assertNoMessages, assertNoMessages, newMessageList, newMessageList, newMessageList, newMessageList, run, run, setShouldEmptySandbox, tearDown
 
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

XMLBasedAjcTestCase

public XMLBasedAjcTestCase()
Method Detail

loadSuite

public static junit.framework.Test loadSuite(java.lang.Class testCaseClass)
You must define a suite() method in subclasses, and return the result of calling this method. (Don't you hate static methods in programming models). For example:
   public static Test suite() {
     return XMLBasedAjcTestCase.loadSuite(MyTestCaseClass.class);
   }
 

Parameters:
testCaseClass -
Returns:

getSpecFile

protected abstract java.io.File getSpecFile()
The file containing the XML specification for the tests.


runTest

protected void runTest(java.lang.String title)
This helper method runs the test with the given title in the suite spec file. All tests steps in given ajc-test execute in the same sandbox.


getCurrentTest

protected org.aspectj.testing.AjcTest getCurrentTest()
Get the currently executing test. Useful for access to e.g. AjcTest.getTitle() etc..


addTest

public void addTest(org.aspectj.testing.AjcTest test)
For use by the Digester. As the XML document is parsed, it creates instances of AjcTest objects, which are added to this TestCase by the Digester by calling this method.


setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception