wiki:ParamicsSimulatorTest

Draft

package tmcsim.paramicssimulator;

import junit.framework.TestCase;
import java.util.List;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.io.*;

/**
 *
 * @author jdalbey
 */
public class ParamicsSimulatorTest extends TestCase
{
    
    public ParamicsSimulatorTest(String testName)
    {
        super(testName);
    }


    /**
     * Test of main method, of class ParamicsSimulator.
     */
    public void testMain() throws IOException
    {
        System.out.println("main");
        System.setProperty("PARAMICS_SIM_PROPERTIES", "config/paramics_simulator_config.properties");
        String[] args = null;
        ParamicsSimulator.main(args);
        String expected = "<Paramics>\n   <Network_Status>LOADING</Network_Status>\n"
            + "   <Network_ID>1</Network_ID>\n</Paramics>";
        String actual = new String(Files.readAllBytes(
                                Paths.get("test/paramics_status.xml")));
        assertEquals("paramics status incorrect", expected, actual);
    }

}