Moved all configuration property names to StackProperties

This commit is contained in:
emcho 2010-04-25 14:44:14 +00:00
parent c43f1f84d1
commit 48b5db7143
5 changed files with 55 additions and 54 deletions

View File

@ -137,8 +137,8 @@ public class MessageEventDispatchingTest extends TestCase
public void testClientTransactionTimeouts() throws Exception public void testClientTransactionTimeouts() throws Exception
{ {
String oldRetransValue = System.getProperty( String oldRetransValue = System.getProperty(
"org.ice4j.MAX_RETRANSMISSIONS"); StackProperties.MAX_CTRAN_RETRANSMISSIONS);
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", "1"); System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS, "1");
stunStack.sendRequest(bindingRequest, serverAddress, clientAddress, stunStack.sendRequest(bindingRequest, serverAddress, clientAddress,
responseCollector); responseCollector);
responseCollector.waitForTimeout(); responseCollector.waitForTimeout();
@ -154,10 +154,10 @@ public class MessageEventDispatchingTest extends TestCase
//restore the retransmissions prop in case others are counting on //restore the retransmissions prop in case others are counting on
//defaults. //defaults.
if(oldRetransValue != null) if(oldRetransValue != null)
System.getProperty( "org.ice4j.MAX_RETRANSMISSIONS", System.getProperty( StackProperties.MAX_CTRAN_RETRANSMISSIONS,
oldRetransValue); oldRetransValue);
else else
System.clearProperty("org.ice4j.MAX_RETRANSMISSIONS"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
} }
/** /**

View File

@ -89,15 +89,15 @@ public class TransactionSupportTests extends TestCase
requestCollector = new PlainRequestCollector(); requestCollector = new PlainRequestCollector();
responseCollector = new PlainResponseCollector(); responseCollector = new PlainResponseCollector();
System.setProperty("org.ice4j.PROPAGATE_RECEIVED_RETRANSMISSIONS", System.setProperty(StackProperties.PROPAGATE_RECEIVED_RETRANSMISSIONS,
"false"); "false");
System.setProperty("org.ice4j.KEEP_CLIENT_TRANS_AFTER_A_RESPONSE", System.setProperty(StackProperties.KEEP_CRANS_AFTER_A_RESPONSE,
"false"); "false");
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS,
""); "");
System.setProperty("org.ice4j.MAX_WAIT_INTERVAL", System.setProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER,
""); "");
System.setProperty("org.ice4j.ORIGINAL_WAIT_INTERVAL", System.setProperty(StackProperties.FIRST_CTRAN_RETRANS_AFTER,
""); "");
} }
@ -118,15 +118,15 @@ public class TransactionSupportTests extends TestCase
requestCollector = null; requestCollector = null;
responseCollector = null; responseCollector = null;
System.setProperty("org.ice4j.PROPAGATE_RECEIVED_RETRANSMISSIONS", System.setProperty(StackProperties.PROPAGATE_RECEIVED_RETRANSMISSIONS,
"false"); "false");
System.setProperty("org.ice4j.KEEP_CLIENT_TRANS_AFTER_A_RESPONSE", System.setProperty(StackProperties.KEEP_CRANS_AFTER_A_RESPONSE,
"false"); "false");
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS,
""); "");
System.setProperty("org.ice4j.MAX_WAIT_INTERVAL", System.setProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER,
""); "");
System.setProperty("org.ice4j.ORIGINAL_WAIT_INTERVAL", System.setProperty(StackProperties.FIRST_CTRAN_RETRANS_AFTER,
""); "");
super.tearDown(); super.tearDown();
@ -140,15 +140,15 @@ public class TransactionSupportTests extends TestCase
public void testClientRetransmissions() throws Exception public void testClientRetransmissions() throws Exception
{ {
String oldRetransValue = System.getProperty( String oldRetransValue = System.getProperty(
"org.ice4j.MAX_RETRANSMISSIONS"); StackProperties.MAX_CTRAN_RETRANSMISSIONS);
String oldMaxWaitValue = System.getProperty( String oldMaxWaitValue = System.getProperty(
"org.ice4j.MAX_WAIT_INTERVAL"); StackProperties.MAX_CTRAN_RETRANS_TIMER);
System.setProperty("org.ice4j.MAX_WAIT_INTERVAL", "100"); System.setProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER, "100");
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", "2"); System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS, "2");
//prepare to listen //prepare to listen
System.setProperty("org.ice4j.PROPAGATE_RECEIVED_RETRANSMISSIONS", System.setProperty(StackProperties.PROPAGATE_RECEIVED_RETRANSMISSIONS,
"true"); "true");
StunStack.getInstance() StunStack.getInstance()
@ -171,16 +171,16 @@ public class TransactionSupportTests extends TestCase
//restore the retransmissions prop in case others are counting on //restore the retransmissions prop in case others are counting on
//defaults. //defaults.
if(oldRetransValue != null) if(oldRetransValue != null)
System.getProperty( "org.ice4j.MAX_RETRANSMISSIONS", System.getProperty( StackProperties.MAX_CTRAN_RETRANSMISSIONS,
oldRetransValue); oldRetransValue);
else else
System.clearProperty("org.ice4j.MAX_RETRANSMISSIONS"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
if(oldMaxWaitValue != null) if(oldMaxWaitValue != null)
System.getProperty( "org.ice4j.MAX_WAIT_INTERVAL", System.getProperty( StackProperties.MAX_CTRAN_RETRANS_TIMER,
oldRetransValue); oldRetransValue);
else else
System.clearProperty("org.ice4j.MAX_WAIT_INTERVAL"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER);
} }
/** /**
@ -192,8 +192,8 @@ public class TransactionSupportTests extends TestCase
public void testServerRetransmissionHiding() throws Exception public void testServerRetransmissionHiding() throws Exception
{ {
String oldRetransValue = System.getProperty( String oldRetransValue = System.getProperty(
"org.ice4j.MAX_RETRANSMISSIONS"); StackProperties.MAX_CTRAN_RETRANSMISSIONS);
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", "2"); System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS, "2");
//prepare to listen //prepare to listen
StunStack.getInstance().addRequestListener( StunStack.getInstance().addRequestListener(
serverAddress, requestCollector); serverAddress, requestCollector);
@ -216,10 +216,10 @@ public class TransactionSupportTests extends TestCase
//restore the retransmissions prop in case others are counting on //restore the retransmissions prop in case others are counting on
//defaults. //defaults.
if(oldRetransValue != null) if(oldRetransValue != null)
System.getProperty( "org.ice4j.MAX_RETRANSMISSIONS", System.getProperty( StackProperties.MAX_CTRAN_RETRANSMISSIONS,
oldRetransValue); oldRetransValue);
else else
System.clearProperty("org.ice4j.MAX_RETRANSMISSIONS"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
} }
/** /**
@ -232,12 +232,12 @@ public class TransactionSupportTests extends TestCase
public void testServerResponseRetransmissions() throws Exception public void testServerResponseRetransmissions() throws Exception
{ {
String oldRetransValue = System.getProperty( String oldRetransValue = System.getProperty(
"org.ice4j.MAX_RETRANSMISSIONS"); StackProperties.MAX_CTRAN_RETRANSMISSIONS);
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", "2"); System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS, "2");
System.setProperty("org.ice4j.MAX_WAIT_INTERVAL", "100"); System.setProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER, "100");
//prepare to listen //prepare to listen
System.setProperty("org.ice4j.KEEP_CLIENT_TRANS_AFTER_A_RESPONSE", System.setProperty(StackProperties.KEEP_CRANS_AFTER_A_RESPONSE,
"true"); "true");
StunStack.getInstance().addRequestListener( StunStack.getInstance().addRequestListener(
serverAddress, requestCollector); serverAddress, requestCollector);
@ -270,12 +270,12 @@ public class TransactionSupportTests extends TestCase
//restore the retransmissions prop in case others are counting on //restore the retransmissions prop in case others are counting on
//defaults. //defaults.
if(oldRetransValue != null) if(oldRetransValue != null)
System.getProperty( "org.ice4j.MAX_RETRANSMISSIONS", System.getProperty( StackProperties.MAX_CTRAN_RETRANSMISSIONS,
oldRetransValue); oldRetransValue);
else else
System.clearProperty("org.ice4j.MAX_RETRANSMISSIONS"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
System.clearProperty("org.ice4j.MAX_WAIT_INTERVAL"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER);
} }
/** /**
@ -316,7 +316,8 @@ public class TransactionSupportTests extends TestCase
StunMessageEvent evt2 = reqs2.get(0); StunMessageEvent evt2 = reqs2.get(0);
assertFalse("Consecutive requests were assigned the same transaction id", assertFalse(
"Consecutive requests were assigned the same transaction id",
Arrays.equals( evt1.getMessage().getTransactionID(), Arrays.equals( evt1.getMessage().getTransactionID(),
evt2.getMessage().getTransactionID())); evt2.getMessage().getTransactionID()));
} }
@ -332,10 +333,10 @@ public class TransactionSupportTests extends TestCase
{ {
//MAX_RETRANSMISSIONS //MAX_RETRANSMISSIONS
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS,
"2"); "2");
//make sure we see retransmissions so that we may count them //make sure we see retransmissions so that we may count them
System.setProperty("org.ice4j.PROPAGATE_RECEIVED_RETRANSMISSIONS", System.setProperty(StackProperties.PROPAGATE_RECEIVED_RETRANSMISSIONS,
"true"); "true");
StunStack.getInstance().addRequestListener( StunStack.getInstance().addRequestListener(
serverAddress, requestCollector); serverAddress, requestCollector);
@ -369,10 +370,10 @@ public class TransactionSupportTests extends TestCase
throws Exception throws Exception
{ {
//MAX_RETRANSMISSIONS //MAX_RETRANSMISSIONS
System.setProperty("org.ice4j.ORIGINAL_WAIT_INTERVAL", System.setProperty(StackProperties.FIRST_CTRAN_RETRANS_AFTER,
"50"); "50");
//make sure we see retransmissions so that we may count them //make sure we see retransmissions so that we may count them
System.setProperty("org.ice4j.PROPAGATE_RECEIVED_RETRANSMISSIONS", System.setProperty(StackProperties.PROPAGATE_RECEIVED_RETRANSMISSIONS,
"true"); "true");
StunStack.getInstance().addRequestListener( StunStack.getInstance().addRequestListener(
serverAddress, requestCollector); serverAddress, requestCollector);
@ -410,12 +411,12 @@ public class TransactionSupportTests extends TestCase
throws Exception throws Exception
{ {
//MAX_RETRANSMISSIONS //MAX_RETRANSMISSIONS
System.setProperty("org.ice4j.MAX_WAIT_INTERVAL", System.setProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER,
"100"); "100");
//make sure we see retransmissions so that we may count them //make sure we see retransmissions so that we may count them
System.setProperty("org.ice4j.PROPAGATE_RECEIVED_RETRANSMISSIONS", System.setProperty(StackProperties.PROPAGATE_RECEIVED_RETRANSMISSIONS,
"true"); "true");
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS,
"11"); "11");
StunStack.getInstance() StunStack.getInstance()
.addRequestListener(serverAddress, requestCollector); .addRequestListener(serverAddress, requestCollector);

View File

@ -48,8 +48,8 @@ public class StunAddressDiscovererTest
{ {
super.setUp(); super.setUp();
System.setProperty("org.ice4j.MAX_WAIT_INTERVAL", "100"); System.setProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER, "100");
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", "2"); System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS, "2");
responseServer = new ResponseSequenceServer(responseServerAddress); responseServer = new ResponseSequenceServer(responseServerAddress);
stunAddressDiscoverer stunAddressDiscoverer
@ -62,8 +62,8 @@ public class StunAddressDiscovererTest
protected void tearDown() throws Exception protected void tearDown() throws Exception
{ {
System.clearProperty("org.ice4j.MAX_WAIT_INTERVAL"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER);
System.clearProperty("org.ice4j.MAX_RETRANSMISSIONS"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
responseServer.shutDown(); responseServer.shutDown();
stunAddressDiscoverer.shutDown(); stunAddressDiscoverer.shutDown();
stunAddressDiscoverer = null; stunAddressDiscoverer = null;

View File

@ -80,15 +80,15 @@ public class StunAddressDiscovererTest_v4v6 extends TestCase {
responseServer_v6.start(); responseServer_v6.start();
responseServer_v4.start(); responseServer_v4.start();
System.setProperty("org.ice4j.MAX_WAIT_INTERVAL", "100"); System.setProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER , "100");
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", "2"); System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS, "2");
} }
protected void tearDown() protected void tearDown()
throws Exception throws Exception
{ {
System.clearProperty("org.ice4j.MAX_WAIT_INTERVAL"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER);
System.clearProperty("org.ice4j.MAX_RETRANSMISSIONS"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
responseServer_v6.shutDown(); responseServer_v6.shutDown();
responseServer_v4.shutDown(); responseServer_v4.shutDown();

View File

@ -53,14 +53,14 @@ public class StunAddressDiscovererTest_v6 extends TestCase {
stunAddressDiscoverer.start(); stunAddressDiscoverer.start();
responseServer.start(); responseServer.start();
System.setProperty("org.ice4j.MAX_WAIT_INTERVAL", "100"); System.setProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER, "100");
System.setProperty("org.ice4j.MAX_RETRANSMISSIONS", "2"); System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS, "2");
} }
protected void tearDown() throws Exception protected void tearDown() throws Exception
{ {
System.clearProperty("org.ice4j.MAX_WAIT_INTERVAL"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANS_TIMER);
System.clearProperty("org.ice4j.MAX_RETRANSMISSIONS"); System.clearProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
responseServer.shutDown(); responseServer.shutDown();
stunAddressDiscoverer.shutDown(); stunAddressDiscoverer.shutDown();
stunAddressDiscoverer = null; stunAddressDiscoverer = null;