Examples of ServiceEndpointDescription


Examples of org.osgi.service.discovery.ServiceEndpointDescription

        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

Examples of org.osgi.service.discovery.ServiceEndpointDescription

    public void doTestGetPublishableInterfaces(Object requested,
                                               String[] actual,
                                               String[] expected)
        throws Exception {
        ServiceEndpointDescription sd =
            EasyMock.createMock(ServiceEndpointDescription.class);
        ServiceReference sref = EasyMock.createMock(ServiceReference.class);
        EasyMock.expect(sd.getProperty("osgi.remote.interfaces")).andReturn(requested);
        EasyMock.expect(sref.getProperty(org.osgi.framework.Constants.OBJECTCLASS)).andReturn(actual);
        EasyMock.replay(sd);
        EasyMock.replay(sref);
       
        String[] ret = OsgiUtils.getPublishableInterfaces(sd, sref);
View Full Code Here

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

Examples of org.osgi.service.discovery.ServiceEndpointDescription

        };
       
        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);
       
View Full Code Here

Examples of org.osgi.service.discovery.ServiceEndpointDescription

            }
        };
       
        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());
View Full Code Here

Examples of org.osgi.service.discovery.ServiceEndpointDescription

        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());
View Full Code Here

Examples of org.osgi.service.discovery.ServiceEndpointDescription

            }       
        };
       
        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

Examples of org.osgi.service.discovery.ServiceEndpointDescription

            }       
        };
       
        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

Examples of org.osgi.service.discovery.ServiceEndpointDescription

            }           
        };

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

        try {
            p.applyIntents(dswContext, callingContext, features, factory, sd);
            fail("applyIntents() should have thrown an exception as there was an unsatisfiable intent");
View Full Code Here

Examples of org.osgi.service.discovery.ServiceEndpointDescription

            }       
        };
       
        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(3, effectiveIntents.size());
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.