Class TransceiverTest
- java.lang.Object
-
- org.opentrafficsim.sim0mq.publisher.TransceiverTest
-
public class TransceiverTest extends Object
Unit tests.Copyright (c) 2020-2022 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
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Boolean
lastAckNack
Storage for the last ACK or NACK value submitted to the ReturnWrapper.(package private) Serializable
lastContent
Storage for last content submitted to notify method in EventListenerInterface.(package private) Object[]
lastPayload
Storage for the last payload submitted to the ReturnWrapper.(package private) Time
lastTime
Time stamp of last notify event.
-
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.void
testGTUIdTransceiver()
Test the GTUIdTransceiver and the GTUTransceiver.void
testNoTransceiver()
Test the constructResultFields method for a class that it cannot handle.void
testVerifyMetaData()
Test the static verifyMetaData method in AbstractTransceiver.
-
-
-
Field Detail
-
lastAckNack
Boolean lastAckNack
Storage for the last ACK or NACK value submitted to the ReturnWrapper.
-
lastPayload
Object[] lastPayload
Storage for the last payload submitted to the ReturnWrapper.
-
lastContent
Serializable lastContent
Storage for last content submitted to notify method in EventListenerInterface.
-
lastTime
Time lastTime
Time stamp of last notify event.
-
-
Method Detail
-
testGTUIdTransceiver
public void testGTUIdTransceiver() throws RemoteException, Sim0MQException, SerializationException, org.opentrafficsim.core.network.NetworkException, org.opentrafficsim.core.geometry.OTSGeometryException, SimRuntimeException, NamingException, org.opentrafficsim.core.gtu.GTUException
Test the GTUIdTransceiver and the GTUTransceiver.- Throws:
RemoteException
- if the happens, this test has failedSerializationException
- on errorSim0MQException
- on errororg.opentrafficsim.core.network.NetworkException
- on errororg.opentrafficsim.core.geometry.OTSGeometryException
- on errorNamingException
- on errorSimRuntimeException
- on errororg.opentrafficsim.core.gtu.GTUException
- 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.
-
-