Skip to content

Commit

Permalink
terminate threads ->shutdown items, now seen because tearDown fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
bobjacobsen committed Apr 22, 2020
1 parent 28b2d84 commit decd9ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void setUp() {

@After
public void tearDown() {
m.getJMRIClientTrafficController().terminateThreads();
JUnitUtil.tearDown();
}
}
17 changes: 12 additions & 5 deletions java/test/jmri/jmrix/nce/NceTurnoutTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import jmri.Turnout;
import jmri.implementation.AbstractTurnoutTestBase;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.*;

/**
* Tests for the jmri.jmrix.nce.NceTurnout class
Expand All @@ -18,13 +16,21 @@ public class NceTurnoutTest extends AbstractTurnoutTestBase {
@Before
@Override
public void setUp() {
jmri.util.JUnitUtil.setUp();
super.setUp();
// prepare an interface
tcis = new NceTrafficControlScaffold();

t = new NceTurnout(tcis, "NT", 4);
}

@After
@Override
public void tearDown() {
// prepare an interface
if (tcis !=null ) tcis.terminateThreads();
super.tearDown();
}

@Override
public int numListeners() {
return tcis.numListeners();
Expand All @@ -41,7 +47,8 @@ public void testLockCoding() {

@Test
public void testCanLockModes() {
// prepare an interface
// prepare an interface, dropping old one
if (tcis !=null ) tcis.terminateThreads();
tcis = new NceTrafficControlScaffold() {
@Override
public int getUsbSystem() { return NceTrafficController.USB_SYSTEM_NONE; }
Expand Down

0 comments on commit decd9ca

Please sign in to comment.