Package org.objectweb.celtix

Examples of org.objectweb.celtix.Bus


        };
    }

    public void testCallback() {
  
        Bus bus = null;
        try {
            bus = Bus.init();
        } catch (BusException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       
        Object implementor = new CallbackImpl();
        String address = "http://localhost:9005/CallbackContext/CallbackPort";
        Endpoint.publish(address, implementor);
       
        URL wsdlURL = getClass().getResource("/wsdl/basic_callback.wsdl");
       
        SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
        ServerPortType port = ss.getSOAPPort();
      
        EndpointReferenceType ref = null;
        try {
            ref = EndpointReferenceUtils.getEndpointReference(new WSDLManagerImpl(bus), implementor);
        } catch (BusException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       
        String resp = port.registerCallback(ref);

        assertTrue(resp.equals("registerCallback called"));
       
        try {
            bus.shutdown(true);
        } catch (BusException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       
View Full Code Here


import org.objectweb.celtix.bindings.xmlformat.TBody;

public class XMLBindingExtensionTest extends TestCase {

    public void testExtensionRegister() throws Exception {
        Bus bus = Bus.init();
        int inCount = 0;
        int outCount = 0;
        ExtensionRegistry registry = bus.getWSDLManager().getExtenstionRegistry();
        assertNotNull(registry);
       
        if (registry.getAllowableExtensions(BindingInput.class) != null) {
            inCount = registry.getAllowableExtensions(BindingInput.class).size();
        }
View Full Code Here

        assertTrue(inputSet.size() == inCount);
        assertTrue(outputSet.size() == outCount);
    }

    public void testXMLBindingExtensor() throws Exception {
        Bus bus = Bus.init();
        ExtensionRegistry registry = bus.getWSDLManager().getExtenstionRegistry();
        assertNotNull(registry);
       
        URL wsdlUrl = getClass().getResource("/wsdl/hello_world_xml_bare.wsdl");
        Definition definition = bus.getWSDLManager().getDefinition(wsdlUrl);
        assertNotNull(definition);
        QName wsdlName = new QName("http://objectweb.org/hello_world_xml_http/bare", "HelloWorld");
        assertEquals(definition.getQName(), wsdlName);

        QName bindingName = new QName("http://objectweb.org/hello_world_xml_http/bare", "Greeter_XMLBinding");
View Full Code Here

       
        objContext.setMethod(ClassUtils.getMethod(Greeter.class, "greetMe"));
    }
   
    public void testBindingReference() throws Exception {
        Bus bus = Bus.init();
        binding = getBindingImpl(bus, testUtils.getEndpointReference());
       
        bus = binding.getBus();
        assertNotNull(bus);
        EndpointReferenceType reference = binding.getEndpointReference();
        assertNotNull(reference);

        // test wsdl definition from the endpoint reference
        Definition wsdlDef = EndpointReferenceUtils.getWSDLDefinition(bus.getWSDLManager(), reference);
        assertNotNull(wsdlDef);
        QName wsdlName = new QName("http://objectweb.org/hello_world_xml_http/bare", "HelloWorld");
        assertEquals(wsdlDef.getQName(), wsdlName);
       
        Port port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), reference);
        assertNotNull(port);
        Binding b = port.getBinding();
        assertNotNull(b);
        BindingOperation operation = b.getBindingOperation("sayHi", "sayHiRequest", "sayHiResponse");
        assertNotNull(operation);
View Full Code Here

                     xmlBinding.getRootNode());
    }

    // Test greetMe which has one part in message
    public void testMarshalBareWithoutRootNode() throws Exception {
        Bus bus = Bus.init();
        binding = getBindingImpl(bus, testUtils.getEndpointReference());
       
        xmlContext.put(ObjectMessageContext.MESSAGE_INPUT, false);
        String arg0 = new String("TestXMLInputMessage");
        objContext.setMessageObjects(arg0);
View Full Code Here

        assertTrue(expectDOM.isEqualNode(resultDOM));
    }

    // Test sayHi which has no parameter to passed in
    public void testMarshalBareWithRootNode() throws Exception {
        Bus bus = Bus.init();

        binding = getBindingImpl(bus, testUtils.getEndpointReference());

        objContext.setMethod(ClassUtils.getMethod(Greeter.class, "sayHi"));
        xmlContext.put(ObjectMessageContext.MESSAGE_INPUT, false);
View Full Code Here

    public void setUp() {
        testUtils = new TestUtils();
    }
   
    public void testCreateClientBinding() throws Exception {
        Bus bus = Bus.init(new String[0]);
        BindingFactory factory =
            bus.getBindingManager().getBindingFactory(
                "http://celtix.objectweb.org/bindings/xmlformat");
        assertNotNull(factory);
       
        EndpointReferenceType address = testUtils.getEndpointReference();
       
        ClientBinding clientBinding = factory.createClientBinding(address);
        assertNotNull(clientBinding);
        assertTrue(XMLClientBinding.class.isInstance(clientBinding));
       
        XMLClientBinding xmlClientBinding = (XMLClientBinding)clientBinding;
        Binding b = xmlClientBinding.getBinding();
        assertNotNull(b);
        assertTrue(XMLBindingImpl.class.isInstance(b));
              
        bus.shutdown(true);      
    }
View Full Code Here

        assertTrue(tc.kind().value() == TCKind._tk_wstring);
        assertTrue(CorbaUtils.isPrimitiveIdlType(type));
    }
   
    public void testGetCorbaAddressType() throws Exception {
        Bus bus = Bus.init();
       
        // programmatically add the corba binding factory
        BindingManager manager = bus.getBindingManager();
        CorbaBindingFactory corbaBF = new CorbaBindingFactory();
        corbaBF.init(bus);
        manager.registerBinding(CorbaConstants.NU_WSDL_CORBA, corbaBF);
       
        EndpointReferenceType endpoint = testUtils.getSimpleTestEndpointReference();
View Full Code Here

        AddressType address = CorbaUtils.getCorbaAddressType(bus, endpoint);
        assertNotNull(address);                  
    }
   
    public void testGetCorbaBindingType() throws Exception {
        Bus bus = Bus.init();
       
        // programmatically add the corba binding factory
        BindingManager manager = bus.getBindingManager();
        CorbaBindingFactory corbaBF = new CorbaBindingFactory();
        corbaBF.init(bus);
        manager.registerBinding(CorbaConstants.NU_WSDL_CORBA, corbaBF);
       
        EndpointReferenceType endpoint = testUtils.getSimpleTestEndpointReference();
View Full Code Here

        BindingType binding = CorbaUtils.getCorbaBindingType(bus, endpoint);
        assertNotNull(binding);
    }
   
    public void testGetCorbaOperationType() throws Exception {
        Bus bus = Bus.init();
       
        // programmatically add the corba binding factory
        BindingManager manager = bus.getBindingManager();
        CorbaBindingFactory corbaBF = new CorbaBindingFactory();
        corbaBF.init(bus);
        manager.registerBinding(CorbaConstants.NU_WSDL_CORBA, corbaBF);
       
        EndpointReferenceType endpoint = testUtils.getSimpleTestEndpointReference();
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.Bus

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.