Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject$Factory


    //The schemas have been fixed by sun, we can use the official schemas.

    public void testApplicationClient13ToApplicationClient14Transform() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/application-client-13.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/application-client-14.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        SchemaConversionUtils.validateDD(expected);
        xmlObject = SchemaConversionUtils.convertToApplicationClientSchema(xmlObject);
//        System.out.println(xmlObject.toString());
//        System.out.println(expected.toString());
        List problems = new ArrayList();
View Full Code Here


    }

    public void testApplication13ToApplication14Transform() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/application-13.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/application-14.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        SchemaConversionUtils.validateDD(expected);
        xmlObject = SchemaConversionUtils.convertToApplicationSchema(xmlObject);
//        System.out.println(xmlObject.toString());
//        System.out.println(expected.toString());
        List problems = new ArrayList();
View Full Code Here

    }

    public void testConnector10ToConnector15Transform() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/ra-10.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/ra-15.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        SchemaConversionUtils.validateDD(expected);
        xmlObject = SchemaConversionUtils.convertToConnectorSchema(xmlObject);
//        System.out.println(xmlObject.toString());
//        System.out.println(expected.toString());
        List problems = new ArrayList();
View Full Code Here

    }

    public void testEJB11ToEJB21Transform() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_2dtd/ejb-1-11.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_2dtd/ejb-1-21.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        SchemaConversionUtils.validateDD(expected);
        xmlObject = SchemaConversionUtils.convertToEJBSchema(xmlObject);
//        System.out.println(xmlObject.toString());
//        System.out.println(expected.toString());
        List problems = new ArrayList();
View Full Code Here

    }

    public void testEJB20ToEJB21Transform() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/ejb-jar.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/ejb-jar-21.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        SchemaConversionUtils.validateDD(expected);
        xmlObject = SchemaConversionUtils.convertToEJBSchema(xmlObject);
//        System.out.println(xmlObject.toString());
//        System.out.println(expected.toString());
        List problems = new ArrayList();
View Full Code Here

    }

    public void testMDB20To21Transform() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/mdb-ejb-jar-20.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/mdb-ejb-jar-21.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        SchemaConversionUtils.validateDD(expected);
        xmlObject = SchemaConversionUtils.convertToEJBSchema(xmlObject);
//        System.out.println(xmlObject.toString());
//        System.out.println(expected.toString());
        List problems = new ArrayList();
View Full Code Here

    }

    public void testOrderDescriptionGroup() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/DescriptionGroupTestSource.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/DescriptionGroupTestExpected.xml");
        XmlObject srcObject = XmlObject.Factory.parse(srcXml);
        XmlCursor srcCursor = srcObject.newCursor();
        XmlCursor moveable = srcObject.newCursor();
        try {
            srcCursor.toFirstChild();
            srcCursor.toFirstChild();
            assertTrue(srcCursor.getName().toString(), "filter".equals(srcCursor.getName().getLocalPart()));
            do {
                srcCursor.push();
                srcCursor.toFirstChild();
                SchemaConversionUtils.convertToDescriptionGroup(srcCursor, moveable);
                srcCursor.pop();
            } while (srcCursor.toNextSibling());
        } finally {
            srcCursor.dispose();
        }
//        System.out.println(srcObject.toString());
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(srcObject, expected, problems);
        assertTrue("Differences: " + problems, ok);
    }
View Full Code Here

    }

    public void testOrderJNDIEnvironmentRefsGroup() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/JNDIEnvironmentRefsGroupTestSource.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/JNDIEnvironmentRefsGroupTestExpected.xml");
        XmlObject srcObject = XmlObject.Factory.parse(srcXml);
        XmlCursor srcCursor = srcObject.newCursor();
        XmlCursor moveable = srcObject.newCursor();
        try {
            srcCursor.toFirstChild();
            srcCursor.toFirstChild();
            assertTrue(srcCursor.getName().toString(), "web-app".equals(srcCursor.getName().getLocalPart()));
            do {
                srcCursor.push();
                srcCursor.toFirstChild();
                srcCursor.toNextSibling();
                srcCursor.toNextSibling();
                moveable.toCursor(srcCursor);
                SchemaConversionUtils.convertToJNDIEnvironmentRefsGroup(srcCursor, moveable);
                srcCursor.pop();
            } while (srcCursor.toNextSibling());
        } finally {
            srcCursor.dispose();
        }
//        System.out.println(srcObject.toString());
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(srcObject, expected, problems);
        assertTrue("Differences: " + problems, ok);
    }
View Full Code Here

    }

    public void testWeb23To24Transform() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/web-23.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/web-24.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
//        System.out.println(xmlObject.toString());
//        System.out.println(expected.toString());
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(xmlObject, expected, problems);
        assertTrue("Differences: " + problems, ok);
View Full Code Here

    }

    public void testWeb23To24OtherTransform() throws Exception {
        File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/web-1-23.xml");
        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_3dtd/web-1-24.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
//        System.out.println(xmlObject.toString());
        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(xmlObject, expected, problems);
        assertTrue("Differences: " + problems, ok);
        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlObject$Factory

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.