Package org.djutils.rmi
Class RMITest
java.lang.Object
org.djutils.rmi.RMITest
RMITest tests the RMIUtils class and the RMIObject class. Note that port 1099 should be opened for 'localhost' for this test.
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 TypeClassDescriptionclass
Listener object.static interface
ListenerInterface for remote listener object.class
Producer object.static interface
producerInterface for remote producer object.protected static class
A test remote object. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Test the RMIObject class, and test the RMI communication between objects.void
Test the RMI utilities for creating and destroying an RMI registry.void
Test the creation of the RMIRegistry on several versions of localhost (as IP address, using the name, using 127.0.0.1, and using the localhst string).
-
Constructor Details
-
RMITest
public RMITest()
-
-
Method Details
-
testRMIRegistry
@Test public void testRMIRegistry() throws RemoteException, AlreadyBoundException, NotBoundExceptionTest the RMI utilities for creating and destroying an RMI registry.- Throws:
RemoteException
- on RMI errorAlreadyBoundException
- when object was already bound (and should not have been there)NotBoundException
- when object ould not be found in registry (and should have been there)
-
testRMIRegistryLocalHost
Test the creation of the RMIRegistry on several versions of localhost (as IP address, using the name, using 127.0.0.1, and using the localhst string).- Throws:
UnknownHostException
- when the IP address or name of the localhost cannot be retrieved
-
testRMIObject
@Test public void testRMIObject() throws RemoteException, AlreadyBoundException, NotBoundException, MalformedURLExceptionTest the RMIObject class, and test the RMI communication between objects.- Throws:
AlreadyBoundException
- when producer is already thereRemoteException
- on RMI errorNotBoundException
- when Listener cnnot find producerMalformedURLException
- when the test creating RMI regsirt from URL goes wrong
-