sender.setNumMessages(10000); sender.setMsgSize(1024);
sender.setNumMessages(numMessages); sender.setMsgSize(standardMessageSize);
   public void testQueueScale1()   {      log.info("Running test testQueueScale1");            String testQueueNamePrefix = "queue/testQueue";            for (int i = 1; i <= 10; i++)      {         //First drain the destinations         for (int j = 0; j < i; j++)         {            runJob(createDefaultDrainJob(testQueueNamePrefix + j));         }                  //Create the jobs                  Job[] jobs = new Job[2 * i];                  for (int j = 0; j < i; j++)         {                     SenderJob sender = createDefaultSenderJob(testQueueNamePrefix + j);            jobs[j * 2] = sender;            sender.setNumMessages(10000);            sender.setMsgSize(1024);            sender.setMf(new BytesMessageMessageFactory());            sender.setTransacted(false);            sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);                     ReceiverJob receiver = createDefaultReceiverJob(testQueueNamePrefix + j);            jobs[j * 2 + 1] = receiver;                        receiver.setAckMode(Session.AUTO_ACKNOWLEDGE);            receiver.setTransacted(false);         }                  JobTimings[] results = runJobs(jobs);                  /*          * 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 minTimeOfFirstSend = Long.MAX_VALUE;         long maxTimeOfLastReceive = Long.MIN_VALUE;         for (int j = 0; j < i; j++)         {            JobTimings senderResult = results[j * 2];            JobTimings receiverResult = results[j * 2 + 1];            long timeOfFirstSend = senderResult.getInitTime();            minTimeOfFirstSend = Math.min(minTimeOfFirstSend, timeOfFirstSend);            long timeOfLastReceive = receiverResult.getInitTime() + receiverResult.getTestTime();            maxTimeOfLastReceive = Math.max(maxTimeOfLastReceive, timeOfLastReceive);         }                  long totalTimeTaken = maxTimeOfLastReceive - minTimeOfFirstSend;         long totalMessagesSent = i * 10000;                           storeResult("QueueScale1", totalTimeTaken);      }            log.info("Test testQueueScale1 finished");         }