Permalink
Browse files

ns

  • Loading branch information...
1 parent ff1d875 commit 031e9f70dbf9e0e5435d4622ea2834e97af3d2c4 Bela Ban committed Dec 19, 2010
Showing with 22 additions and 1 deletion.
  1. +22 −1 tests/junit/org/jgroups/tests/DuplicateTest.java
@@ -3,6 +3,7 @@
import org.jgroups.*;
import org.jgroups.protocols.DUPL;
+import org.jgroups.protocols.UNICAST2;
import org.jgroups.protocols.pbcast.NAKACK;
import org.jgroups.protocols.pbcast.STABLE;
import org.jgroups.stack.ProtocolStack;
@@ -50,14 +51,15 @@ void init() throws Exception {
@AfterMethod
void tearDown() throws Exception {
+ removeDUPL(c3, c2, c1);
Util.close(c3, c2, c1);
}
public void testRegularUnicastsToSelf() throws Exception {
send(c1, c1.getAddress(), false, 10);
- sendStableMessages(c1,c2, c3);
+ sendStableMessages(c1, c2, c3);
check(r1, 1, false, new Tuple<Address,Integer>(a1, 10));
}
@@ -164,6 +166,25 @@ private static void sendStableMessages(JChannel ... channels) {
}
}
+ protected static void removeDUPL(JChannel ... channels) {
+ for(JChannel ch: channels) {
+ DUPL dupl=(DUPL)ch.getProtocolStack().findProtocol(DUPL.class);
+ if(dupl != null) {
+ dupl.setCopyMulticastMsgs(false);
+ dupl.setCopyUnicastMsgs(false);
+ }
+ }
+ }
+
+
+ private static void sendUnicastStableMessages(JChannel ... channels) {
+ for(JChannel ch: channels) {
+ UNICAST2 unicast=(UNICAST2)ch.getProtocolStack().findProtocol(UNICAST2.class);
+ if(unicast != null)
+ unicast.sendStableMessages();
+ }
+ }
+
private void createChannels(boolean copy_multicasts, boolean copy_unicasts, int num_outgoing_copies, int num_incoming_copies) throws Exception {
c1=createChannel(true, 3);

0 comments on commit 031e9f7

Please sign in to comment.