Package org.apache.tuscany.sca.assembly

Examples of org.apache.tuscany.sca.assembly.Binding


        CompositeService s1 = assemblyFactory.createCompositeService();
        s1.setName("s1");
        composite1.getServices().add(s1);

        Binding b1 = new TestBindingImpl();
        s1.getBindings().add(b1);

        CompositeService s2 = assemblyFactory.createCompositeService();
        s2.setName("s2");
        composite1.getServices().add(s2);

        Binding b2 = new TestBindingImpl();
        s2.getBindings().add(b2);

        return composite1;
    }
View Full Code Here


        ComponentService s2 = assemblyFactory.createComponentService();
        c2.getServices().add(s2);
        s2.setName("s2");

        Binding b1 = new TestBindingImpl();
        s1.getBindings().add(b1);

        Binding b2 = new TestBindingImpl();
        s2.getBindings().add(b2);

        return composite1;
    }
View Full Code Here

    @Test
    public void testComponentServiceSingleService() {
        Composite composite = createComponentServiceBinding();
        composite.getComponents().get(0).getServices().remove(1);
        Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);

            assertEquals("http://myhost:8080/root/c1", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    }

    @Test
    public void testComponentServiceBindingDefault() {
        Composite composite = createComponentServiceBinding();
        Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);

            assertEquals("http://myhost:8080/root/c1/s1", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    }

    @Test
    public void testComponentServiceBindingName() {
        Composite composite = createComponentServiceBinding();
        Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
        b.setName("n");

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);

            assertEquals("http://myhost:8080/root/c1/n", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    }

    @Test
    public void testComponentServiceBindingURIRelative() {
        Composite composite = createComponentServiceBinding();
        Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
        b.setName("n");
        b.setURI("b");

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);

            assertEquals("http://myhost:8080/root/c1/b", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    }

    @Test
    public void testComponentServiceBindingURIAbsolute() {
        Composite composite = createComponentServiceBinding();
        Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
        b.setName("n");
        b.setURI("http://myhost:8080/b");

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);

            assertEquals("http://myhost:8080/b", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    }

    @Test
    public void testComponentServiceBindingURIRelative2() {
        Composite composite = createComponentServiceBinding();
        Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
        b.setName("n");
        b.setURI("../../b");

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);

            assertEquals("http://myhost:8080/b", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    @Test
    public void testCompositeServiceSingleService() {
        Composite composite = createTopLevelCompositeServiceBinding();
        composite.getServices().remove(1);
        Binding b = composite.getServices().get(0).getBindings().get(0);

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);

            assertEquals("http://myhost:8080/root", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    }

    @Test
    public void testCompositeServiceBindingDefault() {
        Composite composite = createTopLevelCompositeServiceBinding();
        Binding b = composite.getServices().get(0).getBindings().get(0);

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);

            assertEquals("http://myhost:8080/root/s1", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.assembly.Binding

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.