Skip to content

Commit

Permalink
- Added NAKACK4 to NakackTest and NakackUnitTest
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Aug 16, 2024
1 parent 130daa6 commit 7873b7c
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions tests/junit-functional/org/jgroups/tests/NakackUnitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.jgroups.stack.Protocol;
import org.jgroups.util.Util;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.ArrayList;
Expand All @@ -18,24 +19,34 @@
* @author Bela Ban
* @since 3.5
*/
@Test(groups=Global.FUNCTIONAL)
@Test(groups=Global.FUNCTIONAL,singleThreaded=true,dataProvider="create")
public class NakackUnitTest {
protected JChannel a, b;
protected MyReceiver ra, rb;


@AfterMethod protected void tearDown() throws Exception {Util.close(b, a);}

@DataProvider
static Object[][] create() {
return new Object[][]{
{NAKACK2.class},
{NAKACK3.class},
{NAKACK4.class}
};
}


// @Test(invocationCount=10)
public void testMessagesToAllWithDontLoopback() throws Exception {
a=create("A", false); b=create("B", false);
public void testMessagesToAllWithDontLoopback(Class<Protocol> cl) throws Exception {
a=create(cl, "A", false); b=create(cl, "B", false);
createReceivers();
_testMessagesToAllWithDontLoopback();
}

// @Test(invocationCount=10)
public void testMessagesToOtherBatching() throws Exception {
a=create("A", true); b=create("B", true);
public void testMessagesToOtherBatching(Class<Protocol> cl) throws Exception {
a=create(cl, "A", true); b=create(cl, "B", true);
createReceivers();
_testMessagesToAllWithDontLoopback();
}
Expand Down Expand Up @@ -92,12 +103,12 @@ protected void createReceivers() {

protected static Message msg() {return new BytesMessage(null);}

protected static JChannel create(String name, boolean use_batching) throws Exception {
protected static JChannel create(Class<Protocol> cl, String name, boolean use_batching) throws Exception {
Protocol[] protocols={
new SHARED_LOOPBACK(),
new SHARED_LOOPBACK_PING(),
new MAKE_BATCH().sleepTime(100).multicasts(use_batching),
new NAKACK2(),
cl.getConstructor().newInstance(),
new UNICAST3(),
new STABLE(),
new GMS(),
Expand Down

0 comments on commit 7873b7c

Please sign in to comment.