1 22 package org.jboss.test.jbossmq.perf; 23 24 import junit.textui.TestRunner; 25 import EDU.oswego.cs.dl.util.concurrent.Semaphore; 26 27 33 34 public class UIL2InvocationLayerStressTestCase extends InvocationLayerStressTest 35 { 36 42 public UIL2InvocationLayerStressTestCase(String name) throws Exception 43 { 44 super(name); 45 } 46 47 48 53 public void testUIL2MutliSessionOneConnection() throws Exception 54 { 55 getLog().debug("Starting UIL2 MutliSessionOneConnection test"); 56 57 connect("UIL2ConnectionFactory", "UIL2ConnectionFactory"); 58 queueConnection.start(); 59 exitSemaphore = new Semaphore(-WORKER_COUNT); 60 exitSemaphore.release(); 61 62 getLog().debug("Creating workers."); 63 QueueWorker workers[] = new QueueWorker[WORKER_COUNT]; 64 for (int i = 0; i < WORKER_COUNT; i++) 65 { 66 workers[i] = new QueueWorker("ConnectionTestQueue-" + i, "UIL2"); 67 } 68 69 getLog().debug("Starting workers."); 70 for (int i = 0; i < WORKER_COUNT; i++) 71 { 72 workers[i].start(); 73 } 74 75 getLog().debug("Waiting for workers to finish."); 76 exitSemaphore.acquire(); 77 78 disconnect(); 79 getLog().debug("UIL2 MutliSessionOneConnection passed"); 80 } 81 82 87 public static void main(String [] args) 88 { 89 90 String newArgs[] = {"org.jboss.test.jbossmq.perf.UIL2InvocationLayerStressTestCase"}; 91 TestRunner.main(newArgs); 92 93 } 94 95 } 96 | Popular Tags |