Package org.osgi.service.discovery

Examples of org.osgi.service.discovery.ServiceEndpointDescription


            }).anyTimes();
        EasyMock.expect(sr.getBundle()).andReturn(b).anyTimes();
        EasyMock.replay(sr);
       
        // Actual test starts here
        ServiceEndpointDescription sd = OsgiUtils.getRemoteReference(sr, true);
        assertEquals("*", sd.getProperties().get("osgi.remote.interfaces"));
       
        EasyMock.verify(sr);
    }
View Full Code Here


public class JaxRSUtilsTest extends TestCase  {

  public void testNoGlobalProviders() {
    Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface", props);
       
        assertEquals(0, JaxRSUtils.getProviders(null, null, sd).size());
  }
View Full Code Here

 
  public void testAegisProvider() {
    Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.RS_DATABINDING_PROP_KEY, "aegis");
        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface", props);
       
        List<Object> providers = JaxRSUtils.getProviders(null, null, sd);
        assertEquals(1, providers.size());
        assertEquals(AegisElementProvider.class.getName(), providers.get(0).getClass().getName());
  }
View Full Code Here

 
  public void testServiceProviders() {
    Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.RS_PROVIDER_PROP_KEY, new Object[]{new AegisElementProvider()});
        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface", props);
       
        List<Object> providers = JaxRSUtils.getProviders(null, null, sd);
        assertEquals(1, providers.size());
        assertEquals(AegisElementProvider.class.getName(), providers.get(0).getClass().getName());
  }
View Full Code Here

        props.put(Constants.RS_PROVIDER_PROP_KEY,
            "\r\n org.apache.cxf.jaxrs.provider.AegisElementProvider , \r\n"
            + "org.apache.cxf.jaxrs.provider.JAXBElementProvider\r\n");
       
        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface", props);
       
        List<Object> providers = JaxRSUtils.getProviders(bc, null, sd);
        assertEquals(2, providers.size());
        assertEquals(AegisElementProvider.class.getName(), providers.get(0).getClass().getName());
        assertEquals(JAXBElementProvider.class.getName(), providers.get(1).getClass().getName());
View Full Code Here

                "\r\n org.apache.cxf.jaxrs.provider.AegisElementProvider",
                "org.apache.cxf.jaxrs.provider.JAXBElementProvider\r\n"
                  });
       
        props.put(Constants.RS_PROVIDER_GLOBAL_PROP_KEY, "false");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface", props);
       
        List<Object> providers = JaxRSUtils.getProviders(bc, null, sd);
        assertEquals(2, providers.size());
        assertEquals(AegisElementProvider.class.getName(), providers.get(0).getClass().getName());
        assertEquals(JAXBElementProvider.class.getName(), providers.get(1).getClass().getName());
View Full Code Here

    EasyMock.expectLastCall().andReturn(false);
    bc.getService(sref);
    AegisElementProvider p = new AegisElementProvider();
    EasyMock.expectLastCall().andReturn(p);
    EasyMock.replay(bc, sref);
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface");
       
        List<Object> providers = JaxRSUtils.getProviders(bc, null, sd);
        assertEquals(1, providers.size());
        assertSame(p, providers.get(0));
  }
View Full Code Here

    AegisElementProvider p = new AegisElementProvider();
    EasyMock.expectLastCall().andReturn(p);
    EasyMock.replay(bc);
    Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.RS_PROVIDER_EXPECTED_PROP_KEY, "true");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface", props);
       
        List<Object> providers = JaxRSUtils.getProviders(bc, null, sd);
        assertEquals(0, providers.size());
  }
View Full Code Here

    AegisElementProvider p = new AegisElementProvider();
    EasyMock.expectLastCall().andReturn(p);
    EasyMock.replay(bc, sref);
    Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.RS_PROVIDER_EXPECTED_PROP_KEY, "true");
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface", props);
       
        List<Object> providers = JaxRSUtils.getProviders(bc, null, sd);
        assertEquals(1, providers.size());
        assertSame(p, providers.get(0));
  }
View Full Code Here

        BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
        EasyMock.replay(bc);
       
        ConfigTypeHandlerFactory f = ConfigTypeHandlerFactory.getInstance();
       
        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface");
        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

TOP

Related Classes of org.osgi.service.discovery.ServiceEndpointDescription

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.