public class TestUtility extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NewOrderSingle |
Constructor and Description |
---|
TestUtility()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkStorageState(String name,
long inSeqNum,
long outSeqNum,
long previousSeqNum,
boolean negotiated) |
void |
checkStorageSummary(String name,
long[] expectedOutSeqNumbers,
long[] expectedInSeqNumbers) |
void |
checkTestTasks()
Asserts test results by checking each task in the `tasks` collection for stored exceptions.
|
void |
closeServerSocketEmulators() |
void |
connectToEmulator(Session session,
int port)
Connects a Session object to an emulator by performing a logon operation.
|
IMessage |
createBusinessReject() |
Emulator |
createEmulatorAcceptor()
Creates a new Emulator object configured with a default port and adds it to tracking.
|
IMessage |
createEstablishment(long uuid,
long requestTimestamp,
int keepAliveInterval) |
IMessage |
createEstablishmentReject(long uuid,
long requestTimestamp) |
IMessage |
createExecutionReportTradeOutright(long uuid,
long orderId,
boolean retransmission) |
IMessage |
createMassQuote() |
IMessage |
createMassQuoteAck(long uuid,
boolean retransmission) |
IMessage |
createNegotiationReject(long uuid,
long requestTimestamp) |
IMessage |
createNegotiationResponse(long uuid,
long requestTimestamp) |
IMessage |
createNotApplied(long uuid,
long fromSeqNo,
int msgCount) |
IMessage |
createOrder(int orderRequestID) |
IMessage |
createRetransmission(IMessage request) |
IMessage |
createRetransmission(long uuid,
long lastUUID,
long requestTimestamp,
long fromSeqNo,
int msgCount) |
IMessage |
createRetransmitReject(IMessage request,
int errorCodes,
String reason) |
IMessage |
createRetransmitReject(long uuid,
long lastUUID,
long requestTimestamp,
int errorCodes,
String reason) |
IMessage |
createSequence(long uuid,
long nextSeqNo,
int keepAliveLapsed) |
IMessage |
createTerminate(long uuid,
long requestTimestamp,
String reason,
int errorCode) |
IMessage |
createUnknownMessage(int templateId) |
void |
disconnectEmulators()
Disconnects all emulators in the `emulators` collection.
|
ByteDecoder |
getDecoder() |
static int |
getFreePort()
Obtains a free port by attempting to create a temporary ServerSocket.
|
HandlerSettings |
getHandlerSettings() |
MessageSchema |
getMessageSchema() |
SessionSettings |
getSessionSettings() |
TestSettings |
getTestSettings() |
void |
interruptTestTasks()
Iterates through active threads and issues an interrupt signal.
|
void |
launchEmulatorTask(TestTask testTask)
Launches a TestTask by creating a new thread and adding it to tracking.
|
void |
setTemplateFile(String templateFile) |
void |
waitTestTasks()
Waits for all tasks in the `tasks` collection to signal completion.
|
public static final String NewOrderSingle
public TestUtility()
public HandlerSettings getHandlerSettings()
public TestSettings getTestSettings()
public SessionSettings getSessionSettings()
public Emulator createEmulatorAcceptor()
public void connectToEmulator(Session session, int port)
session
- The Session object to be connected.port
- The port number of the emulator.public final void launchEmulatorTask(TestTask testTask)
testTask
- The TestTask to be executed.public void interruptTestTasks()
public void waitTestTasks()
public void checkTestTasks() throws Throwable
Throwable
- Throws an exception if any of the completed tasks had a stored error.public void disconnectEmulators()
public static int getFreePort()
public ByteDecoder getDecoder()
public MessageSchema getMessageSchema()
public IMessage createBusinessReject()
public IMessage createOrder(int orderRequestID)
public IMessage createNegotiationResponse(long uuid, long requestTimestamp)
public IMessage createNegotiationReject(long uuid, long requestTimestamp)
public IMessage createEstablishment(long uuid, long requestTimestamp, int keepAliveInterval)
public IMessage createEstablishmentReject(long uuid, long requestTimestamp)
public IMessage createNotApplied(long uuid, long fromSeqNo, int msgCount)
public IMessage createRetransmission(long uuid, long lastUUID, long requestTimestamp, long fromSeqNo, int msgCount)
public IMessage createRetransmitReject(IMessage request, int errorCodes, String reason)
public IMessage createRetransmitReject(long uuid, long lastUUID, long requestTimestamp, int errorCodes, String reason)
public IMessage createExecutionReportTradeOutright(long uuid, long orderId, boolean retransmission)
public IMessage createMassQuote()
public IMessage createMassQuoteAck(long uuid, boolean retransmission)
public IMessage createTerminate(long uuid, long requestTimestamp, String reason, int errorCode)
public IMessage createSequence(long uuid, long nextSeqNo, int keepAliveLapsed)
public IMessage createUnknownMessage(int templateId)
public void closeServerSocketEmulators()
public void checkStorageState(String name, long inSeqNum, long outSeqNum, long previousSeqNum, boolean negotiated) throws IOException
IOException
public void checkStorageSummary(String name, long[] expectedOutSeqNumbers, long[] expectedInSeqNumbers) throws IOException
IOException
public void setTemplateFile(String templateFile)
Copyright © 2005–2024 Onix Solutions. All rights reserved.