    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 junit.framework.Assert;
    13  import nl.tudelft.simulation.dsol.experiment.Experiment;
    14  import nl.tudelft.simulation.dsol.simulators.RealTimeClock;
    15
    16  /***
    17   * The DESSSSimulatorTest test the DEVS Simulator <br>
    18   * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
    19   * University of Technology </a>, the Netherlands. <br>
    20   * See for project information <a
    21   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
    22   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
    23   * License (GPL) </a>, no warranty <br>
    24   *
    25   * @version 2.0 21.09.2003 <br>
    26   * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
    27   *         Jacobs </a>, <a
    28   *         href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
    29   *         Verbraeck </a>
    30   */
    31  public class RealTimeClockTest
    32  {
    33  	/***
    34  	 * constructs a new DEVSSimulatorTest
    35  	 */
    36  	public RealTimeClockTest()
    37  	{
    38  		super();
    39  	}
    40
    41  	/***
    42  	 * @see nl.tudelft.simulation.dsol.simulators.SimulatorTest#test()
    43  	 */
    44  	public void test()
    45  	{
    46  		Experiment experiment = TestExperiment.createExperiment();
    47  		experiment.getTreatments()[0].getRunControl().setRunLength(100000);
    48  		experiment.setModel(new TestModel(experiment));
    49  		try
    50  		{
    51  			RealTimeClock clock = new RealTimeClock();
    52  			clock.setTimeStep(10);
    53  			experiment.setSimulator(clock);
    54  			experiment.start();
    55  		} catch (Exception e)
    56  		{
    57  			Assert.fail(e.getMessage());
    58  		}
    59  	}
    60
    61  	/***
    62  	 * Executes a DESSSimulatorTest
    63  	 *
    64  	 * @param args the arguments given on the command line
    65  	 */
    66  	public static void main(final String[] args)
    67  	{
    68  		new RealTimeClockTest().test();
    69  	}
    70  }