diff --git a/Makefile b/Makefile index f219d3e2..c14002cb 100644 --- a/Makefile +++ b/Makefile @@ -293,7 +293,7 @@ premade: ################################################################################ # This target runs Trick's Unit-tests and simulation-tests. -test: unit_test sim_test +test: unit_test sim_test gui_test @ echo "All tests completed sucessfully" test32: sim_test32 @@ -319,6 +319,9 @@ sim_test32: pytest: make -C share/trick/pymods/trick +gui_test: + @ $(MAKE) -C trick_source/java test + COVERAGE_DIRS = trick_source/sim_services \ trick_source/trick_utils/var_binary_parser \ trick_source/trick_utils/unicode \ diff --git a/trick_source/java/src/main/java/trick/simcontrol/SimControlApplication.java b/trick_source/java/src/main/java/trick/simcontrol/SimControlApplication.java index 113a8994..15ebf1ae 100644 --- a/trick_source/java/src/main/java/trick/simcontrol/SimControlApplication.java +++ b/trick_source/java/src/main/java/trick/simcontrol/SimControlApplication.java @@ -346,7 +346,7 @@ public class SimControlApplication extends TrickApplication implements PropertyC /** * Helper method for starting monitors for sim status as well as health status. */ - private void startStatusMonitors() { + protected void startStatusMonitors() { MonitorSimStatusTask monitorSimStatusTask = new MonitorSimStatusTask(this); monitorSimStatusTask.addPropertyChangeListener(this); getContext().getTaskService().execute(monitorSimStatusTask); diff --git a/trick_source/java/src/test/java/trick/simcontrol/HeadlessSimControlApplication.java b/trick_source/java/src/test/java/trick/simcontrol/HeadlessSimControlApplication.java index 18cf1389..9bb3d986 100644 --- a/trick_source/java/src/test/java/trick/simcontrol/HeadlessSimControlApplication.java +++ b/trick_source/java/src/test/java/trick/simcontrol/HeadlessSimControlApplication.java @@ -32,4 +32,7 @@ public class HeadlessSimControlApplication extends SimControlApplication { @Override protected void updateGUI() { /* UNUSED */ } + + @Override + protected void startStatusMonitors() { /* UNUSED */} } \ No newline at end of file diff --git a/trick_source/java/src/test/java/trick/simcontrol/SimControlApplicationTest.java b/trick_source/java/src/test/java/trick/simcontrol/SimControlApplicationTest.java index 0b35e0d1..1dd9cb42 100644 --- a/trick_source/java/src/test/java/trick/simcontrol/SimControlApplicationTest.java +++ b/trick_source/java/src/test/java/trick/simcontrol/SimControlApplicationTest.java @@ -33,8 +33,6 @@ import trick.common.utils.VariableServerConnection; */ public class SimControlApplicationTest extends ApplicationTest { private final static String SIM_DIR = "/test/SIM_gui_testing"; - private final ByteArrayOutputStream stdContent = new ByteArrayOutputStream(); - private final PrintStream originalStd = System.out; private final ByteArrayOutputStream errContent = new ByteArrayOutputStream(); private final PrintStream originalErr = System.err; @@ -87,21 +85,6 @@ public class SimControlApplicationTest extends ApplicationTest { simProc.destroy(); } - @Before - public void setUp() { - // System.setOut(new PrintStream(stdContent)); - // System.setErr(new PrintStream(errContent)); - } - - @After - public void tearDown() { - // System.setOut(originalStd); - // System.setErr(originalErr); - - // stdContent.reset(); - // errContent.reset(); - } - @Test public void testStartSim() throws IOException { // ARRANGE @@ -126,7 +109,6 @@ public class SimControlApplicationTest extends ApplicationTest { } while (mode != 5 && count < 100000); // ASSERT - System.out.println(errContent.toString()); assertTrue("Sim Mode is not MODE_RUN(5)\nMODE_ID=" + mode, mode == MODE_RUN); // CLEAN UP @@ -161,7 +143,6 @@ public class SimControlApplicationTest extends ApplicationTest { } while (mode != 1 && count < 100000); // ASSERT - System.out.println(errContent.toString()); assertTrue("Sim Mode is not MODE_FREEZE (1)\nMODE_ID=" + mode, mode == MODE_FREEZE); }