Package org.osgi.framework

Examples of org.osgi.framework.BundleEvent


        loadProperties();
        // Scan bundles
        for (Bundle bundle : bundleContext.getBundles()) {
            if (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.STARTING
                    || bundle.getState() == Bundle.ACTIVE)
            bundleChanged(new BundleEvent(BundleEvent.RESOLVED, bundle));
        }
    }
View Full Code Here


    Dictionary hdrs = new Hashtable();
    hdrs.put(ConfigUtils.SPRING_CONTEXT_HEADER, "bla bla");
    MockBundle anotherBundle = new MockBundle(hdrs);
    anotherBundle.setBundleId(1);

    BundleEvent event = new BundleEvent(BundleEvent.STARTED, anotherBundle);

    BundleListener listener = (BundleListener) ctx.getBundleListeners().iterator().next();

    TestTaskExecutor.called = false;
View Full Code Here

    OsgiStringUtilsTest.state = -123;
    assertEquals("UNKNOWN STATE", OsgiStringUtils.bundleStateAsString(bundle));
  }

  public void testNullSafeToStringBundleEvent() throws Exception {
    assertEquals("INSTALLED", OsgiStringUtils.nullSafeToString(new BundleEvent(BundleEvent.INSTALLED, bundle)));
    assertEquals("UPDATED", OsgiStringUtils.nullSafeToString(new BundleEvent(BundleEvent.UPDATED, bundle)));
    assertEquals("STOPPING", OsgiStringUtils.nullSafeToString(new BundleEvent(BundleEvent.STOPPING, bundle)));
  }
View Full Code Here

  public void testNullSafeToStringBundleEventNull() throws Exception {
    assertNotNull(OsgiStringUtils.nullSafeToString((BundleEvent) null));
  }

  public void testNullSafeToStringBundleEventInvalidType() throws Exception {
    assertEquals("UNKNOWN EVENT TYPE", OsgiStringUtils.nullSafeToString(new BundleEvent(-123, bundle)));
  }
View Full Code Here

      expectLastCall().times(1);
      providerListener.added(anyObject(JcloudsTestYetAnotherComputeProviderMetadata.class));
      expectLastCall().times(1);
      replay(bundle, providerListener);

      BundleEvent event = new BundleEvent(BundleEvent.STARTED, bundle);
      listener.bundleChanged(event);
      verify(bundle, providerListener);
   }
View Full Code Here

      expectLastCall().times(1);
      apiListener.added(anyObject(JcloudsTestComputeApiMetadata.class));
      expectLastCall().times(1);
      replay(bundle, apiListener);

      BundleEvent event = new BundleEvent(BundleEvent.STARTED, bundle);
      listener.bundleChanged(event);
      verify(bundle, apiListener);
   }
View Full Code Here

TOP

Related Classes of org.osgi.framework.BundleEvent

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.