Changes between Initial Version and Version 1 of ParamicsSimulatorTest


Ignore:
Timestamp:
06/27/2016 04:52:44 PM (10 years ago)
Author:
jdalbey
Comment:

draft

Legend:

Unmodified
Added
Removed
Modified
  • ParamicsSimulatorTest

    v1 v1  
     1== Draft == 
     2 
     3 
     4{{{ 
     5 
     6package tmcsim.paramicssimulator; 
     7 
     8import junit.framework.TestCase; 
     9import java.util.List; 
     10import java.nio.file.Files; 
     11import java.nio.file.Paths; 
     12import java.io.*; 
     13 
     14/** 
     15 * 
     16 * @author jdalbey 
     17 */ 
     18public class ParamicsSimulatorTest extends TestCase 
     19{ 
     20     
     21    public ParamicsSimulatorTest(String testName) 
     22    { 
     23        super(testName); 
     24    } 
     25 
     26 
     27    /** 
     28     * Test of main method, of class ParamicsSimulator. 
     29     */ 
     30    public void testMain() throws IOException 
     31    { 
     32        System.out.println("main"); 
     33        System.setProperty("PARAMICS_SIM_PROPERTIES", "config/paramics_simulator_config.properties"); 
     34        String[] args = null; 
     35        ParamicsSimulator.main(args); 
     36        String expected = "<Paramics>\n   <Network_Status>LOADING</Network_Status>\n" 
     37            + "   <Network_ID>1</Network_ID>\n</Paramics>"; 
     38        String actual = new String(Files.readAllBytes( 
     39                                Paths.get("test/paramics_status.xml"))); 
     40        assertEquals("paramics status incorrect", expected, actual); 
     41    } 
     42 
     43} 
     44 
     45}}}