Search in sources :

Example 16 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class SendMessageProcessorTest method testProcessRequest_PropertiesTooLong.

@Test
public void testProcessRequest_PropertiesTooLong() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.PROPERTIES_SIZE_EXCEEDED, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
    assertPutResult(ResponseCode.MESSAGE_ILLEGAL);
}
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 17 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class SendMessageProcessorTest method testProcessRequest_ServiceNotAvailable.

@Test
public void testProcessRequest_ServiceNotAvailable() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.SERVICE_NOT_AVAILABLE, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
    assertPutResult(ResponseCode.SERVICE_NOT_AVAILABLE);
}
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 18 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

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)

Example 19 with AppendMessageResult

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

the class SendMessageProcessorTest method testProcessRequest_SlaveNotAvailable.

@Test
public void testProcessRequest_SlaveNotAvailable() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.SLAVE_NOT_AVAILABLE, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
    assertPutResult(ResponseCode.SLAVE_NOT_AVAILABLE);
}
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 20 with AppendMessageResult

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

the class SendMessageProcessorTest method testProcessRequest_PageCacheBusy.

@Test
public void testProcessRequest_PageCacheBusy() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.OS_PAGECACHE_BUSY, 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