|
This post was updated on .
@BeforeThread
public void beforeThread() {
test.record(this,"sendMessage")
grinder.logger.info("before thread.")
}
@Test
public void test() {
if(connectFlag == 0){
configureConnection();
}
cdl = new CountDownLatch(2);
sendTime = System.currentTimeMillis();
sendMessage();
elapsedTime = System.currentTimeMillis() - sendTime;
nextRand = 1000 * (randomno.nextGaussian() * STANDARD_DEVIATION + PACING_TIME);
sleepTime = (long) (nextRand - elapsedTime);
//grinder.logger.info(String.format("Sleeping for %dms", sleepTime));
grinder.sleep(sleepTime);
}
public void configureConnection() {
try{
xmppClient.connect();
xmppClient2.connect();
xmppClient.login(sender.getUserId(), assertion);
xmppClient2.login(receiver.getUserId(), assertion2);
}
catch (NoResponseException e){
grinder.statistics.forLastTest.success = 0;
}
catch (AuthenticationException e){
grinder.statistics.forLastTest.success = 0;
}
}
|