Package org.djutils.event.remote
Class RemoteEventPubSubTest
- java.lang.Object
-
- org.djutils.event.remote.RemoteEventPubSubTest
-
public class RemoteEventPubSubTest extends Object
RemoteEventTest makes some very basic tests for the RemoteEventListener and RemoteEventProducer.Copyright (c) 2019-2021 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.- Author:
- Alexander Verbraeck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
RemoteEventPubSubTest.TestRemoteEventListener
protected static class
RemoteEventPubSubTest.TestRemoteEventProducer
protected static class
RemoteEventPubSubTest.TestRemoteTimedEventListener<C extends Comparable<C> & Serializable>
RemoteTimedEventListener.
-
Constructor Summary
Constructors Constructor Description RemoteEventPubSubTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testEventProducerWeakRemoval()
Test the EventProducer for a weak reference that is removed by the garbage collector.void
testEventStrongWeakPos()
Test the EventProducer for strong and weak references, and for position information.void
testRemoteEventListenerProducer()
Test the construction of the RemoteEventListsner and RemoteEventProducer.void
testRemoteEventVerificationPubSub()
Test the RemoteEventProducer and RemoteEventListener for verified / unverified events.void
testRemoteTimedEventVerificationPubSub()
Test the RemoteEventProducer and RemoteTimedEventListener for verified / unverified events.void
testTimedRemoteEventListenerProducer()
Test the construction of the RemoteEventListsner and RemoteEventProducer.
-
-
-
Method Detail
-
testRemoteEventListenerProducer
public void testRemoteEventListenerProducer() throws RemoteException, AlreadyBoundException, MalformedURLException
Test the construction of the RemoteEventListsner and RemoteEventProducer.- Throws:
RemoteException
- on remote errorAlreadyBoundException
- when producer or listener is already bound in the RMI registryMalformedURLException
- on URL error
-
testRemoteEventVerificationPubSub
public void testRemoteEventVerificationPubSub() throws RemoteException, AlreadyBoundException, MalformedURLException
Test the RemoteEventProducer and RemoteEventListener for verified / unverified events.- Throws:
RemoteException
- on remote errorAlreadyBoundException
- when producer or listener is already bound in the RMI registryMalformedURLException
- on URL error
-
testTimedRemoteEventListenerProducer
public void testTimedRemoteEventListenerProducer() throws RemoteException, AlreadyBoundException, MalformedURLException
Test the construction of the RemoteEventListsner and RemoteEventProducer.- Throws:
RemoteException
- on remote errorAlreadyBoundException
- when producer or listener is already bound in the RMI registryMalformedURLException
- on URL error
-
testRemoteTimedEventVerificationPubSub
public void testRemoteTimedEventVerificationPubSub() throws RemoteException, AlreadyBoundException, MalformedURLException
Test the RemoteEventProducer and RemoteTimedEventListener for verified / unverified events.- Throws:
RemoteException
- on remote errorAlreadyBoundException
- when producer or listener is already bound in the RMI registryMalformedURLException
- on URL error
-
testEventStrongWeakPos
public void testEventStrongWeakPos() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, RemoteException, AlreadyBoundException
Test 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 mapRemoteException
- on network exceptionAlreadyBoundException
- when RMI registry not cleaned
-
testEventProducerWeakRemoval
public void testEventProducerWeakRemoval() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, RemoteException, AlreadyBoundException
Test 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 mapRemoteException
- on network exceptionAlreadyBoundException
- when RMI registry not cleaned
-
-