mirror of
https://github.com/nasa/trick.git
synced 2025-02-05 10:29:19 +00:00
Cleaned up test suite and ensured all three run and pass
This commit is contained in:
parent
d35d750a74
commit
8ea4a35125
@ -323,8 +323,8 @@
|
||||
<configuration>
|
||||
<printSummary>true</printSummary>
|
||||
<excludes>
|
||||
<exclude> **/SimControlApplicationTest.java </exclude>
|
||||
<exclude> **/DreApplicationTest.java </exclude>
|
||||
<!-- <exclude> **/SimControlApplicationTest.java </exclude> -->
|
||||
<!-- <exclude> **/DreApplicationTest.java </exclude> -->
|
||||
<exclude> **/TrickDPApplicationTest.java </exclude>
|
||||
<exclude> **/TrickQPApplicationTest.java </exclude>
|
||||
<exclude> **/MonteMonitorApplicationTest.java </exclude>
|
||||
|
@ -36,6 +36,7 @@ import trick.dre.fixtures.DreFixture.Size;
|
||||
public class DreApplicationTest extends ApplicationTest {
|
||||
|
||||
private DreFixture dre_fix;
|
||||
private MockDreApplication dre_app;
|
||||
|
||||
@BeforeClass
|
||||
public static void onSetUpBeforeClass() {
|
||||
@ -46,9 +47,10 @@ public class DreApplicationTest extends ApplicationTest {
|
||||
protected void onSetUp() {
|
||||
application(MockDreApplication.class).start();
|
||||
|
||||
sleep(1500);
|
||||
sleep(2000);
|
||||
|
||||
dre_fix = new DreFixture(robot(), MockDreApplication.getInstance());
|
||||
dre_app = MockDreApplication.getInstance(MockDreApplication.class);
|
||||
dre_fix = new DreFixture(robot(), dre_app);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -225,7 +227,6 @@ public class DreApplicationTest extends ApplicationTest {
|
||||
"drg[DR_GROUP_ID].set_cycle(" + GRP_CYCLE + ")",
|
||||
"drg[DR_GROUP_ID].set_max_file_size(" + GRP_SIZE + GRP_UNIT.TAG + ")" };
|
||||
|
||||
MockDreApplication app = MockDreApplication.getInstance();
|
||||
String[] output;
|
||||
boolean setGrpName = false,
|
||||
setCycle = false,
|
||||
@ -236,7 +237,7 @@ public class DreApplicationTest extends ApplicationTest {
|
||||
dre_fix.setCycle(GRP_CYCLE);
|
||||
dre_fix.setMaxFileSize(GRP_SIZE, GRP_UNIT);
|
||||
|
||||
output = app.getSettingsOutput();
|
||||
output = dre_app.getSettingsOutput();
|
||||
|
||||
// Assert
|
||||
for(String line : output) {
|
||||
@ -335,7 +336,6 @@ public class DreApplicationTest extends ApplicationTest {
|
||||
final Size EXP_UNIT = Size.MB;
|
||||
final String[] VAR_TYPES = {"charB", "intB", "shortB", "ucharB", "uintB", "ushortB", "mixB"};
|
||||
|
||||
MockDreApplication app = MockDreApplication.getInstance();
|
||||
int sel_opts;
|
||||
String name, cycle, size;
|
||||
String[] sel_vars, settings;
|
||||
@ -349,7 +349,7 @@ public class DreApplicationTest extends ApplicationTest {
|
||||
|
||||
sel_opts = dre_fix.getSelectedOptions();
|
||||
sel_vars = dre_fix.getSelectedVars();
|
||||
settings = app.getSettingsOutput();
|
||||
settings = dre_app.getSettingsOutput();
|
||||
|
||||
//ASSERT
|
||||
assumeThat(sel_vars.length).isEqualTo(VAR_TYPES.length * 4);
|
||||
|
@ -10,15 +10,11 @@ import org.jdesktop.application.Application;
|
||||
import trick.common.TestUtils;
|
||||
|
||||
public class MockDreApplication extends DreApplication {
|
||||
private static MockDreApplication the_dre = null;
|
||||
|
||||
public MockDreApplication() {
|
||||
super();
|
||||
the_dre = this;
|
||||
}
|
||||
|
||||
public static final MockDreApplication getInstance() { return the_dre; }
|
||||
|
||||
public String[] getSettingsOutput() {
|
||||
StringWriter strWrt = new StringWriter();
|
||||
try{ writeGroupSettings(strWrt); }
|
||||
|
@ -201,7 +201,7 @@ public class TVApplicationTest extends ApplicationTest {
|
||||
// CLEANUP
|
||||
for(int i = 0; i < inital_values.length; i++) {
|
||||
tv_fix.editVariableTable(i, 1, inital_values[i]);
|
||||
sleep(250);
|
||||
sleep(500);
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,7 +299,6 @@ public class TVApplicationTest extends ApplicationTest {
|
||||
|
||||
// ACT
|
||||
tv_fix.openSetMenuItem(SAVED_FILE);
|
||||
|
||||
sleep(500);
|
||||
|
||||
res_vars = tv_fix.getSelectedVars();
|
||||
@ -309,6 +308,7 @@ public class TVApplicationTest extends ApplicationTest {
|
||||
|
||||
// CLEANUP
|
||||
tv_fix.openSetMenuItem(ORIGINAL_VALS_FILE);
|
||||
sleep(500);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -331,7 +331,6 @@ public class TVApplicationTest extends ApplicationTest {
|
||||
|
||||
// ACT
|
||||
tv_fix.setValMenuItem(SAVED_FILE);
|
||||
|
||||
sleep(500);
|
||||
|
||||
res_vars1 = tv_fix.getSelectedVars();
|
||||
@ -351,7 +350,8 @@ public class TVApplicationTest extends ApplicationTest {
|
||||
assertThat2DArraysAreEqual(res_vars2, SEL_VARS);
|
||||
|
||||
// CLEANUP
|
||||
tv_fix.openSetMenuItem(ORIGINAL_VALS_FILE);
|
||||
tv_fix.setValMenuItem(ORIGINAL_VALS_FILE);
|
||||
sleep(500);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user