1 package org.jgroups.tests; 2 3 import junit.framework.TestCase; 4 import junit.framework.TestSuite; 5 import org.jgroups.JChannel; 6 import org.jgroups.stack.Protocol; 7 8 13 public class CustomProtocolTest extends TestCase { 14 15 static final String PROTOCOL_STACK = "UDP(mcast_addr=228.1.2.3;mcast_port=45566;ip_ttl=32):" + 16 "org.jgroups.tests.CustomProtocolTest$MyProtocol:" + 17 "PING(timeout=3000;num_initial_members=6):" + 18 "FD(timeout=3000):" + 19 "VERIFY_SUSPECT(timeout=1500):" + 20 "pbcast.NAKACK(gc_lag=10;retransmit_timeout=600,1200,2400,4800):" + 21 "UNICAST(timeout=600,1200,2400,4800):" + 22 "pbcast.STABLE(desired_avg_gossip=10000):" + 23 "FRAG:" + 24 "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" + 25 "shun=true;print_local_addr=true)"; 26 27 public void testMyProtocol() throws Exception { 28 System.out.println("PROTOCOL_STACK: " + PROTOCOL_STACK); 29 JChannel channel = new JChannel(PROTOCOL_STACK); 30 assertTrue(true); 31 } 32 33 35 41 public CustomProtocolTest(String testName) throws Exception { 42 super(testName); 43 } 44 45 46 51 public static void main(String args[]) { 52 String [] testCaseName = {"com.oracle.jgroups.protocols.CustomProtocolTest"}; 53 junit.textui.TestRunner.main(testCaseName); 54 } 55 56 57 62 public static TestSuite suite() { 63 return new TestSuite(CustomProtocolTest.class); 64 } 65 66 public static class MyProtocol extends Protocol { 67 68 public String getName() { 69 return "MyProtocol"; 70 } 71 } 72 } 73 | Popular Tags |