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 class
EventPubSubTest.TestEventListener
protected static class
EventPubSubTest.TestEventProducer
protected static class
EventPubSubTest.TestIllegalEventProducer
protected static class
EventPubSubTest.TestTimedEventListener<C extends Comparable<C> & Serializable>
TimedEventListener. -
Constructor Summary
Constructors Constructor Description EventPubSubTest()
-
Method Summary
Modifier and Type Method Description void
testEventProducerWeakRemoval()
Test the EventProducer for a weak reference that is removed by the garbage collector.void
testEventPubSub()
Test the EventProducer and EventListener.void
testEventStrongWeakPos()
Test the EventProducer for strong and weak references, and for position information.void
testEventVerificationPubSub()
Test the EventProducer and EventListener for verified / unverified events.void
testIllegalEventProducer()
Test the EventProducer and EventListener for two events with the same name being equal...void
testTimedEventPubSub()
Test the EventProducer and EventListener for TimedEvents.void
testTimedEventVerificationPubSub()
Test the EventProducer and EventListener for verified / unverified timed events.
-
Constructor Details
-
EventPubSubTest
public EventPubSubTest()
-
-
Method Details
-
testEventPubSub
public void testEventPubSub()Test the EventProducer and EventListener. -
testEventVerificationPubSub
public void testEventVerificationPubSub()Test the EventProducer and EventListener for verified / unverified events. -
testTimedEventPubSub
public void testTimedEventPubSub()Test the EventProducer and EventListener for TimedEvents. -
testTimedEventVerificationPubSub
public void testTimedEventVerificationPubSub()Test the EventProducer and EventListener for verified / unverified timed events. -
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
-