Examples of findEntries()


Examples of org.osgi.framework.Bundle.findEntries()

           
            // Set up some mock objects
            IMocksControl control = EasyMock.createNiceControl();
            Bundle b0 = control.createMock(Bundle.class);
            EasyMock.expect(b0.getState()).andReturn(Bundle.ACTIVE).anyTimes();
            EasyMock.expect(b0.findEntries("OSGI-INF/remote-service", "*.xml", false)).
                    andReturn(rsAEnum).anyTimes();
           
            BundleContext bc = control.createMock(BundleContext.class);
            EasyMock.expect(bc.getBundles()).andReturn(new Bundle[] {b0}).anyTimes();
   
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

           
            // Set up some mock objects
            IMocksControl control = EasyMock.createNiceControl();
            Bundle b0 = control.createMock(Bundle.class);
            EasyMock.expect(b0.getState()).andReturn(Bundle.INSTALLED).anyTimes();
            EasyMock.expect(b0.findEntries("OSGI-INF/remote-service", "*.xml", false)).
                    andReturn(rsAEnum).anyTimes();
   
            Bundle b1 = control.createMock(Bundle.class);
            EasyMock.expect(b1.getState()).andReturn(Bundle.ACTIVE).anyTimes();
            EasyMock.expect(b1.findEntries("OSGI-INF/remote-service", "*.xml", false)).
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

            EasyMock.expect(b0.findEntries("OSGI-INF/remote-service", "*.xml", false)).
                    andReturn(rsAEnum).anyTimes();
   
            Bundle b1 = control.createMock(Bundle.class);
            EasyMock.expect(b1.getState()).andReturn(Bundle.ACTIVE).anyTimes();
            EasyMock.expect(b1.findEntries("OSGI-INF/remote-service", "*.xml", false)).
                    andReturn(rsBEnum).anyTimes();
           
            BundleContext bc = control.createMock(BundleContext.class);
            ServiceReference sr = control.createMock(ServiceReference.class);
            TestDiscoveredServiceTracker dst = new TestDiscoveredServiceTracker();
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

   
    public void testRemoteServicesXMLFiles() {
        URL rs1URL = getClass().getResource("/rs1.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries(
            EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(rs1URL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

    public void testMultiRemoteServicesXMLFiles() {
        URL rs1URL = getClass().getResource("/rs1.xml");
        URL rs2URL = getClass().getResource("/rs2.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries(
            EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(rs1URL, rs2URL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

        headers.put("Remote-Service", "META-INF/osgi");
        headers.put("Bundle-Name", "testing bundle");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.getHeaders()).andReturn(headers).anyTimes();
        EasyMock.expect(b.findEntries(
            EasyMock.eq("META-INF/osgi"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(rs1URL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

   
    public void testAllRemoteReferences() {
        URL rs1URL = getClass().getResource("/rs1.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries("OSGI-INF/remote-service", "*.xml", false)).
                andReturn(Collections.enumeration(Arrays.asList(rs1URL)));
        EasyMock.replay(b);
       
        List<ServiceEndpointDescription> seds = LocalDiscoveryUtils.getAllRemoteReferences(b);
        assertEquals(2, seds.size());
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

    private void doTestPublishHook(String remoteServices,
                                   String[] serviceNames,
                                   String[] addresses) throws Exception {
       
        Bundle bundle = control.createMock(Bundle.class);
        bundle.findEntries(EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean());
        EasyMock.expectLastCall().andReturn(Collections.enumeration(
            Arrays.asList(getClass().getResource("/OSGI-INF/remote-service/" + remoteServices))));
        Dictionary<String, String> bundleHeaders = new Hashtable<String, String>();
        bundleHeaders.put(org.osgi.framework.Constants.BUNDLE_NAME,
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

   
    @SuppressWarnings("unchecked")
    @Test
    public void testPublishMultipleTimes() {
        Bundle bundle = control.createMock(Bundle.class);
        bundle.findEntries(EasyMock.eq("OSGI-INF/remote-service"),
                EasyMock.eq("*.xml"), EasyMock.anyBoolean());
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                return Collections.enumeration(Arrays.asList(
                    getClass().getResource("/OSGI-INF/remote-service/remote-services.xml")));
View Full Code Here

Examples of org.osgi.framework.Bundle.findEntries()

   
    public void testRemoteServicesXMLFiles() {
        URL rs1URL = getClass().getResource("/test-resources/rs1.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries(
            EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(rs1URL))).anyTimes();
        EasyMock.replay(b);
       
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.