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

Examples of org.apache.cxf.dosgi.dsw.service.ServiceEndpointDescriptionImpl


       
        ConfigTypeHandlerFactory f = ConfigTypeHandlerFactory.getInstance();
       
        Map<String, Object> sdProps = new HashMap<String, Object>();
        sdProps.put("osgi.remote.configuration.type", "foobar");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
                Collections.singletonList("MyInterface"), sdProps);
       
        assertNull("Should not get a handler as this an unsupported config type",
                f.getHandler(bc, sd, null, new HashMap<String, Object>()));       
    }
View Full Code Here


       
        Server srvr = control.createMock(Server.class);
        ServiceReference serviceReference = control.createMock(ServiceReference.class);
        BundleContext dswContext = control.createMock(BundleContext.class);
        BundleContext callingContext = control.createMock(BundleContext.class);
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("java.lang.String");
        Object service = "hi";

        ConfigurationTypeHandler handler = control.createMock(ConfigurationTypeHandler.class);
        handler.createServer(serviceReference, dswContext, callingContext, sd, String.class, service);
        EasyMock.expectLastCall().andReturn(srvr);
View Full Code Here

   
    public void testPublish() throws Exception {       
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("foo", "bar");
        props.put(ServicePublication.ENDPOINT_LOCATION, "http://localhost/xyz");
        ServiceEndpointDescriptionImpl sed = new ServiceEndpointDescriptionImpl(String.class.getName(), props);
        assertEquals(new URI("http://localhost/xyz"), sed.getLocation());
       
        final Dictionary<String, Object> expectedProps = new Hashtable<String, Object>();
        expectedProps.put(ServicePublication.SERVICE_PROPERTIES, props);
        expectedProps.put(ServicePublication.SERVICE_INTERFACE_NAME, Collections.singleton(String.class.getName()));
        expectedProps.put(ServicePublication.ENDPOINT_LOCATION, new URI("http://localhost/xyz"));
View Full Code Here

                     Collection interfaces,
                     Collection filters,
                     Map<String, Object> props) {
            this.type = type;
            this.sed =
                new ServiceEndpointDescriptionImpl(interfaceName, props);
            this.interfaces = interfaces;
            this.filters = filters;
        }
View Full Code Here

        EasyMock.replay(sr);
        EasyMock.replay(callingContext);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.POJO_HTTP_SERVICE_CONTEXT, "/myRunnable");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Runnable.class.getName(), props);
       
        assertEquals("Precondition failed", 0, dp.getExposedServices().size());
        assertEquals("Precondition failed", "", sfb.getAddress());
        h.createServer(sr, dswContext, callingContext, sd, Runnable.class, myService);
        assertEquals("The address should be set to '/'. The Servlet context dictates the actual location.", "/", sfb.getAddress());
View Full Code Here

        BundleContext callingContext = EasyMock.createNiceMock(BundleContext.class);
        EasyMock.replay(sr);
        EasyMock.replay(callingContext);

        Map<String, Object> props = new HashMap<String, Object>();
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Runnable.class.getName(), props);
       
        assertEquals("Precondition failed", 0, dp.getExposedServices().size());
        h.createServer(sr, dswContext, callingContext, sd, Runnable.class, myService);
        assertEquals(1, dp.getExposedServices().size());
        assertSame(sr, dp.getExposedServices().iterator().next());
View Full Code Here

        EasyMock.replay(callingContext);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put("osgi.remote.configuration.type", Constants.POJO_CONFIG_TYPE);
        props.put(Constants.POJO_HTTP_SERVICE_CONTEXT, "/myRunnable");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Runnable.class.getName(), props);
       
        assertEquals("Precondition failed", 0, dp.getExposedServices().size());
        h.createServer(sr, dswContext, callingContext, sd, Runnable.class, myService);
        assertEquals(1, dp.getExposedServices().size());
        assertSame(sr, dp.getExposedServices().iterator().next());
View Full Code Here

        EasyMock.replay(sr);
        EasyMock.replay(callingContext);
       
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.POJO_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());
View Full Code Here

            }       
        };
       
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("osgi.remote.requires.intents", "A");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);

        List<String> effectiveIntents =
            Arrays.asList(p.applyIntents(dswContext, callingContext, features, factory, sd));
        assertEquals(Arrays.asList("A"), effectiveIntents);
    }   
View Full Code Here

            }       
        };
       
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("osgi.remote.requires.intents", "transactionality confidentiality.message");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);

        List<String> effectiveIntents =
            Arrays.asList(p.applyIntents(dswContext, callingContext, features, factory, sd));
        assertTrue(effectiveIntents.contains("transactionality"));       
        assertTrue(effectiveIntents.contains("confidentiality.message"));       
View Full Code Here

TOP

Related Classes of org.apache.cxf.dosgi.dsw.service.ServiceEndpointDescriptionImpl

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.