Package org.djutils.rmi
Class RMITest
- java.lang.Object
-
- org.djutils.rmi.RMITest
-
public class RMITest extends Object
RMITest tests the RMIUtils class and the RMIObject class. Note that port 1099 should be opened for 'localhost' for this test.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 class
RMITest.Listener
Listener object.static interface
RMITest.ListenerInterface
ListenerInterface for remote listener object.class
RMITest.Producer
Producer object.static interface
RMITest.ProducerInterface
producerInterface for remote producer object.protected static class
RMITest.RemoteObject
A test remote object.
-
Constructor Summary
Constructors Constructor Description RMITest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testRMIObject()
Test the RMIObject class, and test the RMI communication between objects.void
testRMIRegistry()
Test the RMI utilities for creating and destroying an RMI registry.void
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).
-
-
-
Method Detail
-
testRMIRegistry
public void testRMIRegistry() throws RemoteException, AlreadyBoundException, NotBoundException
Test 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
public void testRMIRegistryLocalHost() throws UnknownHostException
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
public void testRMIObject() throws RemoteException, AlreadyBoundException, NotBoundException, MalformedURLException
Test 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
-
-