Search in sources :

Example 86 with Protocol

use of org.jgroups.stack.Protocol in project JGroups by belaban.

the class ConfiguratorTest method testAddingAboveTop.

public void testAddingAboveTop() throws Exception {
    Protocol new_prot = new TRACE();
    stack.insertProtocol(new_prot, ProtocolStack.Position.ABOVE, MFC.class);
    List<Protocol> protocols = stack.getProtocols();
    Assert.assertEquals(7, protocols.size());
    assert protocols.get(0).getName().endsWith("TRACE");
    assert stack.getTopProtocol().getUpProtocol() != null;
    assert stack.getTopProtocol().getDownProtocol() != null;
    assert stack.getTopProtocol().getDownProtocol().getUpProtocol() != null;
    assert stack.getTopProtocol().getDownProtocol().getDownProtocol() != null;
}
Also used : Protocol(org.jgroups.stack.Protocol)

Example 87 with Protocol

use of org.jgroups.stack.Protocol in project JGroups by belaban.

the class ConfiguratorTest method testAddingBelowBottom.

@Test(expectedExceptions = { IllegalArgumentException.class })
public void testAddingBelowBottom() throws Exception {
    Protocol new_prot = new TRACE();
    stack.insertProtocol(new_prot, ProtocolStack.Position.BELOW, UDP.class);
}
Also used : Protocol(org.jgroups.stack.Protocol) Test(org.testng.annotations.Test)

Aggregations

Protocol (org.jgroups.stack.Protocol)87 NAKACK2 (org.jgroups.protocols.pbcast.NAKACK2)18 JChannel (org.jgroups.JChannel)17 GMS (org.jgroups.protocols.pbcast.GMS)17 STABLE (org.jgroups.protocols.pbcast.STABLE)13 ProtocolStack (org.jgroups.stack.ProtocolStack)12 ArrayList (java.util.ArrayList)9 Test (org.testng.annotations.Test)9 Property (org.jgroups.annotations.Property)6 HashMap (java.util.HashMap)5 ForkProtocol (org.jgroups.fork.ForkProtocol)5 ForkProtocolStack (org.jgroups.fork.ForkProtocolStack)5 InetAddress (java.net.InetAddress)4 ProtocolConfiguration (org.jgroups.conf.ProtocolConfiguration)4 OperationFailedException (org.jboss.as.controller.OperationFailedException)3 Message (org.jgroups.Message)3 FORK (org.jgroups.protocols.FORK)3 UNICAST3 (org.jgroups.protocols.UNICAST3)3 BeforeMethod (org.testng.annotations.BeforeMethod)3 Method (java.lang.reflect.Method)2