Class TestSourceGenerator

  • All Implemented Interfaces:
    junit.framework.Test

    public class TestSourceGenerator
    extends XMLTestCase
    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
    • Constructor Detail

      • TestSourceGenerator

        public TestSourceGenerator​(CastorTestCase test,
                                   UnitTestCase unit,
                                   OnlySourceGenerationTest sourceGen)
      • TestSourceGenerator

        public TestSourceGenerator​(CastorTestCase test,
                                   UnitTestCase unit,
                                   SourceGeneratorTest sourceGen)
    • Method Detail

      • setUp

        protected void setUp()
                      throws java.lang.Exception
        Sets up this test suite.
        Specified by:
        setUp in class XMLTestCase
        Throws:
        java.lang.Exception - if anything goes wrong
      • tearDown

        protected void tearDown()
                         throws java.lang.Exception
        Cleans up after this unit test.
        Specified by:
        tearDown in class XMLTestCase
        Throws:
        java.lang.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 class junit.framework.TestCase
      • setExpectedSources

        public void setExpectedSources​(java.util.List expectedSources)
        Sets a collection of expected source files.
        Parameters:
        expectedSources - A collection of expected source files.