public class RemoteBrokerTest extends Object
RemoteBroker works as expected.| Constructor and Description |
|---|
RemoteBrokerTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
aClosedOrCanceledPendingOrderShouldBeRemovedFromTheMapping()
When the user closes or cancels a
PendingOrder it should be removed from the PendingOrder to id
mapping to prevent memory leaks. |
void |
changeCloseConditionsOfAnUnknownPendingOrderShouldFail()
When the
ExpertAdvisor tries to change the CloseConditions of an order that was already closed or
canceled placed, an LoopThroughIllegalStateException should be thrown. |
void |
closeOrCancelAnAlreadyClosedOrCanceledOrderShouldFail()
When the
ExpertAdvisor tries to close or cancel an already closed or canceled order, an
LoopThroughIllegalStateException should be thrown. |
void |
setUpMocks()
Sets up the default behavior of the mocks.
|
void |
shouldCloseOrCancelPendingOrdersCorrectly()
When the
ExpertAdvisor requests the closing of a PendingOrder it should be send correctly to the
remote Broker. |
void |
shouldInformTheExpertAdvisorWhenSendingAPendingOrderFailed()
When the expert advisor tried to send a pending order but the remote broker failed to place this order, the
expert advisor should be notified.
|
void |
shouldRegisterPendingOrderIdWithTheReceivedOrderEventListenerWhenSendingAPendingOrder()
When an
PendingOrder is send to a remote Broker, the remote broker sends back the id of the
PendingOrder. |
void |
shouldSendPendingOrdersCorrectly()
When the
ExpertAdvisor creates a PendingOrder the protocol should send it to the remote broker. |
void |
shouldSentCloseConditionChangesOfPendingOrdersCorrectly()
When the user changes the
CloseConditions of an order, the cut should send this request to the remote
broker correctly. |
void |
whenChangingCloseConditionsFailedTheExpertAdvisorShouldBeInformed()
When changing the
CloseConditions failed on the remote side, the ExpertAdvisor should be informed
correctly. |
public void setUpMocks()
throws de.voidnode.trading4j.server.protocol.CommunicationException
de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldSendPendingOrdersCorrectly()
throws de.voidnode.trading4j.server.protocol.CommunicationException
ExpertAdvisor creates a PendingOrder the protocol should send it to the remote broker.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldRegisterPendingOrderIdWithTheReceivedOrderEventListenerWhenSendingAPendingOrder()
throws de.voidnode.trading4j.server.protocol.CommunicationException
PendingOrder is send to a remote Broker, the remote broker sends back the id of the
PendingOrder. This id should be registered in the PendingOrderMapper with the
OrderEventListener that was received.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldInformTheExpertAdvisorWhenSendingAPendingOrderFailed()
throws de.voidnode.trading4j.server.protocol.CommunicationException
de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldCloseOrCancelPendingOrdersCorrectly()
throws de.voidnode.trading4j.server.protocol.CommunicationException
ExpertAdvisor requests the closing of a PendingOrder it should be send correctly to the
remote Broker.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void aClosedOrCanceledPendingOrderShouldBeRemovedFromTheMapping()
throws de.voidnode.trading4j.server.protocol.CommunicationException
PendingOrder it should be removed from the PendingOrder to id
mapping to prevent memory leaks.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void closeOrCancelAnAlreadyClosedOrCanceledOrderShouldFail()
throws de.voidnode.trading4j.server.protocol.CommunicationException
ExpertAdvisor tries to close or cancel an already closed or canceled order, an
LoopThroughIllegalStateException should be thrown.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldSentCloseConditionChangesOfPendingOrdersCorrectly()
throws de.voidnode.trading4j.server.protocol.CommunicationException
CloseConditions of an order, the cut should send this request to the remote
broker correctly.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void whenChangingCloseConditionsFailedTheExpertAdvisorShouldBeInformed()
throws de.voidnode.trading4j.server.protocol.CommunicationException
CloseConditions failed on the remote side, the ExpertAdvisor should be informed
correctly.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void changeCloseConditionsOfAnUnknownPendingOrderShouldFail()
throws de.voidnode.trading4j.server.protocol.CommunicationException
ExpertAdvisor tries to change the CloseConditions of an order that was already closed or
canceled placed, an LoopThroughIllegalStateException should be thrown.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.Copyright © 2016. All rights reserved.