Package rabbit.tracking.internal

Examples of rabbit.tracking.internal.TrackingPlugin


    ITracker<Object> tracker = TestUtil.newTracker();
    tracker.getData().add(new Object());
    tracker.getData().add(new Object());
    assertFalse(tracker.getData().isEmpty());

    TrackingPlugin rc = new TrackingPlugin();
    rc.start(plugin.getBundle().getBundleContext());
   
    Field field = TrackingPlugin.class.getDeclaredField("trackers");
    field.setAccessible(true);
    field.set(rc, ImmutableSet.<ITracker<?>> of(tracker));
   
    rc.saveCurrentData();
    assertTrue(tracker.getData().isEmpty());
    rc.stop(rc.getBundle().getBundleContext());
  }
View Full Code Here


    }
  }

  @Test
  public void testStart() throws Exception {
    TrackingPlugin rc = new TrackingPlugin();
    rc.start(plugin.getBundle().getBundleContext());
    // It's already started by now.
    assertTrue(rc.getIdleDetector().isRunning());
    // Errors or may have loaded the wrong extension point:
    assertFalse(getTrackers(rc).isEmpty());

    for (ITracker<?> t : getTrackers(rc)) {
      assertTrue(t.toString(), t.isEnabled());
    }
    rc.stop(rc.getBundle().getBundleContext());
  }
View Full Code Here

  /**
   * Place this test at end of all tests.
   */
  @Test
  public void testStop() throws Exception {
    TrackingPlugin rc = new TrackingPlugin();
    rc.start(plugin.getBundle().getBundleContext());
    for (ITracker<?> o : getTrackers(rc)) {
      assertTrue(o.isEnabled());
    }

    rc.stop(rc.getBundle().getBundleContext());
    for (ITracker<?> o : getTrackers(rc)) {
      assertFalse(o.isEnabled());
    }
    assertFalse(rc.getIdleDetector().isRunning());
  }
View Full Code Here

TOP

Related Classes of rabbit.tracking.internal.TrackingPlugin

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.