1 7 package org.jboss.test.jbossmq.perf; 8 9 import javax.jms.*; 10 11 import javax.management.ObjectName ; 12 import javax.naming.Context ; 13 import javax.naming.InitialContext ; 14 import junit.textui.TestRunner; 15 16 import org.apache.log4j.Category; 17 18 import org.jboss.test.JBossTestCase; 19 20 import EDU.oswego.cs.dl.util.concurrent.Semaphore; 21 22 28 29 public class OILInvocationLayerStressTestCase extends InvocationLayerStressTest 30 { 31 37 public OILInvocationLayerStressTestCase(String name) throws Exception 38 { 39 super(name); 40 } 41 42 43 48 public void testOILMutliSessionOneConnection() throws Exception 49 { 50 getLog().debug("Starting OIL MutliSessionOneConnection test"); 51 52 connect("ConnectionFactory", "ConnectionFactory"); 53 queueConnection.start(); 54 exitSemaphore = new Semaphore(-WORKER_COUNT); 55 exitSemaphore.release(); 56 57 getLog().debug("Creating workers."); 58 QueueWorker workers[] = new QueueWorker[WORKER_COUNT]; 59 for (int i = 0; i < WORKER_COUNT; i++) 60 { 61 workers[i] = new QueueWorker("ConnectionTestQueue-" + i, "OIL"); 62 } 63 64 getLog().debug("Starting workers."); 65 for (int i = 0; i < WORKER_COUNT; i++) 66 { 67 workers[i].start(); 68 } 69 70 getLog().debug("Waiting for workers to finish."); 71 exitSemaphore.acquire(); 72 73 disconnect(); 74 getLog().debug("OIL MutliSessionOneConnection passed"); 75 } 76 77 82 public static void main(String [] args) 83 { 84 85 String newArgs[] = {"org.jboss.test.jbossmq.perf.OILInvocationLayerStressTestCase"}; 86 TestRunner.main(newArgs); 87 88 } 89 90 } 91 | Popular Tags |