Package org.apache.tuscany.sca.assembly

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


       
    } 
   
    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 {
            configurationBuilder.configureBindingURIs(composite, null, defaultBindings);

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


    // nested composite service binding tests
   
    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 {
            configurationBuilder.configureBindingURIs(composite, null, defaultBindings);

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

       
    }
   
    public void testNestedCompositeServiceBindingDefault() {
        Composite composite = createNestCompositeServiceBinding();
        Binding b = ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices().get(0).getBindings().get(0);
       
        try {
            configurationBuilder.configureBindingURIs(composite, null, defaultBindings);

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

       
    } 
   
    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 {
            configurationBuilder.configureBindingURIs(composite, null, defaultBindings);

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

       
    }  
   
    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 {
            configurationBuilder.configureBindingURIs(composite, null, defaultBindings);

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

       
    } 
   
    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 {
            configurationBuilder.configureBindingURIs(composite, null, defaultBindings);

            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 {
            configurationBuilder.configureBindingURIs(composite, null, defaultBindings);
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 {
            configurationBuilder.configureBindingURIs(composite, null, defaultBindings);
            fail();
View Full Code Here

        Object model = extensionProcessor.read(reader, context);
        if (model instanceof Composite) {
            Composite composite = (Composite)model;
            Component component = composite.getComponents().get(0);
            ComponentService service = component.getServices().get(0);
            Binding binding = service.getBindings().get(0);
            endpoint.setComponent(component);
            endpoint.setService(service);
            endpoint.setBinding(binding);
        }
        return endpoint;
View Full Code Here

                    ComponentService service = (ComponentService)endpoint.getService().clone();
                    component.getServices().add(service);
                    service.getBindings().clear();
                    service.setInterfaceContract(endpoint.getComponentServiceInterfaceContract());
                    if (endpoint.getBinding() != null) {
                        Binding binding = (Binding)endpoint.getBinding().clone();
                        service.getBindings().add(binding);
                    }               
                }
            }
            return composite;
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.