Package org.apache.tuscany.sca.assembly

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


    }

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

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

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


    }

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

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

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

    }

    @Test
    public void testCompositeServiceBindingURIAbsolute() {
        Composite composite = createTopLevelCompositeServiceBinding();
        Binding b = composite.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 testNestedCompositeServiceSingleService() {
        Composite composite = createNestCompositeServiceBinding();
        ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
            .remove(1);
        Binding b =
            ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
                .get(0).getBindings().get(0);

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

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

    }

    @Test
    public void testNestedCompositeServiceBindingDefault() {
        Composite composite = createNestCompositeServiceBinding();
        Binding b =
            ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
                .get(0).getBindings().get(0);

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

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

    }

    @Test
    public void testNestedCompositeServiceBindingName() {
        Composite composite = createNestCompositeServiceBinding();
        Binding b =
            ((Composite)composite.getComponents().get(0).getImplementation()).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/c2/n", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    }

    @Test
    public void testNestedCompositeServiceBindingURIRelative() {
        Composite composite = createNestCompositeServiceBinding();
        Binding b =
            ((Composite)composite.getComponents().get(0).getImplementation()).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/c2/b", b.getURI());
        } catch (Exception ex) {
            System.out.println(ex.toString());
            fail();
        }
    }
View Full Code Here

    }

    @Test
    public void testNestedCompositeServiceBindingURIAbsolute() {
        Composite composite = createNestCompositeServiceBinding();
        Binding b =
            ((Composite)composite.getComponents().get(0).getImplementation()).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

    //FIXME Need to find a better way to test these error cases as
    // the composite builder now (intentionally) logs warnings instead of
    // throwing exceptions
    public void FIXMEtestComponentServiceBindingNameError1() {
        Composite composite = createComponentServiceBinding();
        Binding b1 = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
        Binding b2 = new TestBindingImpl();
        composite.getComponents().get(0).getServices().get(0).getBindings().add(b2);

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
            fail();
View Full Code Here

    //FIXME Need to find a better way to test these error cases as
    // the composite builder now (intentionally) logs warnings instead of
    // throwing exceptions
    public void FIXMEtestComponentServiceBindingNameError2() {
        Composite composite = createComponentServiceBinding();
        Binding b1 = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
        Binding b2 = new TestBindingImpl();
        composite.getComponents().get(0).getServices().get(0).getBindings().add(b2);

        b1.setName("b");
        b2.setName("b");

        try {
            nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
            fail();
        } catch (Exception ex) {
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.