1   /*
2    * @(#) DEVSSimulatorTest.java Sep 4, 2003
3    * 
4    * Copyright (c) 2003 Delft University of Technology Jaffalaan 5, 2628 BX Delft,
5    * the Netherlands All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the General Public License
9    */
10  package nl.tudelft.simulation.dsol.simulators;
11  
12  import java.rmi.RemoteException;
13  
14  import junit.framework.Assert;
15  import nl.tudelft.simulation.dsol.experiment.Experiment;
16  import nl.tudelft.simulation.dsol.simulators.DESSSimulator;
17  import nl.tudelft.simulation.dsol.simulators.DESSSimulatorInterface;
18  
19  /***
20   * The DESSSSimulatorTest test the DEVS Simulator <br>
21   * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
22   * University of Technology </a>, the Netherlands. <br>
23   * See for project information <a
24   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
25   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
26   * License (GPL) </a>, no warranty <br>
27   * 
28   * @version 2.0 21.09.2003 <br>
29   * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
30   *         Jacobs </a>, <a
31   *         href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
32   *         Verbraeck </a>
33   */
34  public class DESSSimulatorTest extends SimulatorTest
35  {
36  	/***
37  	 * constructs a new DEVSSimulatorTest
38  	 */
39  	public DESSSimulatorTest()
40  	{
41  		super(new DESSSimulator());
42  	}
43  
44  	/***
45  	 * @see nl.tudelft.simulation.dsol.simulators.SimulatorTest#test()
46  	 */
47  	public void test()
48  	{
49  		super.test();
50  		Experiment experiment = TestExperiment.createExperiment();
51  		experiment.setModel(new TestModel(experiment));
52  		try
53  		{
54  			DESSSimulatorInterface dessSimulator = (DESSSimulatorInterface) super.simulator;
55  			dessSimulator.setTimeStep(new Double(experiment
56  					.getProperty("TIMESTEP")).doubleValue());
57  			experiment.setSimulator(dessSimulator);
58  			experiment.start();
59  		} catch (RemoteException e)
60  		{
61  			Assert.fail(e.getMessage());
62  		}
63  	}
64  
65  	/***
66  	 * Executes a DESSSimulatorTest
67  	 * 
68  	 * @param args the arguments given on the command line
69  	 */
70  	public static void main(final String[] args)
71  	{
72  		new DESSSimulatorTest().test();
73  	}
74  }