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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classRMITest.ListenerListener object.static interfaceRMITest.ListenerInterfaceListenerInterface for remote listener object.classRMITest.ProducerProducer object.static interfaceRMITest.ProducerInterfaceproducerInterface for remote producer object.protected static classRMITest.RemoteObjectA test remote object. -
Constructor Summary
Constructors Constructor Description RMITest() -
Method Summary
Modifier and Type Method Description voidtestRMIObject()Test the RMIObject class, and test the RMI communication between objects.voidtestRMIRegistry()Test the RMI utilities for creating and destroying an RMI registry.voidtestRMIRegistryLocalHost()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 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
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
-