Package org.objectweb.celtix.configuration

Examples of org.objectweb.celtix.configuration.Configuration


    public void testCustomEditorRegistration() {
       
        URL url = CeltixXmlBeanFactoryTest.class.getResource("resources/top2.xml");
        UrlResource urlRes = new UrlResource(url);
        CeltixXmlBeanFactory bf = new CeltixXmlBeanFactory(urlRes);
        Configuration top = new TopConfigurationBuilder().build("top22");
       
        Map map = bf.getCustomEditors();
       
        // no editor for complex types registered yet
       
View Full Code Here


        assertEquals(n, bn.getName());
        assertEquals(nn, bn.getNormalisedName());
    }
   
    public void testConstruction() {        
        Configuration bottom = EasyMock.createMock(Configuration.class);
        Configuration middle = EasyMock.createMock(Configuration.class);
        Configuration top = EasyMock.createMock(Configuration.class);
       
        bottom.getId();
        EasyMock.expectLastCall().andReturn("a");
        bottom.getParent();
        EasyMock.expectLastCall().andReturn(middle);
        middle.getId();
        EasyMock.expectLastCall().andReturn("b");
        middle.getParent();
        EasyMock.expectLastCall().andReturn(top);
        top.getId();
        EasyMock.expectLastCall().andReturn("c");
        top.getParent();
        EasyMock.expectLastCall().andReturn(null);
      
        EasyMock.replay(top);
        EasyMock.replay(middle);
        EasyMock.replay(bottom);
View Full Code Here

        HandlerChainType chain = factory.createHandlerChainType();
        List<HandlerType> handlers = chain.getHandler();
        handlers.add(h1);
        handlers.add(h2);

        Configuration busConfiguration = createMock(Configuration.class);
        QName service = new QName("http://objectweb.org/hello_world_soap_http", "SOAP_Service");
        HandlerResolverImpl res = new HandlerResolverImpl(busConfiguration, service);
        Configuration portConf = createMock(Configuration.class);
        String id = service.toString() + "/" + portInfo.getPortName().getLocalPart();
        busConfiguration.getChild(HandlerResolverImpl.PORT_CONFIGURATION_URI, id);
        expectLastCall().andReturn(portConf);
        portConf.getObject("handlerChain");
        expectLastCall().andReturn(chain);
        replay(busConfiguration);
        replay(portConf);

        List<Handler> handlerChain = res.getHandlerChain(portInfo);
View Full Code Here

        HandlerChainType chain = factory.createHandlerChainType();
        List<HandlerType> handlers = chain.getHandler();
        handlers.add(h3);

        Configuration busConfiguration = createMock(Configuration.class);
        QName service = new QName("http://objectweb.org/hello_world_soap_http", "SOAP_Service");
        HandlerResolverImpl res = new HandlerResolverImpl(busConfiguration, service);
        Configuration portConf = createMock(Configuration.class);
        String id = service.toString() + "/" + portInfo.getPortName().getLocalPart();
        busConfiguration.getChild(HandlerResolverImpl.PORT_CONFIGURATION_URI, id);
        expectLastCall().andReturn(portConf);
        portConf.getObject("handlerChain");
        expectLastCall().andReturn(chain);
        replay(busConfiguration);
        replay(portConf);

        try {
View Full Code Here

   
    public void testConfigureSystemHandlers() {
        IMocksControl control = EasyMock.createControl();
        TestBinding b = new TestBinding();
        SystemHandlerChainType shc = null;
        Configuration c = control.createMock(Configuration.class);
        expect(c.getObject("systemHandlerChain")).andReturn(shc);
        control.replay();
       
        b.configureSystemHandlers(c);
        assertEquals(0, b.getPreLogicalSystemHandlers().size());
        assertEquals(0, b.getPostLogicalSystemHandlers().size());
        assertEquals(0, b.getPreProtocolSystemHandlers().size());
        assertEquals(0, b.getPreProtocolSystemHandlers().size());
       
        control.verify();
        control.reset();
       
        shc = new ObjectFactory().createSystemHandlerChainType();
        c = control.createMock(Configuration.class);
        expect(c.getObject("systemHandlerChain")).andReturn(shc);
        control.replay();
       
        b.configureSystemHandlers(c);
        assertEquals(0, b.getPreLogicalSystemHandlers().size());
        assertEquals(0, b.getPostLogicalSystemHandlers().size());
        assertEquals(0, b.getPreProtocolSystemHandlers().size());
        assertEquals(0, b.getPreProtocolSystemHandlers().size());
       
        control.verify();
        control.reset();
       
        shc = createSystemHandlerChain();
        c = control.createMock(Configuration.class);
        expect(c.getObject("systemHandlerChain")).andReturn(shc);
        control.replay();
       
        b.configureSystemHandlers(c);
        assertEquals(2, b.getPreLogicalSystemHandlers().size());
        assertEquals(1, b.getPostLogicalSystemHandlers().size());
View Full Code Here

        HandlerChainType chain = factory.createHandlerChainType();
        List<HandlerType> handlers = chain.getHandler();
        handlers.add(h5);

        Configuration busConfiguration = createMock(Configuration.class);
        QName service = new QName("http://objectweb.org/hello_world_soap_http", "SOAP_Service");
        HandlerResolverImpl res = new HandlerResolverImpl(busConfiguration, service);
        Configuration portConf = createMock(Configuration.class);
        String id = service.toString() + "/" + portInfo.getPortName().getLocalPart();
        busConfiguration.getChild(HandlerResolverImpl.PORT_CONFIGURATION_URI, id);
        expectLastCall().andReturn(portConf);
        portConf.getObject("handlerChain");
        expectLastCall().andReturn(chain);
        replay(busConfiguration);
        replay(portConf);

        try {
View Full Code Here

   
    public void testInjectSystemHandlers() {
        IMocksControl control = EasyMock.createControl();
        TestBinding b = new TestBinding();
        SystemHandlerChainType shc = createSystemHandlerChain();
        Configuration c = control.createMock(Configuration.class);
        expect(c.getObject("systemHandlerChain")).andReturn(shc);
        ResourceInjector ri = control.createMock(ResourceInjector.class);
        ri.inject(EasyMock.isA(SystemHandler.class));
        EasyMock.expectLastCall().times(6);
        control.replay();
       
View Full Code Here

    }
   
    public void testGetAddress() throws Exception {
        EndpointReferenceType ref = utils.getEndpointReference();
        assertNotNull(ref);
        Configuration portConfiguration =
            createPortConfiguration(new QName("http://objectweb.org/xml_http_bare",
                                                                            "XMLPort"),
                                                                  ref);
        assertNotNull(portConfiguration);
        String address = portConfiguration.getString("address");
        assertNotNull(address);
        assertEquals("http://localhost:9090/XMLService/XMLPort", address);
    }
View Full Code Here

        assertEquals("http://localhost:9090/XMLService/XMLPort", address);
    }

    private Configuration createPortConfiguration(QName portName,
                                                  EndpointReferenceType ref) throws Exception {
        Configuration portCfg = null;
        String id = portName.getLocalPart();
        ConfigurationBuilder cb = ConfigurationBuilderFactory.getBuilder(null);
        portCfg = cb.buildConfiguration(PORT_CONFIGURATION_URI, id, bus.getConfiguration());
       
        Port port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), ref);
        assertNotNull(port);
        portCfg.getProviders().add(new WsdlPortProvider(port));
        return portCfg;
    }
View Full Code Here

    private void createNecessaryConfig(URL wsdlUrl, QName serviceName,
                                       String portName) throws Exception {
        assert bus != null;
        EndpointReferenceType ref = EndpointReferenceUtils.getEndpointReference(wsdlUrl, serviceName,
                                                                             portName);
        Configuration busCfg = bus.getConfiguration();
        assert null != busCfg;
        Configuration endpointCfg = null;
        Configuration portCfg = null;

        String id = EndpointReferenceUtils.getServiceName(ref).toString();
        ConfigurationBuilder cb = ConfigurationBuilderFactory.getBuilder(null);

        // Server Endpoint Config
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.configuration.Configuration

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.