Package org.apache.cxf.dosgi.dsw.service

Examples of org.apache.cxf.dosgi.dsw.service.DistributionProviderImpl$MyTrackerCustomizer


        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.EXPORTED_CONFIGS, Constants.RS_CONFIG_TYPE);
        props.put(Constants.EXPORTED_INTENTS, "SOAP HTTP");
       
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface", props);
        CxfDistributionProvider dp = new DistributionProviderImpl(bc);
        ConfigurationTypeHandler handler = f.getHandler(bc, sd, dp, new HashMap<String, Object>());
        assertTrue(handler instanceof PojoConfigurationTypeHandler);
        assertTrue(!(handler instanceof JaxRSPojoConfigurationTypeHandler));
        assertSame(dp, ((PojoConfigurationTypeHandler) handler).getDistributionProvider());
    }
View Full Code Here


        Map<String, Object> sdProps = new HashMap<String, Object>();
        sdProps.put("osgi.remote.configuration.type", Constants.WS_CONFIG_TYPE);
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
                Collections.singletonList("MyInterface"), sdProps);

        CxfDistributionProvider dp = new DistributionProviderImpl(bc);
        ConfigurationTypeHandler handler = f.getHandler(bc, sd, dp, new HashMap<String, Object>());
        assertTrue(handler instanceof PojoConfigurationTypeHandler);       
        assertSame(dp, ((PojoConfigurationTypeHandler) handler).getDistributionProvider());
    }
View Full Code Here

        // use default for this: sdProps.put(Constants.CONFIG_TYPE_PROPERTY, Constants.POJO_CONFIG_TYPE);
        sdProps.put(Constants.WS_ADDRESS_PROPERTY, "http://localhost:9876/abcd");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
                Collections.singletonList("MyInterface"), sdProps);

        CxfDistributionProvider dp = new DistributionProviderImpl(bc);
        ConfigurationTypeHandler handler = f.getHandler(bc, sd, dp, new HashMap<String, Object>());
        assertTrue(handler instanceof PojoConfigurationTypeHandler);       
        assertSame(dp, ((PojoConfigurationTypeHandler) handler).getDistributionProvider());
    }
View Full Code Here

        sdProps.put("osgi.remote.configuration.type", Constants.WS_CONFIG_TYPE);
        sdProps.put(Constants.WS_HTTP_SERVICE_CONTEXT, "/abc");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
                Collections.singletonList("MyInterface"), sdProps);
       
        CxfDistributionProvider dp = new DistributionProviderImpl(bc);
        ConfigurationTypeHandler handler = f.getHandler(bc, sd, dp, new HashMap<String, Object>());
        assertTrue(handler instanceof HttpServiceConfigurationTypeHandler);
        assertSame(dp, ((HttpServiceConfigurationTypeHandler) handler).getDistributionProvider());               
    }
View Full Code Here

        Map<String, Object> sdProps = new HashMap<String, Object>();
        sdProps.put("osgi.remote.configuration.type", Constants.WSDL_CONFIG_TYPE);
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
                Collections.singletonList("MyInterface"), sdProps);
       
        CxfDistributionProvider dp = new DistributionProviderImpl(bc);
        ConfigurationTypeHandler handler = f.getHandler(bc, sd, dp, new HashMap<String, Object>());
        assertTrue(handler instanceof WsdlConfigurationTypeHandler);       
        assertSame(dp, ((WsdlConfigurationTypeHandler) handler).getDistributionProvider());
    }
View Full Code Here

       
        final ClientProxyFactoryBean cpfb = EasyMock.createNiceMock(ClientProxyFactoryBean.class);
        EasyMock.expect(cpfb.getServiceFactory()).andReturn(sf).anyTimes();
        EasyMock.replay(cpfb);
       
        DistributionProviderImpl dp = new DistributionProviderImpl(bc);
        PojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(bc, dp, handlerProps) {
            @Override
            ClientProxyFactoryBean createClientProxyFactoryBean(String frontend) {
                return cpfb;
            }
           
            @Override
            String[] applyIntents(BundleContext dswContext, BundleContext callingContext,
                List<AbstractFeature> features, AbstractEndpointFactory factory, ServiceEndpointDescription sd) {
                return new String[0];
            }
        };
       
        ServiceReference sr = EasyMock.createNiceMock(ServiceReference.class);
        BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class);
        BundleContext callingContext = EasyMock.createNiceMock(BundleContext.class);
        ServiceEndpointDescription sd = TestUtils.mockServiceDescription("Foo");
        EasyMock.replay(sr);
        EasyMock.replay(dswContext);
        EasyMock.replay(callingContext);
        EasyMock.replay(sd);
       
        assertEquals("Precondition failed", 0, dp.getRemoteServices().size());
        p.createProxy(sr, dswContext, callingContext, CharSequence.class, sd);
        assertEquals(1, dp.getRemoteServices().size());
        assertSame(sr, dp.getRemoteServices().iterator().next());
    }
