Package org.apache.torque.generator.source.stream

Examples of org.apache.torque.generator.source.stream.FileSource


                .toString();
            File externalSchemaPath
                = new File(externalSchemaBaseDir, relativePath);
            try
            {
                FileSource fileSource = new FileSource(
                        new XmlSourceFormat(),
                        externalSchemaPath,
                        controllerState);
                SourceElement externalSchemaRootElement
                        = fileSource.getRootElement();
                externalSchemaRootElement.setAttribute(
                        DatabaseAttributeName.ROOT_DATABASE_NAME,
                        rootDatabaseName);
                DatabaseMapInitTransformer.setDatabaseMapInitClassNameAttributes(
                        externalSchemaRootElement,
View Full Code Here


            File includeSchemaPath
                = new File(includeSchemaBaseDir, relativePath);
            log.trace("Trying to read included file " + includeSchemaPath);
            try
            {
                FileSource fileSource = new FileSource(
                        new XmlSourceFormat(),
                        includeSchemaPath,
                        controllerState);
                SourceElement includeSchemaRootElement
                        = fileSource.getRootElement();
                log.trace("successfully read included file "
                        + includeSchemaPath);

                this.transform(includeSchemaRootElement, controllerState);
View Full Code Here

                    new File("src/test/propertyToJava"));
        File propertiesFile
                = new File(
                    projectPaths.getDefaultSourcePath(),
                    "propertiesData.properties");
        FileSource fileSource
                = new FileSource(
                        new PropertiesSourceFormat(),
                        propertiesFile,
                        new ControllerState());
        SourceElement rootElement
                = (SourceElement) fileSource.getRootElement();

        SourceElement copiedRootElement = rootElement.copy();
        if (!rootElement.graphEquals(copiedRootElement))
        {
            fail("copied tree does not equal original tree");
View Full Code Here

    @Test
    public void testSourceToXml() throws Exception
    {
        File xmlFile
            = new File("src/test/resources/org/apache/torque/generator/source/xml/source.xml");
        FileSource fileSource = new FileSource(
                new XmlSourceFormat(),
                xmlFile,
                controllerState);
        SourceElement rootElement = fileSource.getRootElement();

        String result = new SourceToXml().toXml(rootElement, true);
        String expected = FileUtils.readFileToString(new File(
                "src/test/resources/org/apache/torque/generator/source/xml/sourceToXmlResult.xml"));
        // remove license from expected file
View Full Code Here

    @Test
    public void testSourceToXmlWithReferences() throws Exception
    {
        File xmlFile = new File(
                "src/test/resources/org/apache/torque/generator/source/xml/source.xml");
        FileSource fileSource = new FileSource(
                new XmlSourceFormat(),
                xmlFile,
                controllerState);
        SourceElement rootElement = fileSource.getRootElement();
        rootElement.getChildren().get(2).getChildren().add(
                rootElement.getChildren().get(0).getChildren().get(0));

        String result = new SourceToXml().toXml(rootElement, true);
        String expected = FileUtils.readFileToString(new File(
View Full Code Here

    public void testParsePropertiesFile()
            throws ConfigurationException, SourceException
    {
        File propertiesFile
            = new File("src/test/resources/org/apache/torque/generator/source/properties/propertiesParserTest.properties");
        FileSource fileSource
                = new FileSource(
                        new PropertiesSourceFormat(),
                        propertiesFile,
                        controllerState);

        SourceElement rootElement = fileSource.getRootElement();
        assertEquals("properties", rootElement.getName());
        assertEquals(0, rootElement.getAttributeNames().size());

        assertEquals(2, rootElement.getChildren().size());
        {
View Full Code Here

    }

    @Test(expected = NullPointerException.class)
    public void testPathNull() throws ConfigurationException
    {
        new FileSource(
                new PropertiesSourceFormat(),
                null,
                controllerState);
    }
View Full Code Here

TOP

Related Classes of org.apache.torque.generator.source.stream.FileSource

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.