Changeset 5 in tmcsimulator
- Timestamp:
- 04/16/2016 12:54:43 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
src/tmcsim/cadsimulator/CADSimulator.java (modified) (2 diffs)
-
src/tmcsim/cadsimulator/viewer/SimulationStatusPanel.java (modified) (1 diff)
-
test/tmcsim/cadsimulator/CADSimulatorTest.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/CADSimulator.java
r2 r5 70 70 71 71 /** Error logger. */ 72 private static Logger cadSimLogger = Logger.getLogger("tmcsim. simulationmanager");72 private static Logger cadSimLogger = Logger.getLogger("tmcsim.cadsimulator"); 73 73 74 74 /** … … 161 161 //Create the Coordinator and register it for RMI communicator. Start the 162 162 //CAD Simulator Socket Handler to begin to accept connections from CAD Clients. 163 try { 163 try { 164 164 theViewer = new CADSimulatorViewer(); 165 165 theCoordinator = new Coordinator(); -
trunk/src/tmcsim/cadsimulator/viewer/SimulationStatusPanel.java
r2 r5 393 393 infoMessagesTA = new JTextArea(6, 30); 394 394 infoMessagesTA.setEditable(false); 395 infoMessagesPane = new JScrollPane(errorMessagesTA); 395 infoMessagesTA.setName("infoMessagesTA"); 396 infoMessagesPane = new JScrollPane(infoMessagesTA); 396 397 infoMessagesPane.setPreferredSize(new Dimension(300, 100)); 397 398 398 399 infoMessagesPane.setBorder(BorderFactory.createTitledBorder( 399 400 BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Info Messages")); 400 401 infoMessagesPane.setName("infoMessagesPane"); 401 402 402 403 errorMessagesTA = new JTextArea(6, 30); -
trunk/test/tmcsim/cadsimulator/CADSimulatorTest.java
r4 r5 2 2 3 3 import java.rmi.RemoteException; 4 import java.util.logging.Level; 5 import java.util.logging.Logger; 6 import javax.swing.JScrollPane; 4 7 import static junit.framework.Assert.assertEquals; 5 8 import static junit.framework.Assert.fail; … … 67 70 { 68 71 app = new CADSimulator(System.getProperty("CAD_SIM_PROPERTIES")); 69 } catch (Exception e) 72 } 73 catch (Exception e) 70 74 { 71 75 fail("Couldn't launch CADSimulator"); … … 73 77 } 74 78 }); 75 } else 79 } 80 else 76 81 { 77 82 fail("CAD_SIM_PROPERTIES system property not defined."); … … 90 95 app.theCoordinator.registerForCallback(ci); 91 96 assertEquals("2", terminals.getText().trim()); 92 97 93 98 SimulationManagerInterface si = new CADSimulatorTest.FakeSimMgr(); 94 99 app.theCoordinator.registerForCallback(si); 95 100 assertEquals("Yes", mainPanel.getTextBox("managerConnectedTF").getText().trim()); 96 101 102 Logger cadSimLogger = Logger.getLogger("tmcsim.cadsimulator"); 103 cadSimLogger.logp(Level.INFO, "", "", "Sample Info Message."); 104 105 Panel infoPane = mainPanel.getPanel("InfoMessagesPane"); 106 TextBox infoText = infoPane.getTextBox("infoMessagesTA"); 107 assertEquals(". = Sample Info Message.\n", infoText.getText()); 108 97 109 app = null; 98 // app.theViewer.dispose();99 // Window confirmPopup = null;100 // confirmPopup = WindowInterceptor.run(new Trigger()101 // {102 // public void run()103 // {104 // app.theViewer.closeViewer();105 // }106 // });107 // confirmPopup.getButton("OK").click();108 110 } 109 111 110 class FakeClient implements CADClientInterface 112 class FakeClient implements CADClientInterface 111 113 { 114 112 115 @Override 113 116 public void refresh() throws RemoteException … … 115 118 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 116 119 } 117 118 120 } 121 119 122 class FakeSimMgr implements SimulationManagerInterface 120 123 { 124 121 125 @Override 122 126 public void tick(long theTime) throws RemoteException … … 160 164 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 161 165 } 162 163 166 } 164 165 166 167 }
Note: See TracChangeset
for help on using the changeset viewer.
