Package org.castor.xmlctf
Class TestSourceGenerator
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.castor.xmlctf.XMLTestCase
org.castor.xmlctf.TestSourceGenerator
- All Implemented Interfaces:
junit.framework.Test
This class encapsulate all the logic needed to run the source generator by
itself and then compile the file that have been generated. This class does
not do anything additional. It only runs the source generator and ensures
that the generated source will compile without error.
- Version:
- $Revision: 0000 $ $Date: $
- Author:
- Edward Kuns
-
Field Summary
Fields inherited from class org.castor.xmlctf.XMLTestCase
_configuration, _failure, _hasDump, _listener, _listenerGoldFile, _listenerType, _mapping, _name, _outputRootFile, _printStack, _rootClass, _rootClassName, _skip, _suiteName, _test, _unitTest, _verbose
-
Constructor Summary
ConstructorsConstructorDescriptionTestSourceGenerator
(CastorTestCase test, UnitTestCase unit, OnlySourceGenerationTest sourceGen) TestSourceGenerator
(CastorTestCase test, UnitTestCase unit, SourceGeneratorTest sourceGen) -
Method Summary
Modifier and TypeMethodDescriptionvoid
runTest()
Runs our source generation test.void
setExpectedSources
(List expectedSources) Sets a collection of expected source files.protected void
setUp()
Sets up this test suite.protected void
tearDown()
Cleans up after this unit test.Methods inherited from class org.castor.xmlctf.XMLTestCase
buildObjectModel, checkExceptionWasExpected, cleanup, getTestSuiteName, getXMLContext, initializeListeners, invokeEnumeratedMethods, setTestSuiteName, setXMLContext, testMarshal, testUnmarshal, testUnmarshal, verbose
Methods inherited from class junit.framework.TestCase
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toString
-
Constructor Details
-
TestSourceGenerator
public TestSourceGenerator(CastorTestCase test, UnitTestCase unit, OnlySourceGenerationTest sourceGen) -
TestSourceGenerator
-
-
Method Details
-
setUp
Sets up this test suite.- Specified by:
setUp
in classXMLTestCase
- Throws:
Exception
- if anything goes wrong
-
tearDown
Cleans up after this unit test.- Specified by:
tearDown
in classXMLTestCase
- Throws:
Exception
- if anything goes wrong
-
runTest
public void runTest()Runs our source generation test. Creates, configures, and executes the source generator on each schema we have to test. Compiles the generated code. Loads classes via the appropriate class loader.- Overrides:
runTest
in classjunit.framework.TestCase
-
setExpectedSources
Sets a collection of expected source files.- Parameters:
expectedSources
- A collection of expected source files.
-