Changeset 43 in tmcsimulator for trunk/test/tmcsim
- Timestamp:
- 06/23/2016 11:34:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/tmcsim/simulationmanager/SimulationManagerSmokeTest.java
r34 r43 1 1 package tmcsim.simulationmanager; 2 2 3 import java.awt.Component; 3 4 import java.io.File; 5 import javax.swing.JButton; 4 6 import static junit.framework.Assert.assertEquals; 7 import static junit.framework.Assert.assertFalse; 8 import static junit.framework.Assert.assertTrue; 5 9 import static junit.framework.Assert.fail; 6 import org.uispec4j.*; 10 import org.uispec4j.Panel; 11 import org.uispec4j.TextBox; 12 import org.uispec4j.Trigger; 13 import org.uispec4j.UISpecTestCase; 14 import org.uispec4j.Window; 7 15 import org.uispec4j.interception.WindowInterceptor; 8 16 import tmcsim.cadsimulator.CADSimulator; … … 35 43 36 44 Window cadwindow = null; 37 System.setProperty("C ONFIG_DIR", "config/testConfig");38 if (System.getProperty("C ONFIG_DIR") != null)45 System.setProperty("CAD_SIM_PROPERTIES", "config/cad_simulator_smoketest_config.properties"); 46 if (System.getProperty("CAD_SIM_PROPERTIES") != null) 39 47 { 40 48 cadwindow = WindowInterceptor.run(new Trigger() … … 44 52 try 45 53 { 46 engine = new CADSimulator(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + "cad_simulator_config.properties"); 47 54 engine = new CADSimulator(System.getProperty("CAD_SIM_PROPERTIES")); 48 55 } catch (Exception e) 49 56 { … … 52 59 } 53 60 }); 54 } else 61 } 62 else 55 63 { 56 fail("C ONFIG_DIRsystem property not defined.");64 fail("CAD_SIM_PROPERTIES system property not defined."); 57 65 } 58 66 59 67 // Check CAD Simulator appears with no script and nothing connected 60 assert Equals("CAD Simulator", cadwindow.getTitle());68 assertTrue("Window title incorrect", cadwindow.getTitle().startsWith("CAD Simulator")); 61 69 Panel mainPanel = cadwindow.getPanel("contentPane"); 62 70 TextBox txtStatus = mainPanel.getTextBox("simulationStatus"); … … 67 75 68 76 Window simMgrWindow = null; 69 System.setProperty(" CONFIG_DIR", "config/testConfig");70 if (System.getProperty(" CONFIG_DIR") != null)77 System.setProperty("SIM_MGR_PROPERTIES", "config/sim_manager_smoketest_config.properties"); 78 if (System.getProperty("SIM_MGR_PROPERTIES") != null) 71 79 { 72 80 simMgrWindow = WindowInterceptor.run(new Trigger() … … 76 84 try 77 85 { 78 //simMgrApp = new SimulationManager(System.getProperty("SIM_MGR_PROPERTIES")); 79 simMgrApp = new SimulationManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + "sim_manager_config.properties"); 86 simMgrApp = new SimulationManager(System.getProperty("SIM_MGR_PROPERTIES")); 80 87 } catch (Exception ex) 81 88 { … … 84 91 } 85 92 }); 86 } else 93 } 94 else 87 95 { 88 fail(" CONFIG_DIRsystem property not defined.");96 fail("SIM_MGR_PROPERTIES system property not defined."); 89 97 } 90 98 … … 117 125 assertEquals("Running", txtSimStatus.getText()); 118 126 127 //List all available buttons 128 Component[] buttons = win.getSwingComponents(JButton.class); 129 for (Component comp : buttons) 130 { 131 System.out.println(comp); 132 } 133 win.getButton("Load Script"); 134 win.getButton("Pause"); 135 win.getButton("Disconnect from Paramics"); 136 win.getButton("Reset"); 137 win.getButton("Load Network"); 119 138 // Quit 120 139 engine = null; 121 simMgrApp = null; 140 win.getMenuBar().getMenu("File").getSubMenu("Exit").click(); 141 //simMgrApp = null; 122 142 } 123 143 }
Note: See TracChangeset
for help on using the changeset viewer.
