Skip to content

Commit

Permalink
Run gui stuff on gui thread
Browse files Browse the repository at this point in the history
  • Loading branch information
danielb987 committed Apr 14, 2020
1 parent 4aa81eb commit ef556b2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
7 changes: 5 additions & 2 deletions java/test/jmri/jmrix/AbstractConnectionConfigTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.junit.*;
import javax.swing.JPanel;
import jmri.util.ThreadingUtil;

/**
* Base tests for ConnectionConfig objects.
Expand All @@ -19,8 +20,10 @@ public void testCtor(){

@Test
public void testLoadDetails(){
// verify no exceptions thrown
cc.loadDetails(new JPanel());
ThreadingUtil.runOnGUI(() -> {
// verify no exceptions thrown
cc.loadDetails(new JPanel());
});
}

@Test
Expand Down
11 changes: 7 additions & 4 deletions java/test/jmri/jmrix/AbstractSerialConnectionConfigTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.junit.*;
import javax.swing.JPanel;
import jmri.util.ThreadingUtil;

/**
* Base tests for SerialConnectionConfig objects.
Expand All @@ -13,9 +14,11 @@ abstract public class AbstractSerialConnectionConfigTestBase extends jmri.jmrix.
@Test
@Override
public void testLoadDetails(){
// verify no exceptions thrown
cc.loadDetails(new JPanel());
// load details MAY produce an error message if no ports are found.
jmri.util.JUnitAppender.suppressErrorMessage("No usable ports returned");
ThreadingUtil.runOnGUI(() -> {
// verify no exceptions thrown
cc.loadDetails(new JPanel());
// load details MAY produce an error message if no ports are found.
jmri.util.JUnitAppender.suppressErrorMessage("No usable ports returned");
});
}
}
16 changes: 8 additions & 8 deletions java/test/jmri/jmrix/AbstractStreamConnectionConfigTestBase.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package jmri.jmrix;

import jmri.util.junit.annotations.*;
import org.junit.*;
// import jmri.util.junit.annotations.*;
// import org.junit.*;

/**
* Base tests for StreamConnectionConfig objects.
Expand All @@ -10,10 +10,10 @@
*/
abstract public class AbstractStreamConnectionConfigTestBase extends jmri.jmrix.AbstractConnectionConfigTestBase {

@Test
@Ignore("Stream connections don't (currently) load details")
@ToDo("modify Stream port Connections so they load details, then remove this test so parent class test can run or re-implement the test here")
@Override
public void testLoadDetails(){
}
// @Test
// @Ignore("Stream connections don't (currently) load details")
// @ToDo("modify Stream port Connections so they load details, then remove this test so parent class test can run or re-implement the test here")
// @Override
// public void testLoadDetails(){
// }
}

0 comments on commit ef556b2

Please sign in to comment.