Package org.djutils.event
Class EventPubSubTest
java.lang.Object
org.djutils.event.EventPubSubTest
Test the EventProducer and EventListener.
Copyright (c) 2002-2024 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
Modifier and TypeClassDescriptionprotected static class
protected static class
protected static class
protected static class
EventPubSubTest.TestTimedEventListener<C extends Comparable<C> & Serializable>
TimedEventListener. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Test the EventProducer for a weak reference that is removed by the garbage collector.void
Test the EventProducer and EventListener.void
Test the EventProducer for strong and weak references, and for position information.void
Test the EventProducer and EventListener for verified / unverified events.void
Test the EventProducer and EventListener for two events with the same name being equal...void
Test the EventProducer and EventListener for TimedEvents.void
Test the EventProducer and EventListener for verified / unverified timed events.
-
Constructor Details
-
EventPubSubTest
public EventPubSubTest()
-
-
Method Details
-
testEventPubSub
@Test public void testEventPubSub()Test the EventProducer and EventListener. -
testEventVerificationPubSub
@Test public void testEventVerificationPubSub()Test the EventProducer and EventListener for verified / unverified events. -
testTimedEventPubSub
@Test public void testTimedEventPubSub()Test the EventProducer and EventListener for TimedEvents. -
testTimedEventVerificationPubSub
@Test public void testTimedEventVerificationPubSub()Test the EventProducer and EventListener for verified / unverified timed events. -
testIllegalEventProducer
@Test public void testIllegalEventProducer()Test the EventProducer and EventListener for two events with the same name being equal... -
testEventStrongWeakPos
@Test 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
@Test 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
-