Search in sources :

Example 1 with RemoveInfo

use of org.apache.activemq.command.RemoveInfo in project activemq-artemis by apache.

the class RemoveInfoTest method createObject.

@Override
public Object createObject() throws Exception {
    RemoveInfo info = new RemoveInfo();
    populateObject(info);
    return info;
}
Also used : RemoveInfo(org.apache.activemq.command.RemoveInfo)

Example 2 with RemoveInfo

use of org.apache.activemq.command.RemoveInfo in project activemq-artemis by apache.

the class RemoveInfoTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    RemoveInfo info = (RemoveInfo) object;
    info.setObjectId(createDataStructure("ObjectId:1"));
    info.setLastDeliveredSequenceId(1);
}
Also used : RemoveInfo(org.apache.activemq.command.RemoveInfo)

Example 3 with RemoveInfo

use of org.apache.activemq.command.RemoveInfo in project activemq-artemis by apache.

the class RemoveInfoTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    RemoveInfo info = (RemoveInfo) object;
    info.setObjectId(createDataStructure("ObjectId:1"));
    info.setLastDeliveredSequenceId(1);
}
Also used : RemoveInfo(org.apache.activemq.command.RemoveInfo)

Example 4 with RemoveInfo

use of org.apache.activemq.command.RemoveInfo in project activemq-artemis by apache.

the class NetworkRouteTest method addAndRemoveOppositeOrder.

@Test
public void addAndRemoveOppositeOrder() throws Exception {
    // from (1)
    localBroker.request(EasyMock.isA(ConsumerInfo.class));
    ArgHolder localConsumer = ArgHolder.holdArgsForLastObjectCall();
    // from (2a)
    remoteBroker.asyncRequest(EasyMock.isA(ActiveMQMessage.class), EasyMock.isA(ResponseCallback.class));
    ArgHolder firstMessageFuture = ArgHolder.holdArgsForLastFutureRequestCall();
    localBroker.oneway(EasyMock.isA(MessageAck.class));
    // from (2b)
    remoteBroker.asyncRequest(EasyMock.isA(ActiveMQMessage.class), EasyMock.isA(ResponseCallback.class));
    ArgHolder secondMessageFuture = ArgHolder.holdArgsForLastFutureRequestCall();
    localBroker.oneway(EasyMock.isA(MessageAck.class));
    // from (3)
    localBroker.oneway(EasyMock.isA(RemoveInfo.class));
    ExpectationWaiter waitForRemove = ExpectationWaiter.waiterForLastVoidCall();
    control.replay();
    // (1) send advisory of path 1
    remoteListener.onCommand(path1Msg);
    msgDispatch.setConsumerId(((ConsumerInfo) localConsumer.arguments[0]).getConsumerId());
    // send advisory of path 2, doesn't send a ConsumerInfo to localBroker
    remoteListener.onCommand(path2Msg);
    // (2a) send a message
    localListener.onCommand(msgDispatch);
    ResponseCallback callback = (ResponseCallback) firstMessageFuture.arguments[1];
    FutureResponse response = new FutureResponse(callback);
    response.set(new Response());
    // send advisory of path 2 remove, doesn't send a RemoveInfo to localBroker
    remoteListener.onCommand(removePath2Msg);
    // (2b) send a message
    localListener.onCommand(msgDispatch);
    callback = (ResponseCallback) secondMessageFuture.arguments[1];
    response = new FutureResponse(callback);
    response.set(new Response());
    // (3) send advisory of path 1 remove, sends a RemoveInfo to localBroker
    remoteListener.onCommand(removePath1Msg);
    waitForRemove.assertHappens(5, TimeUnit.SECONDS);
    // send a message, does not send message as in 2a and 2b
    localListener.onCommand(msgDispatch);
    control.verify();
}
Also used : Response(org.apache.activemq.command.Response) FutureResponse(org.apache.activemq.transport.FutureResponse) ConsumerInfo(org.apache.activemq.command.ConsumerInfo) RemoveInfo(org.apache.activemq.command.RemoveInfo) FutureResponse(org.apache.activemq.transport.FutureResponse) ResponseCallback(org.apache.activemq.transport.ResponseCallback) MessageAck(org.apache.activemq.command.MessageAck) ActiveMQMessage(org.apache.activemq.command.ActiveMQMessage) Test(org.junit.Test)

Example 5 with RemoveInfo

use of org.apache.activemq.command.RemoveInfo in project activemq-artemis by apache.

the class RemoveInfoTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    RemoveInfo info = (RemoveInfo) object;
    info.setObjectId(createDataStructure("ObjectId:1"));
}
Also used : RemoveInfo(org.apache.activemq.command.RemoveInfo)

Aggregations

RemoveInfo (org.apache.activemq.command.RemoveInfo)28 ConsumerInfo (org.apache.activemq.command.ConsumerInfo)8 ConnectionInfo (org.apache.activemq.command.ConnectionInfo)6 StubConnection (org.apache.activemq.broker.StubConnection)5 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)5 Message (org.apache.activemq.command.Message)5 SessionInfo (org.apache.activemq.command.SessionInfo)5 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)4 MessageAck (org.apache.activemq.command.MessageAck)4 Test (org.junit.Test)4 ActiveMQMessage (org.apache.activemq.command.ActiveMQMessage)3 ConnectionId (org.apache.activemq.command.ConnectionId)3 ProducerInfo (org.apache.activemq.command.ProducerInfo)2 Response (org.apache.activemq.command.Response)2 FutureResponse (org.apache.activemq.transport.FutureResponse)2 ResponseCallback (org.apache.activemq.transport.ResponseCallback)2 IOException (java.io.IOException)1 BrokerService (org.apache.activemq.broker.BrokerService)1 ActiveMQTopic (org.apache.activemq.command.ActiveMQTopic)1 BrokerId (org.apache.activemq.command.BrokerId)1