Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.properties
r40 r43 40 40 ${file.reference.uispec4j-jdk17.jar}:\ 41 41 ${file.reference.mp3plugin.jar}:\ 42 ${file.reference.mockito-1.10.19.jar} 42 ${file.reference.mockito-1.10.19.jar}:\ 43 ${libs.junit_4.classpath} 43 44 # Space-separated list of extra javac options 44 45 javac.compilerargs= … … 51 52 ${javac.classpath}:\ 52 53 ${build.classes.dir}:\ 53 ${libs.junit.classpath}:\ 54 ${libs.junit_4.classpath} 54 ${libs.junit.classpath} 55 55 javac.test.processorpath=\ 56 56 ${javac.test.classpath} -
trunk/src/tmcsim/simulationmanager/actions/ExitAction.java
r2 r43 2 2 3 3 import java.awt.event.ActionEvent; 4 import javax.swing.AbstractAction; 5 import tmcsim.simulationmanager.SimulationManagerView; 4 6 5 import javax.swing.AbstractAction;6 import javax.swing.JOptionPane;7 8 import tmcsim.simulationmanager.SimulationManagerView;9 7 /** 10 8 * ExitAction is an AbstractAction that is used for exiting the Simulation 11 * Manager application. When the action is performed, the action prompts the 12 * user to confirm the exit, and then disposes of the SimulationManagerView class. 9 * Manager application. When the action is performed, the action prompts the 10 * user to confirm the exit, and then disposes of the SimulationManagerView 11 * class. 12 * 13 13 * @author Matthew Cechini 14 * @author jdalbey 06/23/2016 Removed confirmation prompt to simplify system 15 * testing. 14 16 */ 15 17 @SuppressWarnings("serial") 16 public class ExitAction extends AbstractAction { 17 18 /** Reference to the SimulationManagerView object. */ 18 public class ExitAction extends AbstractAction 19 { 20 21 /** 22 * Reference to the SimulationManagerView object. 23 */ 19 24 private SimulationManagerView theSimManagerView = null; 20 21 /** 25 26 /** 22 27 * Constructor. 28 * 23 29 * @param view View class object for the Simulation Manager. 24 30 */ 25 public ExitAction(SimulationManagerView view) { 31 public ExitAction(SimulationManagerView view) 32 { 26 33 super("Exit"); 27 28 theSimManagerView = view; 34 35 theSimManagerView = view; 29 36 } 30 31 37 32 public void actionPerformed(ActionEvent evt) { 33 34 if(JOptionPane.showConfirmDialog( 35 null, "Exit Simulation Manager?", "Confirm Exit", 36 JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) 37 { 38 theSimManagerView.dispose(); 39 } 38 public void actionPerformed(ActionEvent evt) 39 { 40 theSimManagerView.dispose(); 41 // if(JOptionPane.showConfirmDialog( 42 // null, "Exit Simulation Manager?", "Confirm Exit", 43 // JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) 44 // { 45 // theSimManagerView.dispose(); 46 // } 40 47 } 41 48 } -
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.
