Ejemplo n.º 1
0
  @Test
  public void testGetSetEnabled() {
    // combines set and get tests. These are important in this instance,
    // because getEnabled allows an optional callback Filter.
    ServiceProxy.getInstance().setEnabled(true);
    assertTrue(ServiceProxy.getInstance().getEnabled(null));

    AAAFilter testFilter = new AAAFilter();
    // register the filter
    ServiceProxy.getInstance().getEnabled(testFilter);
    assertTrue(testFilter.isEnabled());

    ServiceProxy.getInstance().setEnabled(false);
    assertFalse(ServiceProxy.getInstance().getEnabled(testFilter));
    assertFalse(testFilter.isEnabled());
  }
Ejemplo n.º 2
0
 @Test
 public void testGetInstance() {
   // ensures that singleton pattern is working
   assertNotNull(ServiceProxy.getInstance());
 }