Examples of WebImplementation


Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

            if(artifact.getURI().toString().equals("WEB-INF/web.composite")) {
                Composite composite = (Composite)artifact.getModel();
                Assert.assertEquals("Number of components", 1, composite.getComponents().size());
                Component component = composite.getComponents().get(0);
                Assert.assertTrue("Component with implementation.web", component.getImplementation() instanceof WebImplementation);
                WebImplementation webImpl = (WebImplementation) component.getImplementation();
                Assert.assertEquals("Number of reference", 2, webImpl.getReferences().size());
                List<String> referenceNames = new ArrayList<String>();
                referenceNames.add("name1");
                referenceNames.add("sample.HelloworldEjbServlet_service");
                for(Reference ref : webImpl.getReferences()) {
                    Assert.assertTrue(referenceNames.contains(ref.getName()));
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

            if(artifact.getURI().toString().equals("WEB-INF/web.composite")) {
                Composite composite = (Composite)artifact.getModel();
                Assert.assertEquals("Number of components", 1, composite.getComponents().size());
                Component component = composite.getComponents().get(0);
                Assert.assertTrue("Component with implementation.web", component.getImplementation() instanceof WebImplementation);
                WebImplementation webImpl = (WebImplementation) component.getImplementation();
                Assert.assertEquals("Number of reference", 2, webImpl.getReferences().size());
                List<String> referenceNames = new ArrayList<String>();
                referenceNames.add("name1");
                referenceNames.add("sample.HelloworldEjbServlet_service");
                for(Reference ref : webImpl.getReferences()) {
                    Assert.assertTrue(referenceNames.contains(ref.getName()));
                }
            }
        }
       
        List<Composite> deployables = contribution.getDeployables();
        Assert.assertEquals("Deployable composites", 1, deployables.size());
        Composite composite = deployables.get(0);
        Assert.assertEquals("Number of components", 1, composite.getComponents().size());
        Component component = composite.getComponents().get(0);
        Assert.assertTrue("Component with implementation.web", component.getImplementation() instanceof WebImplementation);
        WebImplementation webImpl = (WebImplementation) component.getImplementation();
        Assert.assertEquals("Number of reference", 2, webImpl.getReferences().size());
        List<String> referenceNames = new ArrayList<String>();
        referenceNames.add("name1");
        referenceNames.add("sample.HelloworldEjbServlet_service");
        for(Reference ref : webImpl.getReferences()) {
            Assert.assertTrue(referenceNames.contains(ref.getName()));
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

                Composite composite = (Composite)artifact.getModel();
                Assert.assertEquals("Number of components", 3, composite.getComponents().size());
                for(Component component : composite.getComponents()) {
                    if(component.getName().equals("webComponent")) {
                        Assert.assertTrue(component.getImplementation() instanceof WebImplementation);
                        WebImplementation webImpl = (WebImplementation)component.getImplementation();
                        Assert.assertEquals("Number of references", 1, webImpl.getReferences().size());
                    } else if(component.getName().equals("ejbComponent1")) {
                        Assert.assertTrue(component.getImplementation() instanceof EJBImplementation);
                        EJBImplementation ejbImpl = (EJBImplementation)component.getImplementation();
                        Assert.assertEquals("Number of services", 1, ejbImpl.getServices().size());
                        Assert.assertEquals("Number of references", 0, ejbImpl.getReferences().size());
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

            if(artifact.getURI().toString().equals("WEB-INF/web.composite")) {
                Composite composite = (Composite)artifact.getModel();
                Assert.assertEquals("Number of components", 1, composite.getComponents().size());
                Component component = composite.getComponents().get(0);
                Assert.assertTrue("Component with implementation.web", component.getImplementation() instanceof WebImplementation);
                WebImplementation webImpl = (WebImplementation) component.getImplementation();
                Assert.assertEquals("Number of reference", 2, webImpl.getReferences().size());
                List<String> referenceNames = new ArrayList<String>();
                referenceNames.add("name1");
                referenceNames.add("sample.HelloworldEjbServlet_service");
                for(Reference ref : webImpl.getReferences()) {
                    Assert.assertTrue(referenceNames.contains(ref.getName()));
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

            if(artifact.getURI().toString().equals("WEB-INF/web.composite")) {
                Composite composite = (Composite)artifact.getModel();
                Assert.assertEquals("Number of components", 1, composite.getComponents().size());
                Component component = composite.getComponents().get(0);
                Assert.assertTrue("Component with implementation.web", component.getImplementation() instanceof WebImplementation);
                WebImplementation webImpl = (WebImplementation) component.getImplementation();
                Assert.assertEquals("Number of reference", 2, webImpl.getReferences().size());
                List<String> referenceNames = new ArrayList<String>();
                referenceNames.add("name1");
                referenceNames.add("sample.HelloworldEjbServlet_service");
                for(Reference ref : webImpl.getReferences()) {
                    Assert.assertTrue(referenceNames.contains(ref.getName()));
                }
            }
        }
       
        List<Composite> deployables = contribution.getDeployables();
        Assert.assertEquals("Deployable composites", 1, deployables.size());
        Composite composite = deployables.get(0);
        Assert.assertEquals("Number of components", 1, composite.getComponents().size());
        Component component = composite.getComponents().get(0);
        Assert.assertTrue("Component with implementation.web", component.getImplementation() instanceof WebImplementation);
        WebImplementation webImpl = (WebImplementation) component.getImplementation();
        Assert.assertEquals("Number of reference", 2, webImpl.getReferences().size());
        List<String> referenceNames = new ArrayList<String>();
        referenceNames.add("name1");
        referenceNames.add("sample.HelloworldEjbServlet_service");
        for(Reference ref : webImpl.getReferences()) {
            Assert.assertTrue(referenceNames.contains(ref.getName()));
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

                Composite composite = (Composite)artifact.getModel();
                Assert.assertEquals("Number of components", 3, composite.getComponents().size());
                for(Component component : composite.getComponents()) {
                    if(component.getName().equals("webComponent")) {
                        Assert.assertTrue(component.getImplementation() instanceof WebImplementation);
                        WebImplementation webImpl = (WebImplementation)component.getImplementation();
                        Assert.assertEquals("Number of references", 1, webImpl.getReferences().size());
                    } else if(component.getName().equals("ejbComponent1")) {
                        Assert.assertTrue(component.getImplementation() instanceof EJBImplementation);
                        EJBImplementation ejbImpl = (EJBImplementation)component.getImplementation();
                        Assert.assertEquals("Number of services", 1, ejbImpl.getServices().size());
                        Assert.assertEquals("Number of references", 0, ejbImpl.getReferences().size());
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

    }

    public WebImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.web> element
        WebImplementation implementation = implementationFactory.createWebImplementation();
        implementation.setUnresolved(true);

        // Read the webapp uri attribute
        String webURI = getString(reader, "web-uri");
        if (webURI != null) {
            implementation.setWebURI(webURI);

            // Set the URI of the component type
            // TODO: This should point to the base uri of the WAR file
            implementation.setURI(webURI);
        }

        // Skip to end element
        while (reader.hasNext()) {
            if (reader.next() == END_ELEMENT && IMPLEMENTATION_WEB.equals(reader.getName())) {
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

    }

    public WebImplementation read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.web> element
        WebImplementation implementation = implementationFactory.createWebImplementation();
        implementation.setUnresolved(true);

        // Read the webapp uri attribute
        String webURI = getString(reader, "web-uri");
        if (webURI != null) {
            implementation.setWebURI(webURI);

            // Set the URI of the component type
            implementation.setURI(webURI);
        }

        String jsClient = reader.getAttributeValue(Constants.SCA11_TUSCANY_NS, "jsClient");
        if (jsClient != null) {
            implementation.setJSClient(Boolean.parseBoolean(jsClient));
        }

        // Skip to end element
        while (reader.hasNext()) {
            if (reader.next() == END_ELEMENT && IMPLEMENTATION_WEB.equals(reader.getName())) {
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

    }

    public WebImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.web> element
        WebImplementation implementation = implementationFactory.createWebImplementation();
        implementation.setUnresolved(true);

        // Read the webapp uri attribute
        String webURI = getString(reader, "web-uri");
        if (webURI != null) {
            implementation.setWebURI(webURI);

            // Set the URI of the component type
            implementation.setURI(webURI);
        }

        // Skip to end element
        while (reader.hasNext()) {
            if (reader.next() == END_ELEMENT && IMPLEMENTATION_WEB.equals(reader.getName())) {
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.web.WebImplementation

        Composite composite = helper.createComposite();

        ModelFactoryExtensionPoint mfep = new DefaultModelFactoryExtensionPoint();
        WebImplementationFactory wif = mfep.getFactory(WebImplementationFactory.class);
        WebImplementation impl = wif.createWebImplementation();
        impl.setWebURI(webModule.getModuleId());

        // Create component
        Component component = helper.createComponent();
        String componentName = webModule.getModuleId();
        component.setName(componentName);
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.