コード例 #1
0
 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())));
 }
コード例 #2
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"));
 }
コード例 #3
0
 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())));
 }
コード例 #4
0
  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);
  }
コード例 #5
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);
  }
コード例 #6
0
  public void testTwoNames() {
    Reporter ir211 = l.provideReporter("LR211");
    Reporter lr211 = l.provideReporter("IR211");

    Assert.assertNotNull(ir211);
    Assert.assertNotNull(lr211);
    Assert.assertTrue(ir211 != lr211);
  }
コード例 #7
0
ファイル: PickListModel.java プロジェクト: oscarmoutinho/JMRI
 public NamedBean addBean(String sysName, String userName) {
   return manager.newReporter(sysName, userName);
 }
コード例 #8
0
ファイル: PickListModel.java プロジェクト: oscarmoutinho/JMRI
 public NamedBean addBean(String name) {
   return manager.provideReporter(name);
 }
コード例 #9
0
 public void testUpperLower() {
   Reporter t = l.provideReporter("" + getNumToTest2());
   String name = t.getSystemName();
   Assert.assertNull(l.getReporter(name.toLowerCase()));
 }
コード例 #10
0
 public void testMisses() {
   // try to get nonexistant lights
   Assert.assertTrue(null == l.getByUserName("foo"));
   Assert.assertTrue(null == l.getBySystemName("bar"));
 }
コード例 #11
0
 public void testDispose() {
   l.dispose(); // all we're really doing here is making sure the method exists
 }
コード例 #12
0
  public void testDefaultNotInternal() {
    Reporter lut = l.provideReporter("211");

    Assert.assertNotNull(lut);
    Assert.assertEquals("IR211", lut.getSystemName());
  }