コード例 #1
0
  public void testCtor() {
    // infrastructure objects
    XNetInterfaceScaffold tc = new XNetInterfaceScaffold(new LenzCommandStation());

    XNetSystemConnectionMemo t = new XNetSystemConnectionMemo(tc);
    Assert.assertNotNull(t);
    Assert.assertNotNull(t.getXNetTrafficController());
    // While we are constructing the memo, we should also set the
    // SystemMemo parameter in the traffic controller.
    Assert.assertNotNull(tc.getSystemConnectionMemo());
  }
コード例 #2
0
  public void testXNetTrafficControllerSetCtor() {
    // infrastructure objects
    XNetInterfaceScaffold tc = new XNetInterfaceScaffold(new LenzCommandStation());

    XNetSystemConnectionMemo t = new XNetSystemConnectionMemo();
    Assert.assertNotNull(t);
    // the default constructor does not set the traffic controller
    Assert.assertNull(t.getXNetTrafficController());
    // so we need to do this ourselves.
    t.setXNetTrafficController(tc);
    Assert.assertNotNull(t.getXNetTrafficController());
    // and while we're doing that, we should also set the SystemMemo
    // parameter in the traffic controller.
    Assert.assertNotNull(tc.getSystemConnectionMemo());
  }