1
2
3
4
5
6
7
8
9
10 package nl.tudelft.simulation.dsol.experiment;
11
12 import junit.framework.Assert;
13 import junit.framework.TestCase;
14 import nl.tudelft.simulation.dsol.experiment.TimeUnitInterface;
15
16 /***
17 * This class defines the JUnit test for the TimeUnit class <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 href="http://www.simulation.tudelft.nl">
21 * 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">
29 * Alexander Verbraeck </a>
30 */
31 public class TimeUnitTest extends TestCase
32 {
33 /*** TEST_METHOD_NAME refers to the name of the test method */
34 public static final String TEST_METHOD_NAME = "test";
35
36 /***
37 * constructs a new TimeUnitTest
38 */
39 public TimeUnitTest()
40 {
41 this(TEST_METHOD_NAME);
42 }
43
44 /***
45 * constructs a new TimeTest
46 *
47 * @param arg0 the name of the test method
48 */
49 public TimeUnitTest(final String arg0)
50 {
51 super(arg0);
52 }
53
54 /***
55 * tests the TimeClass
56 */
57 public void test()
58 {
59 Assert.assertEquals(new Long(TimeUnitInterface.WEEK.getValue()),
60 new Long(7L * TimeUnitInterface.DAY.getValue()));
61 Assert.assertEquals(new Long(TimeUnitInterface.DAY.getValue()),
62 new Long(24L * TimeUnitInterface.HOUR.getValue()));
63 Assert.assertEquals(new Long(TimeUnitInterface.HOUR.getValue()),
64 new Long(60L * TimeUnitInterface.MINUTE.getValue()));
65 Assert.assertEquals(new Long(TimeUnitInterface.MINUTE.getValue()),
66 new Long(60L * TimeUnitInterface.SECOND.getValue()));
67 Assert.assertEquals(new Long(TimeUnitInterface.SECOND.getValue()),
68 new Long(1000L * TimeUnitInterface.MILLISECOND.getValue()));
69 Assert.assertEquals(new Long(TimeUnitInterface.MILLISECOND.getValue()),
70 new Long(TimeUnitInterface.UNIT.getValue()));
71 }
72 }