コード例 #1
0
 public void testRename() {
   // get light
   Reporter t1 = l.newReporter(getSystemName(getNumToTest1()), "before");
   Assert.assertNotNull("t1 real object ", t1);
   t1.setUserName("after");
   Reporter t2 = l.getByUserName("after");
   Assert.assertEquals("same object", t1, t2);
   Assert.assertEquals("no old object", null, l.getByUserName("before"));
 }
コード例 #2
0
  public void testProvideUser() {
    Reporter l1 = l.provideReporter("211");
    l1.setUserName("user 1");
    Reporter l2 = l.provideReporter("user 1");
    Reporter l3 = l.getReporter("user 1");

    Assert.assertNotNull(l1);
    Assert.assertNotNull(l2);
    Assert.assertNotNull(l3);
    Assert.assertEquals(l1, l2);
    Assert.assertEquals(l3, l2);
    Assert.assertEquals(l1, l3);

    Reporter l4 = l.getReporter("JLuser 1");
    Assert.assertNull(l4);
  }