Package org.osgi.framework

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


    public void testMultiRemoteServicesXMLFiles() {
        URL rs1URL = getClass().getResource("/test-resources/rs1.xml");
        URL rs2URL = getClass().getResource("/test-resources/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

        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

    else {
      try {
        extendedClasspath.add(d.pluginIdToJarPath(RutaIdePlugin.PLUGIN_ID) + "target/classes");
        Bundle bundle = RutaIdePlugin.getDefault().getBundle("org.apache.uima.runtime");
        if (bundle != null) {
          Enumeration<?> jarEnum = bundle.findEntries("/", "*.jar", true);
          if (jarEnum == null) {
            extendedClasspath.add(d.pluginIdToJarPath("org.apache.uima.runtime"));
          }
          while (jarEnum != null && jarEnum.hasMoreElements()) {
            URL element = (URL) jarEnum.nextElement();
View Full Code Here

          }
        }

        Bundle bundle2 = RutaIdePlugin.getDefault().getBundle("org.apache.uima.ruta.engine");
        if (bundle2 != null) {
          Enumeration<?> jarEnum = bundle2.findEntries("/", "*.jar", true);
          while (jarEnum != null && jarEnum.hasMoreElements()) {
            URL element = (URL) jarEnum.nextElement();
            extendedClasspath.add(FileLocator.toFileURL(element).getFile());
          }
        }
View Full Code Here

       
        // 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);
        ServiceReference sr = control.createMock(ServiceReference.class);
        TestDiscoveredServiceTracker dst = new TestDiscoveredServiceTracker();
View Full Code Here

       
        // add a new bundle that also contains a someservice
        // we should get notified again...
        Bundle b1 = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b1.getState()).andReturn(Bundle.ACTIVE).anyTimes();
        EasyMock.expect(b1.findEntries("OSGI-INF/remote-service", "*.xml", false)).
                andReturn(rsBEnum).anyTimes();
        EasyMock.replay(b1);

        // Call back on the LDS just like what would have happened with the BundleListener
        BundleEvent be = new BundleEvent(BundleEvent.STARTED, b1);
View Full Code Here

                new ArrayList<DiscoveredServiceNotification>(dst.notifications);
       
        // add an unrelated bundle - no notification...
        Bundle b2 = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b2.getState()).andReturn(Bundle.ACTIVE).anyTimes();
        EasyMock.expect(b2.findEntries("OSGI-INF/remote-service", "*.xml", false)).
                andReturn(rsCEnum).anyTimes();
        EasyMock.replay(b2);
       
        BundleEvent be2 = new BundleEvent(BundleEvent.STARTED, b1);
        lds.bundleChanged(be2);
View Full Code Here

           
            // 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);
            Filter mockFilter = control.createMock(Filter.class);
            ServiceReference sr = control.createMock(ServiceReference.class);
View Full Code Here

           
            // add a new bundle that also contains a someservice
            // we should get notified again...
            Bundle b1 = EasyMock.createNiceMock(Bundle.class);
            EasyMock.expect(b1.getState()).andReturn(Bundle.ACTIVE).anyTimes();
            EasyMock.expect(b1.findEntries("OSGI-INF/remote-service", "*.xml", false)).
                    andReturn(rsBEnum).anyTimes();
            EasyMock.replay(b1);
   
            // Call back on the LDS just like what would have happened with the BundleListener
            BundleEvent be = new BundleEvent(BundleEvent.STARTED, b1);
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.