Example #1
0
  public void testJMXBundleDeployer() throws Exception {
    JMXBundleDeployer jmxBundleDeployer = new JMXBundleDeployer();

    long bundleId =
        jmxBundleDeployer.deploy(
            "biz.aQute.remote.agent", IO.getFile("generated/biz.aQute.remote.agent.jar"));

    assertTrue(bundleId > 0);

    BundleDTO agentBundle = null;
    long state = -1;

    for (BundleDTO bundle : jmxBundleDeployer.listBundles()) {
      if (bundle.symbolicName.equals("biz.aQute.remote.agent")) {
        agentBundle = bundle;
        state = bundle.state;
      }
    }

    assertNotNull(agentBundle);
    assertEquals(Bundle.ACTIVE, state);
  }