public void testDefaultSystemName() { // create Reporter t = l.provideReporter("" + getNumToTest3()); // check Assert.assertTrue("real object returned ", t != null); t = l.getBySystemName(getSystemName(getNumToTest3())); Assert.assertTrue( "system name correct ", t == l.getBySystemName(getSystemName(getNumToTest3()))); }
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")); }
public void testReporterPutGet() { // create Reporter t = l.newReporter(getSystemName(getNumToTest1()), "mine"); // check Assert.assertTrue("real object returned ", t != null); Assert.assertTrue("user name correct ", t == l.getByUserName("mine")); Assert.assertTrue( "system name correct ", t == l.getBySystemName(getSystemName(getNumToTest1()))); }
public void testSingleObject() { // test that you always get the same representation Reporter t1 = l.newReporter(getSystemName(getNumToTest1()), "mine"); Assert.assertTrue("t1 real object returned ", t1 != null); Assert.assertTrue("same by user ", t1 == l.getByUserName("mine")); Assert.assertTrue("same by system ", t1 == l.getBySystemName(getSystemName(getNumToTest1()))); Reporter t2 = l.newReporter(getSystemName(getNumToTest1()), "mine"); Assert.assertTrue("t2 real object returned ", t2 != null); // check Assert.assertTrue("same new ", t1 == t2); }
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); }
public void testTwoNames() { Reporter ir211 = l.provideReporter("LR211"); Reporter lr211 = l.provideReporter("IR211"); Assert.assertNotNull(ir211); Assert.assertNotNull(lr211); Assert.assertTrue(ir211 != lr211); }
public NamedBean addBean(String sysName, String userName) { return manager.newReporter(sysName, userName); }
public NamedBean addBean(String name) { return manager.provideReporter(name); }
public void testUpperLower() { Reporter t = l.provideReporter("" + getNumToTest2()); String name = t.getSystemName(); Assert.assertNull(l.getReporter(name.toLowerCase())); }
public void testMisses() { // try to get nonexistant lights Assert.assertTrue(null == l.getByUserName("foo")); Assert.assertTrue(null == l.getBySystemName("bar")); }
public void testDispose() { l.dispose(); // all we're really doing here is making sure the method exists }
public void testDefaultNotInternal() { Reporter lut = l.provideReporter("211"); Assert.assertNotNull(lut); Assert.assertEquals("IR211", lut.getSystemName()); }