1
2
3
4
5
6
7
8
9
10 package nl.tudelft.simulation.event;
11
12 import junit.framework.Assert;
13 import junit.framework.TestCase;
14
15 /***
16 * The test script for the Event class.
17 * <p>
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 * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
26 * Jacobs </a>
27 * @version 1.2 Apr 26, 2004
28 * @since 1.4
29 */
30 public class EventTest extends TestCase
31 {
32 /*** TEST_METHOD is the name of the test method */
33 public static final String TEST_METHOD = "test";
34
35 /***
36 * constructs a new EventIteratorTest.
37 */
38 public EventTest()
39 {
40 this(TEST_METHOD);
41 }
42
43 /***
44 * constructs a new EventIteratorTest
45 *
46 * @param method the name of the test method
47 */
48 public EventTest(final String method)
49 {
50 super(method);
51 }
52
53 /***
54 * tests the classes in the reference class.
55 */
56 public void test()
57 {
58 Object source = this;
59 EventType eventType = new EventType("TEST_TYPE");
60 Object content = new Object();
61
62
63 EventInterface event = new Event(eventType, source, content);
64 Assert.assertEquals(event.getContent(), content);
65 Assert.assertEquals(event.getSource(), source);
66 Assert.assertEquals(event.getType(), eventType);
67 }
68 }