Examples of XmlObject


Examples of org.apache.xmlbeans.XmlObject

    }

    public void testGeronimoNamingNamespaceChange() throws Exception {
        URL srcXml = classLoader.getResource("geronimo/ejb-naming-pre.xml");
        URL expectedOutputXml = classLoader.getResource("geronimo/ejb-naming-post.xml");
        XmlObject xmlObject = XmlBeansUtil.parse(srcXml, this.getClass().getClassLoader());
        XmlCursor cursor = xmlObject.newCursor();
        try {
            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
            log.debug(xmlObject.toString());
           
            XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
            log.debug(expected.toString());
           
            List problems = new ArrayList();
            boolean ok = compareXmlObjects(xmlObject, expected, problems);
            assertTrue("Differences: " + problems, ok);
            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

    }
//
    public void testGetNestedObjectAsType() throws Exception {
        URL srcXml = classLoader.getResource("geronimo/ejb-naming-pre.xml");
//        URL expectedOutputXml = classLoader.getResource("geronimo/ejb-naming-post.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        //this is not a usable type, we'll see what happens though
        xmlObject = SchemaConversionUtils.getNestedObjectAsType(xmlObject, new QName("http://openejb.apache.org/xml/ns/openejb-jar-2.3", "openejb-jar"), EjbJarType.type);
//          log.debug(xmlObject.toString());
    }
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

    }

    public void testSecurityElementConverter() throws Exception {
        URL srcXml = classLoader.getResource("geronimo/security-pre.xml");
        URL expectedOutputXml = classLoader.getResource("geronimo/security-post.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        ElementConverter elementConverter = new SecurityElementConverter();
        XmlCursor cursor = xmlObject.newCursor();
        XmlCursor end = cursor.newCursor();
        try {
            elementConverter.convertElement(cursor, end);
            //        log.debug(xmlObject.toString());
            XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
            List problems = new ArrayList();
            boolean ok = compareXmlObjects(xmlObject, expected, problems);
            assertTrue("Differences: " + problems, ok);
            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
            boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

    }

    public void testGBeanElementConverter() throws Exception {
        URL srcXml = classLoader.getResource("geronimo/gbean-pre.xml");
        URL expectedOutputXml = classLoader.getResource("geronimo/gbean-post.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        ElementConverter elementConverter = new GBeanElementConverter();
        XmlCursor cursor = xmlObject.newCursor();
        XmlCursor end = cursor.newCursor();
        try {
            elementConverter.convertElement(cursor, end);
            //        log.debug(xmlObject.toString());
            XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
            List problems = new ArrayList();
            boolean ok = compareXmlObjects(xmlObject, expected, problems);
            assertTrue("Differences: " + problems, ok);
            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
            boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

    }

    public void testQNameConverter1() throws Exception {
        URL srcXml = classLoader.getResource("geronimo/qname1-pre.xml");
        URL expectedOutputXml = classLoader.getResource("geronimo/qname1-post.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        ElementConverter elementConverter = new QNameConverter("import", "http://geronimo.apache.org/xml/ns/deployment-1.0", "parent");
        XmlCursor cursor = xmlObject.newCursor();
        XmlCursor end = cursor.newCursor();
        try {
            elementConverter.convertElement(cursor, end);
            //        log.debug(xmlObject.toString());
            XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
            List problems = new ArrayList();
            boolean ok = compareXmlObjects(xmlObject, expected, problems);
            assertTrue("Differences: " + problems, ok);
            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
            boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

    }
    public void testQNameConverter2() throws Exception {
        URL srcXml = classLoader.getResource("geronimo/qname2-pre.xml");
        URL expectedOutputXml = classLoader.getResource("geronimo/qname2-post.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
        ElementConverter elementConverter = new QNameConverter("import", "http://geronimo.apache.org/xml/ns/deployment-1.0", "parent");
        XmlCursor cursor = xmlObject.newCursor();
        XmlCursor end = cursor.newCursor();
        try {
            elementConverter.convertElement(cursor, end);
            //        log.debug(xmlObject.toString());
            XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
            List problems = new ArrayList();
            boolean ok = compareXmlObjects(xmlObject, expected, problems);
            assertTrue("Differences: " + problems, ok);
            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
            boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

    }
    public void testWebMessageDestination1() throws Exception {
        URL srcXml = classLoader.getResource("geronimo/web-md-pre.xml");
        URL expectedOutputXml = classLoader.getResource("geronimo/web-md-post.xml");
        XmlObject xmlObject = XmlBeansUtil.parse(srcXml, this.getClass().getClassLoader());
        XmlCursor cursor = xmlObject.newCursor();
        try {
            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
            log.debug(xmlObject.toString());
           
            XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
            log.debug(expected.toString());
           
            List problems = new ArrayList();
            boolean ok = compareXmlObjects(xmlObject, expected, problems);
            assertTrue("Differences: " + problems, ok);
            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

        Long longVal = new Long(1234567890123456L);
        Float floatVal = new Float(123.456);
        Double doubleVal = new Double(12345.6789);
        Boolean booleanVal = Boolean.TRUE;

        XmlObject doc = XmlObject.Factory.parse(TEST);
        XmlCursor cursor = doc.newCursor();
        try {
            cursor.toFirstChild();
            doc = cursor.getObject();
        } finally {
            cursor.dispose();
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

            ejbModule.setEjbJar(null);
            ejbModule.getAltDDs().put("ejb-jar.xml", specDDUrl);
        }

        // convert the vendor plan object to the ejbModule altDD map
        XmlObject unknownXmlObject = null;
        if (plan instanceof XmlObject) {
            unknownXmlObject = (XmlObject) plan;
        } else if (plan != null) {
            try {
                unknownXmlObject = XmlBeansUtil.parse(((File) plan).toURL(), XmlUtil.class.getClassLoader());
            } catch (Exception e) {
                throw new DeploymentException(e);
            }
        }

        if (unknownXmlObject != null) {
            XmlCursor xmlCursor = unknownXmlObject.newCursor();
            //
            QName qname = xmlCursor.getName();
            if (qname == null) {
                xmlCursor.toFirstChild();
                qname = xmlCursor.getName();
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

        //-------------------------------------------------
        // Ensure annotations are processed correctly
        //-------------------------------------------------
        URL srcXML = classLoader.getResource("annotation/empty-web-src.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXML, options);
        WebAppDocument webAppDoc = (WebAppDocument) xmlObject.changeType(WebAppDocument.type);
        WebAppType webApp = webAppDoc.getWebApp();
        AnnotatedWebApp annotatedWebApp = new AnnotatedWebApp(webApp);
        EJBAnnotationHelper.processAnnotations(annotatedWebApp, classFinder);
        URL expectedXML = classLoader.getResource("annotation/ejb-expected.xml");
        XmlObject expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[@EJB Source XML] " + '\n' + webApp.toString() + '\n');
        log.debug("[@EJB Expected XML]" + '\n' + expected.toString() + '\n');
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(webApp, expected, problems);
        assertTrue("Differences: " + problems, ok);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.