<commit_before>package org.jgroups.blocks;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jgroups.JChannel;

public class VotingAdapterTest extends TestCase {

    public static final String SERVER_PROTOCOL_STACK =
            "UDP(mcast_addr=192.168.3.11;mcast_port=12345;ip_ttl=1;"
                    + "mcast_send_buf_size=150000;mcast_recv_buf_size=80000)"
//        + "JMS(topicName=topic/testTopic;cf=UILConnectionFactory;"
//        + "jndiCtx=org.jnp.interfaces.NamingContextFactory;"
//        + "providerURL=localhost;ttl=10000)"
                    + ":PING(timeout=500;num_initial_members=1)"
                    + ":FD"
                    + ":VERIFY_SUSPECT(timeout=1500)"
                    + ":pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800)"
                    + ":FRAG(frag_size=4096)"
                    + ":UNICAST(timeout=5000)"
                    + ":pbcast.STABLE(desired_avg_gossip=200)"
                    + ":pbcast.GMS(join_timeout=5000;join_retry_timeout=1000;"
                    +     "shun=false;print_local_addr=false)"
                    //+ ":SPEED_LIMIT(down_queue_limit=10)"
                    + ":pbcast.STATE_TRANSFER"
            ;


    public VotingAdapterTest(String testName) {
            super(testName);
    }

    public static Test suite() {
            return new TestSuite(VotingAdapterTest.class);
    }

    
    private JChannel channel1;
    private JChannel channel2;

    protected VotingAdapter adapter1;
    protected VotingAdapter adapter2;

    protected TestVoteChannelListener listener1;
    protected TestVoteChannelListener listener2;
    protected TestVoteChannelListener listener3;
    protected TestVoteChannelListener listener4;

    protected static boolean logConfigured=false;

    public void setUp() throws Exception {
        super.setUp();
        listener1=new TestVoteChannelListener(true);
        listener2=new TestVoteChannelListener(true);
        listener3=new TestVoteChannelListener(false);
        listener4=new TestVoteChannelListener(false);

        channel1=new JChannel(SERVER_PROTOCOL_STACK);
        adapter1=new VotingAdapter(channel1);

        channel1.connect("voting");

        // give some time for the channel to become a coordinator
        try {
            Thread.sleep(1000);
        }
        catch(Exception ex) {
        }

        channel2=new JChannel(SERVER_PROTOCOL_STACK);
        adapter2=new VotingAdapter(channel2);

        channel2.connect("voting");<commit_msg>upgrade to new test framework<commit_after>package org.jgroups.blocks;

import junit.framework.Test;
import junit.framework.TestSuite;

import org.jgroups.Channel;
import org.jgroups.tests.ChannelTestBase;

public class VotingAdapterTest extends ChannelTestBase {

    public VotingAdapterTest(String testName) {
            super(testName);
    }

    public static Test suite() {
            return new TestSuite(VotingAdapterTest.class);
    }

    
    private Channel channel1;
    private Channel channel2;

    protected VotingAdapter adapter1;
    protected VotingAdapter adapter2;

    protected TestVoteChannelListener listener1;
    protected TestVoteChannelListener listener2;
    protected TestVoteChannelListener listener3;
    protected TestVoteChannelListener listener4;

    protected static boolean logConfigured=false;

    public void setUp() throws Exception {
        super.setUp();
        listener1=new TestVoteChannelListener(true);
        listener2=new TestVoteChannelListener(true);
        listener3=new TestVoteChannelListener(false);
        listener4=new TestVoteChannelListener(false);

        channel1=createChannel("A");
        adapter1=new VotingAdapter(channel1);

        channel1.connect("voting");

        // give some time for the channel to become a coordinator
        try {
            Thread.sleep(1000);
        }
        catch(Exception ex) {
        }

        channel2=createChannel("A");
        adapter2=new VotingAdapter(channel2);

        channel2.connect("voting");
{'fraction_non_alphanumeric': 0.0872647274505011, 'fraction_numerical': 0.03128819359569787, 'mean_word_length': 2.802973977695167, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3627988', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1128, 'n_words': 206}