Search in sources :

Example 21 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq by apache.

the class SendMessageProcessorTest method testProcessRequest.

@Test
public void testProcessRequest() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.PUT_OK, new AppendMessageResult(AppendMessageStatus.PUT_OK)));
    assertPutResult(ResponseCode.SUCCESS);
}
Also used : PutMessageResult(org.apache.rocketmq.store.PutMessageResult) MessageExtBrokerInner(org.apache.rocketmq.store.MessageExtBrokerInner) AppendMessageResult(org.apache.rocketmq.store.AppendMessageResult) Test(org.junit.Test)

Example 22 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq by apache.

the class SendMessageProcessorTest method testProcessRequest_CreateMappedFileFailed.

@Test
public void testProcessRequest_CreateMappedFileFailed() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
    assertPutResult(ResponseCode.SYSTEM_ERROR);
}
Also used : PutMessageResult(org.apache.rocketmq.store.PutMessageResult) MessageExtBrokerInner(org.apache.rocketmq.store.MessageExtBrokerInner) AppendMessageResult(org.apache.rocketmq.store.AppendMessageResult) Test(org.junit.Test)

Aggregations

AppendMessageResult (org.apache.rocketmq.store.AppendMessageResult)22 MessageExtBrokerInner (org.apache.rocketmq.store.MessageExtBrokerInner)22 PutMessageResult (org.apache.rocketmq.store.PutMessageResult)22 Test (org.junit.Test)22 ArrayList (java.util.ArrayList)2 SendMessageContext (org.apache.rocketmq.broker.mqtrace.SendMessageContext)2 SendMessageHook (org.apache.rocketmq.broker.mqtrace.SendMessageHook)2 RemotingCommand (org.apache.rocketmq.remoting.protocol.RemotingCommand)2