Package org.djutils.event.remote
Class RemoteEventPubSubTest
java.lang.Object
org.djutils.event.remote.RemoteEventPubSubTest
RemoteEventTest makes some very basic tests for the RemoteEventListener and RemoteEventProducer.
Copyright (c) 2019-2024 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
Modifier and TypeClassDescriptionprotected static class
protected static class
protected static class
RemoteTimedEventListener. -
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 for strong and weak references, and for position information.void
Test the construction of the RemoteEventListsner and RemoteEventProducer.void
Test the RemoteEventProducer and RemoteEventListener for verified / unverified events.void
Test the RemoteEventProducer and RemoteTimedEventListener for verified / unverified events.void
Test the construction of the RemoteEventListsner and RemoteEventProducer.
-
Constructor Details
-
RemoteEventPubSubTest
public RemoteEventPubSubTest()
-
-
Method Details
-
testRemoteEventListenerProducer
@Test public void testRemoteEventListenerProducer() throws RemoteException, AlreadyBoundException, MalformedURLExceptionTest 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
@Test public void testRemoteEventVerificationPubSub() throws RemoteException, AlreadyBoundException, MalformedURLExceptionTest 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
@Test public void testTimedRemoteEventListenerProducer() throws RemoteException, AlreadyBoundException, MalformedURLExceptionTest 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
@Test public void testRemoteTimedEventVerificationPubSub() throws RemoteException, AlreadyBoundException, MalformedURLExceptionTest 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
@Test public void testEventStrongWeakPos() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, RemoteException, AlreadyBoundExceptionTest 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
@Test public void testEventProducerWeakRemoval() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, RemoteException, AlreadyBoundExceptionTest 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
-