SenderJob sender = createDefaultSenderJob(testQueueName); sender.setNumMessages(10000); sender.setMsgSize(1024); sender.setMf(new BytesMessageMessageFactory()); sender.setTransacted(false); sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT); sender.setNumConnections(i); sender.setNumSessions(i);  ReceiverJob receiver = createDefaultReceiverJob(testQueueName);
log.trace("Draining destination"); runJob(createDefaultDrainJob(this.queueName)); log.trace("Destination drained");    Job[] jobs = new Job[i + 1];  for (int j = 0; j < i; j++) {  SenderJob sender = createDefaultSenderJob(this.queueName); jobs[j] = sender; sender.setNumMessages(numMessages); sender.setMf(new BytesMessageMessageFactory()); sender.setTransacted(false); sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT); sender.setSlaveURL(slaveURLs[j % this.numSlaves]); }   ReceiverJob receiver = createDefaultReceiverJob(this.queueName); jobs[i] = receiver;
   public void testQueueScale2()   {      log.info("Running test testQueueScale2");            //TODO - do this across multiple remote clients            for (int i = 1; i <= 20; i++)      {         //First drain the destination         runJob(createDefaultDrainJob(testQueueName));                  SenderJob sender = createDefaultSenderJob(testQueueName);         sender.setNumMessages(10000);         sender.setMsgSize(1024);         sender.setMf(new BytesMessageMessageFactory());         sender.setTransacted(false);         sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);         sender.setNumConnections(i);         sender.setNumSessions(i);                        ReceiverJob receiver = createDefaultReceiverJob(testQueueName);         receiver.setAckMode(Session.AUTO_ACKNOWLEDGE);         receiver.setTransacted(false);                           JobTimings[] results = runJobs(new Job[] {sender, receiver});                  /*          * NB.          * When we calculating the total time taken from first send to last receive, there is some          * error involved due to the differences in network latency and other remoting overhead          * when sending the jobs to be executed on potentially different remote machines.          * We make the assumption that this this difference is very small compared with time taken          * to run the tests as to be negligible.          */                  long totalTimeTaken = results[1].getTestTime() + results[1].getInitTime() - results[0].getInitTime();                           storeResult("testQueueScale2_" + i, totalTimeTaken);      }            log.info("Test testQueueScale2 finished");         }