Package org.apache.torque.generator.source

Examples of org.apache.torque.generator.source.Source


            log.info("No sources found, skipping output");
        }

        while (sourceProvider.hasNext())
        {
            Source source = sourceProvider.next();
            processSourceInOutput(
                    source,
                    output,
                    controllerState,
                    unitConfiguration);
View Full Code Here


        // As all the source files only have one key equal to the base filename
        // we can make sure we have read the expected files correctly.
        Set<String> resultKeys = new HashSet<String>();
        {
            assertTrue(fileSourceProvider.hasNext());
            Source source = fileSourceProvider.next();
            Object key = source.getRootElement().getChild("entry")
                    .getAttribute("key");
            resultKeys.add((String) key);
        }
        {
            assertTrue(fileSourceProvider.hasNext());
            Source source = fileSourceProvider.next();
            Object key = source.getRootElement().getChild("entry")
                    .getAttribute("key");
            resultKeys.add((String) key);
        }
        assertFalse(fileSourceProvider.hasNext());
        Set<String> expectedKeys = new HashSet<String>();
View Full Code Here

        // We read all sources and add the first property key to a hash set.
        // As all the source files only have one key equal to the base filename
        // we can make sure we have read the expected files correctly.
        Set<String> resultKeys = new HashSet<String>();
        assertTrue(fileSourceProvider.hasNext());
        Source source = fileSourceProvider.next();

        assertEquals(2, source.getRootElement().getChildren("file").size());
        Object key = source.getRootElement()
                .getChildren("file").get(0)
                .getChild("properties")
                .getChild("entry")
                .getAttribute("key");
        resultKeys.add((String) key);
        key = source.getRootElement()
                .getChildren("file").get(1)
                .getChild("properties")
                .getChild("entry")
                .getAttribute("key");
        resultKeys.add((String) key);
        Set<String> expectedKeys = new HashSet<String>();
        expectedKeys.add("1");
        expectedKeys.add("11");
        assertEquals(expectedKeys, resultKeys);

        Set<String> resultPaths = new HashSet<String>();
        String expectedPath = (String) source.getRootElement()
                .getChildren("file").get(0).getAttribute("path");
        expectedPath = expectedPath.replace('\\', '/');
        resultPaths.add(expectedPath);
        expectedPath = (String) source.getRootElement()
                .getChildren("file").get(1).getAttribute("path");
        expectedPath = expectedPath.replace('\\', '/');
        resultPaths.add(expectedPath);
        Set<String> expectedPaths = new HashSet<String>();
        expectedPaths.add("src/test/file/./1.properties");
View Full Code Here

                    = 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
View Full Code Here

            throw new SourceTransformerException(
                    "Could initialize file source provider", e);
        }
        while (fileSourceProvider.hasNext())
        {
            Source additionalSource = fileSourceProvider.next();
            SourceElement additionalSourceRoot;
            try
            {
                additionalSourceRoot = additionalSource.getRootElement();
            }
            catch (SourceException e)
            {
                log.error("Could not construct source from schema file "
                        + additionalSource.getDescription(),
                    e);
                throw new SourceTransformerException(
                        "Could not construct source from schema file "
                            + additionalSource.getDescription(),
                        e);
            }
            sourceElement.getChildren().add(additionalSourceRoot);
        }
View Full Code Here

TOP

Related Classes of org.apache.torque.generator.source.Source

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.