Examples of Bus


Examples of org.objectweb.celtix.Bus

    public void testPlugableTransportFactoryManager() throws Exception {
        TransportFactoryManagerImpl transportFactoryManagerImpl = createTransportFactory();
        Map<String, Object> properties = new WeakHashMap<String, Object>();
        properties.put("celtix.TRANSPORTFACTORYMANAGER", transportFactoryManagerImpl);
        Bus bus = Bus.init(new String[0], properties);

        TransportFactoryManager transportFactoryManagerImplNew = bus.getTransportFactoryManager();

        //Verify that the TransportFactoryManager is the one we plugged into bus previously,
        //other than the one created inside Bus
        assertEquals("wsdlManager is the one we expected", transportFactoryManagerImpl,
            transportFactoryManagerImplNew);
View Full Code Here

Examples of org.objectweb.celtix.Bus

        assertEquals("wsdlManager is the one we expected", transportFactoryManagerImpl,
            transportFactoryManagerImplNew);
    }

    private TransportFactoryManagerImpl createTransportFactory() throws BusException {
        Bus bus = EasyMock.createMock(Bus.class);
        Configuration bc = EasyMock.createMock(Configuration.class);

        ObjectFactory of = new ObjectFactory();
        ClassNamespaceMappingListType mappings = of.createClassNamespaceMappingListType();
        bus.getConfiguration();
        EasyMock.expectLastCall().andReturn(bc);
        bc.getObject("transportFactories");
        EasyMock.expectLastCall().andReturn(mappings);
        EasyMock.replay(bus);
        EasyMock.replay(bc);
View Full Code Here

Examples of org.objectweb.celtix.Bus

public class ServiceImplTest extends TestCase {

    public void testHandlerResolverAttribute() {
        QName sn = new QName("http://objectweb.org/hello_world_soap_http", "Greeter");
        Bus bus = org.easymock.classextension.EasyMock.createMock(CeltixBus.class);
        Configuration bc = EasyMock.createMock(Configuration.class);
        bus.getConfiguration();
        org.easymock.classextension.EasyMock.expectLastCall().andReturn(bc);
        bc.getChild(ServiceImpl.PORT_CONFIGURATION_URI, sn.toString());
        EasyMock.expectLastCall().andReturn(null);
        WorkQueueManager wm = EasyMock.createMock(WorkQueueManager.class);
        bus.getWorkQueueManager();
        EasyMock.expectLastCall().andReturn(wm);
        wm.getAutomaticWorkQueue();
        EasyMock.expectLastCall().andReturn(null);

        org.easymock.classextension.EasyMock.replay(bus);
View Full Code Here

Examples of org.objectweb.celtix.Bus

    }


    public void testCtorWithBus() throws Exception {
       
        Bus bus = EasyMock.createMock(Bus.class);
        Configuration conf = EasyMock.createMock(Configuration.class);
       
        StringListType resolverList = new StringListType();
        resolverList.getItem().add(ClassLoaderResolver.class.getName());
        resolverList.getItem().add(ClasspathResolver.class.getName());

        new ClassLoaderResolver();

        bus.getConfiguration();
        EasyMock.expectLastCall().andReturn(conf);
        conf.getObject("resourceResolvers");
        EasyMock.expectLastCall().andReturn(resolverList);

        EasyMock.replay(bus);
View Full Code Here

Examples of org.objectweb.celtix.Bus

    /*
     * Test method for 'javax.xml.ws.Service.getPorts()'
     */
    public void testGetPorts() throws Exception {
        Bus bus = Bus.init();
        QName endpoint = new QName("http://objectweb.org/hello_world_soap_http",
                                   "SoapPort");
       
        try {
            SOAPService hwService = new SOAPService();
            assertNotNull(hwService);
            Iterator iter = hwService.getPorts();
            assertFalse("Should have no element", iter.hasNext());

            Greeter port = hwService.getSoapPort();
            assertNotNull(port);
            assertTrue("Should be a proxy class. "
                        + port.getClass().getName(),
                        Proxy.isProxyClass(port.getClass()));
           
            iter = hwService.getPorts();
            assertTrue("Should have one element", iter.hasNext());           
            assertEquals("Activated EndPoints are not the same", endpoint, iter.next());           
        } finally {
            bus.shutdown(true);
        }
    }
View Full Code Here

Examples of org.objectweb.celtix.Bus

    }
   
    public String registerCallback(EndpointReferenceType callback) {
       
        try {
            Bus bus = Bus.init();
            WSDLManager manager = new WSDLManagerImpl(bus);
       
            QName interfaceName = EndpointReferenceUtils.getInterfaceName(callback);
            String wsdlLocation = EndpointReferenceUtils.getWSDLLocation(callback);
            QName serviceName = EndpointReferenceUtils.getServiceName(callback);

           
            String portString = EndpointReferenceUtils.getPortName(callback);
           
            QName portName = new QName(serviceName.getNamespaceURI(), portString);
           
            StringBuffer seiName = new StringBuffer();
            seiName.append(JAXBUtils.namespaceURIToPackage(interfaceName.getNamespaceURI()));
            seiName.append(".");
            seiName.append(JAXBUtils.nameToIdentifier(interfaceName.getLocalPart(),
                                                      JAXBUtils.IdentifierType.INTERFACE));
           
            Class<?> sei = null;   
            try {
                sei = Class.forName(seiName.toString(),
                                    true, manager.getClass().getClassLoader());
            } catch (ClassNotFoundException ex) {
                ex.printStackTrace();
            }
           
            URL wsdlURL = (new File(wsdlLocation)).toURL();            
           
            Service service = Service.create(wsdlURL, serviceName);
            CallbackPortType port =  (CallbackPortType)service.getPort(portName, sei);

            port.serverSayHi("Sean");
 
            bus.shutdown(true);
           
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
View Full Code Here

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

Examples of org.objectweb.celtix.Bus

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

Examples of org.objectweb.celtix.Bus

        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

Examples of org.objectweb.celtix.Bus

       
        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
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.