Ignore:
Timestamp:
04/16/2016 12:54:43 PM (10 years ago)
Author:
jdalbey
Message:

CADSimulatorTest: added test of info messages text area.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/tmcsim/cadsimulator/CADSimulatorTest.java

    r4 r5  
    22 
    33import java.rmi.RemoteException; 
     4import java.util.logging.Level; 
     5import java.util.logging.Logger; 
     6import javax.swing.JScrollPane; 
    47import static junit.framework.Assert.assertEquals; 
    58import static junit.framework.Assert.fail; 
     
    6770                    { 
    6871                        app = new CADSimulator(System.getProperty("CAD_SIM_PROPERTIES")); 
    69                     } catch (Exception e) 
     72                    } 
     73                    catch (Exception e) 
    7074                    { 
    7175                        fail("Couldn't launch CADSimulator"); 
     
    7377                } 
    7478            }); 
    75         } else 
     79        } 
     80        else 
    7681        { 
    7782            fail("CAD_SIM_PROPERTIES system property not defined."); 
     
    9095        app.theCoordinator.registerForCallback(ci); 
    9196        assertEquals("2", terminals.getText().trim()); 
    92          
     97 
    9398        SimulationManagerInterface si = new CADSimulatorTest.FakeSimMgr(); 
    9499        app.theCoordinator.registerForCallback(si); 
    95100        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 
    97109        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(); 
    108110    } 
    109111 
    110     class FakeClient implements CADClientInterface  
     112    class FakeClient implements CADClientInterface 
    111113    { 
     114 
    112115        @Override 
    113116        public void refresh() throws RemoteException 
     
    115118            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 
    116119        } 
    117      
    118120    } 
     121 
    119122    class FakeSimMgr implements SimulationManagerInterface 
    120123    { 
     124 
    121125        @Override 
    122126        public void tick(long theTime) throws RemoteException 
     
    160164            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 
    161165        } 
    162      
    163166    } 
    164      
    165      
    166167} 
Note: See TracChangeset for help on using the changeset viewer.