Package org.djutils.event
Class EventPubSubTest
java.lang.Object
org.djutils.event.EventPubSubTest
public class EventPubSubTest extends Object
Test the EventProducer and EventListener.
Copyright (c) 2002-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html. This class was originally part of the DSOL project, see https://simulation.tudelft.nl/dsol/manual.
- Author:
- Alexander Verbraeck
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classEventPubSubTest.TestEventListenerprotected static classEventPubSubTest.TestEventProducerprotected static classEventPubSubTest.TestIllegalEventProducerprotected static classEventPubSubTest.TestTimedEventListener<C extends Comparable<C> & Serializable>TimedEventListener. -
Constructor Summary
Constructors Constructor Description EventPubSubTest() -
Method Summary
Modifier and Type Method Description voidtestEventProducerWeakRemoval()Test the EventProducer for a weak reference that is removed by the garbage collector.voidtestEventPubSub()Test the EventProducer and EventListener.voidtestEventStrongWeakPos()Test the EventProducer for strong and weak references, and for position information.voidtestIllegalEventProducer()Test the EventProducer and EventListener for two events with the same name being equal...voidtestTimedEventPubSub()Test the EventProducer and EventListener for TimedEvents.
-
Constructor Details
-
EventPubSubTest
public EventPubSubTest()
-
-
Method Details
-
testEventPubSub
public void testEventPubSub()Test the EventProducer and EventListener. -
testTimedEventPubSub
public void testTimedEventPubSub()Test the EventProducer and EventListener for TimedEvents. -
testIllegalEventProducer
public void testIllegalEventProducer()Test the EventProducer and EventListener for two events with the same name being equal... -
testEventStrongWeakPos
public void testEventStrongWeakPos() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityExceptionTest the EventProducer for strong and weak references, and for position information.- Throws:
SecurityException- on error retrieving listener mapNoSuchFieldException- on error retrieving listener mapIllegalAccessException- on error retrieving listener mapIllegalArgumentException- on error retrieving listener map
-
testEventProducerWeakRemoval
public void testEventProducerWeakRemoval() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityExceptionTest the EventProducer for a weak reference that is removed by the garbage collector.- Throws:
SecurityException- on error retrieving listener mapNoSuchFieldException- on error retrieving listener mapIllegalAccessException- on error retrieving listener mapIllegalArgumentException- on error retrieving listener map
-