Browse files

passing own address to getState(target, timeout)

  • Loading branch information...
1 parent 5127f89 commit 4fc0fd1800ca9b18367ef5ff798731c2aa5c9b9a @belaban committed Dec 21, 2010
Showing with 6 additions and 8 deletions.
  1. +6 −8 tests/junit/org/jgroups/tests/StateTransferTest.java
View
14 tests/junit/org/jgroups/tests/StateTransferTest.java
@@ -1,9 +1,6 @@
package org.jgroups.tests;
-import org.jgroups.Channel;
-import org.jgroups.Global;
-import org.jgroups.JChannel;
-import org.jgroups.Message;
+import org.jgroups.*;
import org.jgroups.util.Util;
import org.testng.annotations.Test;
@@ -19,7 +16,7 @@
* Tests correct state transfer while other members continue sending messages to the group
* @author Bela Ban
*/
-@Test(groups=Global.STACK_DEPENDENT,sequential=false)
+@Test(groups=Global.STACK_DEPENDENT,sequential=true)
public class StateTransferTest extends ChannelTestBase {
static final int MSG_SEND_COUNT=5000;
static final String[] names= { "A", "B", "C", "D"};
@@ -30,8 +27,10 @@ public void testStateTransferFromSelfWithRegularChannel() throws Exception {
Channel ch=createChannel(true);
ch.connect("StateTransferTest");
try {
- boolean rc=ch.getState(null, 2000);
- assert !rc : "getState() on singleton should return false";
+ Address self=ch.getAddress();
+ assert self != null;
+ boolean rc=ch.getState(self, 20000);
+ assert !rc : "getState() on self should return false";
}
finally {
ch.close();
@@ -188,7 +187,6 @@ public void setState(byte[] state) {
catch(Exception e) {
e.printStackTrace();
}
-
}
}

0 comments on commit 4fc0fd1

Please sign in to comment.