Class TransceiverTest
- java.lang.Object
-
- org.opentrafficsim.sim0mq.publisher.TransceiverTest
-
public class TransceiverTest extends java.lang.ObjectUnit tests.Copyright (c) 2020-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.$LastChangedDate: 2020-02-13 11:08:16 +0100 (Thu, 13 Feb 2020) $, @version $Revision: 6383 $, by $Author: pknoppers $,
- Author:
- Peter Knoppers
-
-
Constructor Summary
Constructors Constructor Description TransceiverTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]checkAckNack(TransceiverInterface transceiver, java.lang.Object[] address, java.lang.Boolean expectedAckNack, java.lang.String expectedInPayload)Call the get method of a TransceiverInterface and verify most of the results.voidtestGTUIdTransceiver()Test the GTUIdTransceiver and the GTUTransceiver.voidtestNoTransceiver()Test the constructResultFields method for a class that it cannot handle.voidtestVerifyMetaData()Test the static verifyMetaData method in AbstractTransceiver.
-
-
-
Method Detail
-
testGTUIdTransceiver
public void testGTUIdTransceiver() throws java.rmi.RemoteException, Sim0MQException, SerializationException, NetworkException, OTSGeometryException, SimRuntimeException, javax.naming.NamingException, GTUExceptionTest the GTUIdTransceiver and the GTUTransceiver.- Throws:
java.rmi.RemoteException- if the happens, this test has failedSerializationException- on errorSim0MQException- on errorNetworkException- on errorOTSGeometryException- on errorjavax.naming.NamingException- on errorSimRuntimeException- on errorGTUException- on error
-
checkAckNack
public java.lang.Object[] checkAckNack(TransceiverInterface transceiver, java.lang.Object[] address, java.lang.Boolean expectedAckNack, java.lang.String expectedInPayload) throws java.rmi.RemoteException, Sim0MQException, SerializationException
Call the get method of a TransceiverInterface and verify most of the results.- Parameters:
transceiver- TransceiverInterface; the transceiver to testaddress- Object[]; the argument of the get method of the transceiverexpectedAckNack- Boolean; null if neither an ACK nor a NACK is expected, Boolean.FALSE if a NACK is expected, Boolean.TRUE if an ACK is expectedexpectedInPayload- String; text that should occur in the payload of the ACK or NACK, or null if no ACK or NACK is expected- Returns:
- Object[]; the result of the get method should be null if an ACK or a NACK was received; non-null otherwise
- Throws:
SerializationException- if that happens, this test has failedSim0MQException- if that happens, this test has failedjava.rmi.RemoteException- if that happens, this test has failed
-
testNoTransceiver
public void testNoTransceiver()
Test the constructResultFields method for a class that it cannot handle.
-
testVerifyMetaData
public void testVerifyMetaData()
Test the static verifyMetaData method in AbstractTransceiver.
-
-