From f0af15ee2d6ccdb4f2960212aac9fc367c805b68 Mon Sep 17 00:00:00 2001 From: Marcus Rockwell Date: Thu, 5 Oct 2023 15:32:40 -0500 Subject: [PATCH] Updated the testing for DRE Fixed the errors when running the test --- .../java/trick/dre/DreApplicationTest.java | 7 +- .../java/trick/dre/WaitForDreApplication.java | 5 +- .../src/test/java/trick/test/Testing.java | 31 - .../java/src/test/resources/S_sie.resource | 3605 +++++++++++++++++ 4 files changed, 3613 insertions(+), 35 deletions(-) delete mode 100644 trick_source/java/src/test/java/trick/test/Testing.java create mode 100644 trick_source/java/src/test/resources/S_sie.resource diff --git a/trick_source/java/src/test/java/trick/dre/DreApplicationTest.java b/trick_source/java/src/test/java/trick/dre/DreApplicationTest.java index f7ad26d6..5d47324d 100644 --- a/trick_source/java/src/test/java/trick/dre/DreApplicationTest.java +++ b/trick_source/java/src/test/java/trick/dre/DreApplicationTest.java @@ -16,12 +16,13 @@ import trick.common.CheckApplicationProperties; * Test DreApplication life cycle. * * @author hchen + * @intern mrockwell2 * */ public class DreApplicationTest { @BeforeClass - public static void setUpBeforeClass() throws Exception { + public static void setUpBeforeClass() throws Exception { WaitForDreApplication.launchAndWait(WaitForDreApplication.class); } @@ -30,7 +31,7 @@ public class DreApplicationTest { } @Before - public void setUp() throws Exception { + public void setUp() throws Exception { } @After @@ -38,7 +39,7 @@ public class DreApplicationTest { } @Test - public void testReady() { + public void testReady() { assertTrue("DreApplicationTest is not ready yet!", application().isReady()); } diff --git a/trick_source/java/src/test/java/trick/dre/WaitForDreApplication.java b/trick_source/java/src/test/java/trick/dre/WaitForDreApplication.java index 62494506..6e5d8641 100644 --- a/trick_source/java/src/test/java/trick/dre/WaitForDreApplication.java +++ b/trick_source/java/src/test/java/trick/dre/WaitForDreApplication.java @@ -29,7 +29,10 @@ public class WaitForDreApplication extends DreApplication { */ public static void launchAndWait(Class applicationClass) { synchronized(lock) { - sieResourcePath ="resources" + java.io.File.separator + "S_sie.resource"; + // Set path to S_sie.resource (src/test/resources/S_sie.resource) + final String sep = java.io.File.separator; + sieResourcePath = String.format("src%1$stest%1$sresources%1$sS_sie.resource", sep); + Application.launch(applicationClass, new String[]{}); while(true) { try { diff --git a/trick_source/java/src/test/java/trick/test/Testing.java b/trick_source/java/src/test/java/trick/test/Testing.java deleted file mode 100644 index 8d0588f2..00000000 --- a/trick_source/java/src/test/java/trick/test/Testing.java +++ /dev/null @@ -1,31 +0,0 @@ -package trick.test; -import static org.junit.Assert.assertTrue; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -public class Testing { - @BeforeClass - public static void beforeClassmethod() { - System.out.println("Hi welcome in Before Class Method"); - } - @Before - public void beforemethod() { - System.out.println("Hello there welcome in Before Test Case strategy "); - } - @Test - public void Test(){ - System.out.println("Welcome in First Test"); - int num = 5; - assertTrue(num == 5); - } - @After - public void aftermethod() { - System.out.println("Hi welcome in After Test Case"); - } - @AfterClass - public static void afterClassmethod() { - System.out.println("Hi welcome in After Class"); - } -} \ No newline at end of file diff --git a/trick_source/java/src/test/resources/S_sie.resource b/trick_source/java/src/test/resources/S_sie.resource new file mode 100644 index 00000000..8edfa1b9 --- /dev/null +++ b/trick_source/java/src/test/resources/S_sie.resource @@ -0,0 +1,3605 @@ + + + + + trick_sys + + + + + + trick_mm + + + + trick_cmd_args + + + + message + + + + + + + + + + trick_ip + + + + monte_carlo + + trick_vs + + + + + + + + + + + + + + data_record + + + + + + + + + + master_slave + + + + + + real_time + + + + + + + + + + instruments + + + + + + dmtcp + + + + zero_conf + + + + utest + + + + ball + + + + + + my_integ_loop + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SIM_MODE + + + 0 + + + + 1 + + + + 4 + + + + 5 + + + + 6 + + + + + TCCommBlocking + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + + TCCommFlag + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + + Trick::EventBeforeAfter + + + 0 + + + + 1 + + + + 2 + + + + + Trick::MonteCarlo::Verbosity + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + + Trick::MonteRun::ExitStatus + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + + Trick::MonteSlave::State + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + + Trick::RemoteShell + + + 0 + + + + 1 + + + + 2 + + + + + TrickErrorLevel + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + \ No newline at end of file