testStressSameServer(Bridge.QOS_ONCE_AND_ONLY_ONCE, false, 1);
}
public void testParams() throws Exception
{
Bridge bridge = null;
try
{
int qosMode = Bridge.QOS_AT_MOST_ONCE;
int batchSize = 10;
int maxBatchTime = -1;
String sourceUsername = null;
String sourcePassword = null;
String destUsername = null;
String destPassword = null;
String selector = null;
long failureRetryInterval = 5000;
int maxRetries = 10;
String subName = null;
String clientID = null;
try
{
bridge= new Bridge(null, cff1, sourceQueueFactory, targetQueueFactory,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, failureRetryInterval, maxRetries, qosMode,
batchSize, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, null, sourceQueueFactory, targetQueueFactory,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, failureRetryInterval, maxRetries, qosMode,
batchSize, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, cff1, null, targetQueueFactory,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, failureRetryInterval, maxRetries, qosMode,
batchSize, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, cff1, sourceQueueFactory, null,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, failureRetryInterval, maxRetries, qosMode,
batchSize, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, cff1, sourceQueueFactory, targetQueueFactory,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, -2, maxRetries, qosMode,
batchSize, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, cff1, sourceQueueFactory, targetQueueFactory,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, -1, 10, qosMode,
batchSize, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, cff1, sourceQueueFactory, null,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, failureRetryInterval, maxRetries, -2,
batchSize, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, cff1, sourceQueueFactory, null,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, failureRetryInterval, maxRetries, 3,
batchSize, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, cff1, sourceQueueFactory, null,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, failureRetryInterval, maxRetries, 3,
0, maxBatchTime,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
try
{
bridge= new Bridge(cff0, cff1, sourceQueueFactory, null,
sourceUsername, sourcePassword, destUsername, destPassword,
selector, failureRetryInterval, maxRetries, 3,
batchSize, -2,
subName, clientID, false);
}
catch (IllegalArgumentException e)
{
//Ok
}
}
finally
{
if (bridge != null)
{
bridge.stop();
}
}
}