View Full Code Here

        EasyMock.replay(dswContext);

        String myService = "Hi";               
        final ServerFactoryBean sfb = createMockServerFactoryBean();
       
        DistributionProviderImpl dp = new DistributionProviderImpl(dswContext);
        PojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(dswContext, dp, handlerProps) {
            @Override
            ServerFactoryBean createServerFactoryBean(String frontend) {
                return sfb;
            }

            @Override
            String[] applyIntents(BundleContext dswContext, BundleContext callingContext,
                List<AbstractFeature> features, AbstractEndpointFactory factory, ServiceEndpointDescription sd) {
                return new String []{"A", "B"};
            }
        };
       
        ServiceReference sr = EasyMock.createNiceMock(ServiceReference.class);
        BundleContext callingContext = EasyMock.createNiceMock(BundleContext.class);
        ServiceEndpointDescription sd = TestUtils.mockServiceDescription("Foo");
        EasyMock.replay(sr);
        EasyMock.replay(callingContext);
        EasyMock.replay(sd);
       
        assertEquals("Precondition failed", 0, dp.getExposedServices().size());
        p.createServer(sr, dswContext, callingContext, sd, String.class, myService);
        assertEquals(1, dp.getExposedServices().size());
        assertSame(sr, dp.getExposedServices().iterator().next());
       
        Map<String, String> expected = new HashMap<String, String>();
        expected.put("service.exported.configs", "org.apache.cxf.ws");
        expected.put("org.apache.cxf.ws.address", "http://somehost:54321/java/lang/String");
        expected.put("service.intents", "A B");
        assertEquals(expected, dp.getExposedProperties(sr));
    }
View Full Code Here

        EasyMock.replay(dswContext);

        String myService = "Hi";               
        final ServerFactoryBean sfb = createMockServerFactoryBean();
       
        DistributionProviderImpl dp = new DistributionProviderImpl(dswContext);
        PojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(dswContext, dp, handlerProps) {
            @Override
            ServerFactoryBean createServerFactoryBean(String frontend) {
                return sfb;
            }

            @Override
            String[] applyIntents(BundleContext dswContext, BundleContext callingContext,
                List<AbstractFeature> features, AbstractEndpointFactory factory, ServiceEndpointDescription sd) {
                return new String []{};
            }
        };
       
        ServiceReference sr = EasyMock.createNiceMock(ServiceReference.class);
        BundleContext callingContext = EasyMock.createNiceMock(BundleContext.class);
        EasyMock.replay(sr);
        EasyMock.replay(callingContext);
       
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.WS_ADDRESS_PROPERTY, "http://alternate_host:80/myString");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Runnable.class.getName(), props);
       
        assertEquals("Precondition failed", 0, dp.getExposedServices().size());
        p.createServer(sr, dswContext, callingContext, sd, String.class, myService);
        assertEquals(1, dp.getExposedServices().size());
        assertSame(sr, dp.getExposedServices().iterator().next());
       
        Map<String, String> expected = new HashMap<String, String>();
        expected.put("service.exported.configs", "org.apache.cxf.ws");
        expected.put("org.apache.cxf.ws.address", "http://alternate_host:80/myString");
        assertEquals(expected, dp.getExposedProperties(sr));
    }   
View Full Code Here

        BundleContext callingContext = control.createMock(BundleContext.class);       
        List<AbstractFeature> features = new ArrayList<AbstractFeature>();
        AbstractEndpointFactory factory = control.createMock(AbstractEndpointFactory.class);
        control.replay();

        DistributionProviderImpl dp = new DistributionProviderImpl(dswContext);
        AbstractPojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(dswContext, dp, handlerProps) {
            @Override
            IntentMap getIntentMap(BundleContext callingContext) {
                return intentMap;
            }
View Full Code Here

        BundleContext callingContext = control.createMock(BundleContext.class);       
        List<AbstractFeature> features = new ArrayList<AbstractFeature>();
        AbstractEndpointFactory factory = control.createMock(AbstractEndpointFactory.class);
        control.replay();

        DistributionProviderImpl dp = new DistributionProviderImpl(dswContext);
        PojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(dswContext, dp, handlerProps) {
            @Override
            IntentMap getIntentMap(BundleContext callingContext) {
                return intentMap;
            }           
View Full Code Here

TOP

Related Classes of org.apache.cxf.dosgi.dsw.service.DistributionProviderImpl$MyTrackerCustomizer

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.