Esempio n. 1
0
  @Test
  public void testRegisterUnregister() {
    assertEquals(0, registry.size());

    // register
    registry.register("foo", object);

    assertEquals(1, registry.size());

    assertEquals(object, registry.getObjectByName("foo"));
    assertTrue(registry.isRegistered(object));
    assertTrue(registry.isRegistered("foo"));

    registry.unregister("foo");

    assertEquals(0, registry.size());
  }
Esempio n. 2
0
  @Test
  public void testRegistrationBehaviors() {
    assertEquals(0, registry.size());

    // register
    registry.register("foo", object);

    assertEquals(1, registry.size());

    assertTrue(registry.isRegistered(object));
    assertTrue(registry.isRegistered("foo"));

    // register again
    registry.register("foo", object);
    assertEquals(1, registry.size());
  }
Esempio n. 3
0
 @Test
 public void testRegistry() {
   assertEquals("My Registry", registry.getName());
 }
Esempio n. 4
0
 @After
 public void tearDown() {
   registry.clear();
 }