| | 1 | == Draft == |
| | 2 | |
| | 3 | |
| | 4 | {{{ |
| | 5 | |
| | 6 | package tmcsim.paramicssimulator; |
| | 7 | |
| | 8 | import junit.framework.TestCase; |
| | 9 | import java.util.List; |
| | 10 | import java.nio.file.Files; |
| | 11 | import java.nio.file.Paths; |
| | 12 | import java.io.*; |
| | 13 | |
| | 14 | /** |
| | 15 | * |
| | 16 | * @author jdalbey |
| | 17 | */ |
| | 18 | public 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 | }}} |