Package org.apache.torque.generator.control

Examples of org.apache.torque.generator.control.Controller


        UnitConfiguration unitConfiguration
                = controllerState.getUnitConfiguration();
        ConfigurationHandlers configurationHandlers
                = unitConfiguration.getConfigurationHandlers();
        Controller helperController = new Controller();

        SourceElement newSourceElement = new SourceElement(newElement);
        boolean newSourceElementAdded = false;
        try
        {
            // do not change state of original source provider,
            // instead make a copy.
            SourceProvider sourceProvider
                    = controllerState.getSourceProvider().copy();
            sourceProvider.init(configurationHandlers, controllerState);

            while (sourceProvider.hasNext())
            {
                Source source = sourceProvider.next();
                SourceElement rootElement = source.getRootElement();
                SourceProcessConfiguration sourceProcessConfiguration
                    = output.getSourceProcessConfiguration();
                List<SourceTransformerDefinition> transformerDefinitions
                    = sourceProcessConfiguration.getTransformerDefinitions();
                transformerDefinitions
                        = new ArrayList<SourceTransformerDefinition>
                             (transformerDefinitions);
                Iterator<SourceTransformerDefinition> transformerDefinitionIt
                        = transformerDefinitions.iterator();
                while (transformerDefinitionIt.hasNext())
                {
                    SourceTransformerDefinition transformerDefinition
                        = transformerDefinitionIt.next();
                    if (this.equals(
                            transformerDefinition.getSourceTransformer()))
                    {
                        transformerDefinitionIt.remove();
                    }
                }

                rootElement = helperController.transformSource(
                        rootElement,
                        transformerDefinitions,
                        controllerState);

                newSourceElement.getChildren().add(rootElement);
View Full Code Here


     * @throws Exception if an error occurs.
     */
    @Test
    public void testOtherTemplateLanguages() throws Exception
    {
        Controller controller = new Controller();
        List<UnitDescriptor> unitDescriptors = new ArrayList<UnitDescriptor>();
        CustomProjectPaths projectPaths = new CustomProjectPaths(
                new Maven2DirectoryProjectPaths(
                        new File("src/test/otherTemplateLanguages")));
        projectPaths.setOutputDirectory(null, TARGET_DIR);
        unitDescriptors.add(new UnitDescriptor(
                UnitDescriptor.Packaging.DIRECTORY,
                projectPaths,
                new DefaultTorqueGeneratorPaths()));
        controller.run(unitDescriptors);
        // TODO: check outcome against reference file
        assertTrue(OUTPUT_FILE.exists());
        assertEquals(
                "groovy test output",
                FileUtils.readFileToString(OUTPUT_FILE));
View Full Code Here

TOP

Related Classes of org.apache.torque.generator.control.Controller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.