Search in sources :

Example 51 with DistributionMessage

use of org.apache.geode.distributed.internal.DistributionMessage in project geode by apache.

the class JGroupsMessengerJUnitTest method alertMessagesBypassFlowControl.

@Test
public void alertMessagesBypassFlowControl() throws Exception {
    initMocks(false);
    Message jgmsg = new Message();
    DistributionMessage dmsg = mock(DistributionMessage.class);
    when(dmsg.getProcessorType()).thenReturn(DistributionManager.SERIAL_EXECUTOR);
    messenger.setMessageFlags(dmsg, jgmsg);
    assertFalse("expected no_fc to not be set in " + jgmsg.getFlags(), jgmsg.isFlagSet(Message.Flag.NO_FC));
    AlertAppender.setIsAlerting(true);
    try {
        messenger.setMessageFlags(dmsg, jgmsg);
        assertTrue("expected no_fc to be set in " + jgmsg.getFlags(), jgmsg.isFlagSet(Message.Flag.NO_FC));
    } finally {
        AlertAppender.setIsAlerting(false);
    }
}
Also used : DistributionMessage(org.apache.geode.distributed.internal.DistributionMessage) JoinRequestMessage(org.apache.geode.distributed.internal.membership.gms.messages.JoinRequestMessage) LeaveRequestMessage(org.apache.geode.distributed.internal.membership.gms.messages.LeaveRequestMessage) InstallViewMessage(org.apache.geode.distributed.internal.membership.gms.messages.InstallViewMessage) JoinResponseMessage(org.apache.geode.distributed.internal.membership.gms.messages.JoinResponseMessage) SerialAckedMessage(org.apache.geode.distributed.internal.SerialAckedMessage) Message(org.jgroups.Message) DistributionMessage(org.apache.geode.distributed.internal.DistributionMessage) Test(org.junit.Test) MembershipTest(org.apache.geode.test.junit.categories.MembershipTest) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Aggregations

DistributionMessage (org.apache.geode.distributed.internal.DistributionMessage)51 Test (org.junit.Test)34 DistributionManager (org.apache.geode.distributed.internal.DistributionManager)29 DistributionMessageObserver (org.apache.geode.distributed.internal.DistributionMessageObserver)29 VM (org.apache.geode.test.dunit.VM)28 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)28 Host (org.apache.geode.test.dunit.Host)27 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)22 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)13 IOException (java.io.IOException)11 AsyncInvocation (org.apache.geode.test.dunit.AsyncInvocation)11 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)11 Cache (org.apache.geode.cache.Cache)9 IgnoredException (org.apache.geode.test.dunit.IgnoredException)9 DistributedSystemDisconnectedException (org.apache.geode.distributed.DistributedSystemDisconnectedException)8 DataInputStream (java.io.DataInputStream)7 RequestImageMessage (org.apache.geode.internal.cache.InitialImageOperation.RequestImageMessage)7 Properties (java.util.Properties)6 CacheClosedException (org.apache.geode.cache.CacheClosedException)6 Region (org.apache.geode.cache.Region)6