Examples of XmlObject


Examples of org.apache.xmlbeans.XmlObject

        //-------------------------------------------------
        // Ensure annotations are processed correctly
        //-------------------------------------------------
        URL srcXML = classLoader.getResource("annotation/handler-chain-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);
        HandlerChainAnnotationHelper.processAnnotations(annotatedWebApp, classFinder);
        URL expectedXML = classLoader.getResource("annotation/handler-chain-expected.xml");
        XmlObject expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[@HandlerChain Source XML] " + '\n' + webApp.toString() + '\n');
        log.debug("[@HandlerChain Expected XML]" + '\n' + expected.toString() + '\n');
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(webApp, expected, problems);
        assertTrue("Differences: " + problems, ok);
    }
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);
        PersistenceContextAnnotationHelper.processAnnotations(annotatedWebApp, classFinder);
        URL expectedXML = classLoader.getResource("annotation/persistence-context-expected.xml");
        XmlObject expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[@PersistenceContext Source XML] " + '\n' + webApp.toString() + '\n');
        log.debug("[@PersistenceContext Expected XML]" + '\n' + expected.toString() + '\n');
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(webApp, expected, problems);
        assertTrue("Differences: " + problems, ok);
    }
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);
        PersistenceUnitAnnotationHelper.processAnnotations(annotatedWebApp, classFinder);
        URL expectedXML = classLoader.getResource("annotation/persistence-unit-expected.xml");
        XmlObject expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[@PersistenceUnit Source XML] " + '\n' + webApp.toString() + '\n');
        log.debug("[@PersistenceUnit Expected XML]" + '\n' + expected.toString() + '\n');
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(webApp, expected, problems);
        assertTrue("Differences: " + problems, ok);
    }
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

        }
    }
   
    public static void insertHandlers(ServiceRefType serviceRef, URL url) throws Exception {
        // Bind the XML handler chain file to an XMLBeans document
        XmlObject xml = XmlBeansUtil.parse(url, null);
        HandlerChainsDocument hcd = (HandlerChainsDocument) XmlBeansUtil.typedCopy(xml, HandlerChainsDocument.type);
        HandlerChainsType handlerChains = hcd.getHandlerChains();
       
        ServiceRefHandlerChainsType serviceRefHandlerChains = serviceRef.addNewHandlerChains();
        for (HandlerChainType handlerChain : handlerChains.getHandlerChainArray()) {
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);
        WebServiceRefAnnotationHelper.processAnnotations(annotatedWebApp, classFinder);
        URL expectedXML = classLoader.getResource("annotation/webservice-ref-expected.xml");
        XmlObject expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[@WebServiceRef Source XML] " + '\n' + webApp.toString() + '\n');
        log.debug("[@WebServiceRef Expected XML]" + '\n' + expected.toString() + '\n');
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(webApp, expected, problems);
        assertTrue("Differences: " + problems, ok);
    }
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();
        SecurityAnnotationHelper.processAnnotations(webApp, classFinder);
        URL expectedXML = classLoader.getResource("annotation/security-expected.xml");
        XmlObject expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[Security Source XML] " + '\n' + webApp.toString() + '\n');
        log.debug("[Security Expected XML]" + '\n' + expected.toString() + '\n');
        List problems = new ArrayList();
        boolean ok = compareXmlObjects(webApp, expected, problems);
        assertTrue("Differences: " + problems, ok);

        srcXML = classLoader.getResource("annotation/security-src.xml");
        xmlObject = XmlObject.Factory.parse(srcXML, options);
        webAppDoc = (WebAppDocument) xmlObject.changeType(WebAppDocument.type);
        webApp = webAppDoc.getWebApp();
        SecurityAnnotationHelper.processAnnotations(webApp, classFinder);
        expectedXML = classLoader.getResource("annotation/security-expected-1.xml");
        expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[Security Source XML] " + '\n' + webApp.toString() + '\n');
        log.debug("[Security Expected XML]" + '\n' + expected.toString() + '\n');
        problems = new ArrayList();
        ok = compareXmlObjects(webApp, expected, problems);
        assertTrue("Differences: " + problems, ok);
    }
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

            }
        } else if (mode.equals("process-" + TEST_LOGIN_MODE)) {
            actionAttemptLogin(data, actionRequest, actionRequest.getPortletSession(true), actionRequest.getParameter("username"), actionRequest.getParameter("password"));
            actionResponse.setRenderParameter(MODE_KEY, TEST_RESULTS_MODE);
        } else if (mode.equals(SHOW_PLAN_MODE)) {
            XmlObject object = actionGeneratePlan(actionRequest, data);
            savePlanToSession(actionRequest.getPortletSession(true), object);
            actionResponse.setRenderParameter(MODE_KEY, SHOW_PLAN_MODE);
        } else if (mode.equals(EDIT_EXISTING_MODE)) {
            actionLoadExistingRealm(actionRequest, data);
            actionResponse.setRenderParameter(MODE_KEY, EDIT_MODE);
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

    private void actionSaveRealm(PortletRequest request, RealmData data) {
        normalize(data);
        if (data.getAbstractName() == null || data.getAbstractName().equals("")) { // we're creating a new realm
            try {
                XmlObject plan = actionGeneratePlan(request, data);
                data.name = data.name.replaceAll("\\s", "");
                DeploymentManager mgr = ManagementHelper.getManagementHelper(request).getDeploymentManager();
                File tempFile = File.createTempFile("console-deployment", ".xml");
                tempFile.deleteOnExit();
                log.debug("Writing security realm deployment plan to " + tempFile.getAbsolutePath());
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

     */
    protected static XmlObject[] convert(XmlObject[] xmlObjects, NamespaceElementConverter converter, SchemaType type) throws DeploymentException {
        //bizarre ArrayStoreException if xmlObjects is loaded by the wrong classloader
        XmlObject[] converted = new XmlObject[xmlObjects.length];
        for (int i = 0; i < xmlObjects.length; i++) {
            XmlObject xmlObject = xmlObjects[i].copy();
            if (xmlObject.schemaType() != type) {
                converter.convertElement(xmlObject);
                converted[i] = xmlObject.changeType(type);
            } else {
                converted[i] = xmlObject;
            }
            try {
                XmlBeansUtil.validateDD(converted[i]);
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

            "  <admin-object-link>l2</admin-object-link>" +
            "</message-destination>" +
            "</tmp>";

    public void testMessageDestinations() throws Exception {
        XmlObject specDD = parse(SPECDD1);
        XmlObject plan = parse(PLAN1);
        adminObjectRefBuilder.initContext(specDD, plan, module);
        AbstractName n1 = naming.createChildName(baseName, "l1", NameFactory.JCA_ADMIN_OBJECT);
        AbstractName n2 = naming.createChildName(baseName, "l2", NameFactory.JCA_ADMIN_OBJECT);
        configuration.addGBean(new GBeanData(n1, AdminObjectWrapperGBean.GBEAN_INFO));
        configuration.addGBean(new GBeanData(n2, AdminObjectWrapperGBean.GBEAN_INFO));
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.