Class TransceiverTest
- java.lang.Object
-
- org.opentrafficsim.sim0mq.publisher.TransceiverTest
-
public class TransceiverTest extends Object
Unit 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 Object[]checkAckNack(TransceiverInterface transceiver, Object[] address, Boolean expectedAckNack, 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 RemoteException, Sim0MQException, SerializationException, NetworkException, OTSGeometryException, SimRuntimeException, NamingException, GTUExceptionTest the GTUIdTransceiver and the GTUTransceiver.- Throws:
RemoteException- if the happens, this test has failedSerializationException- on errorSim0MQException- on errorNetworkException- on errorOTSGeometryException- on errorNamingException- on errorSimRuntimeException- on errorGTUException- on error
-
checkAckNack
public Object[] checkAckNack(TransceiverInterface transceiver, Object[] address, Boolean expectedAckNack, String expectedInPayload) throws 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 failedRemoteException- 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.
-
-