[hornetq-commits] JBoss hornetq SVN: r11127 - branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/client.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Aug 4 20:56:43 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-08-04 20:56:43 -0400 (Thu, 04 Aug 2011)
New Revision: 11127

Modified:
   branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/client/NIOvsOIOTest.java
Log:
enabling test

Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/client/NIOvsOIOTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/client/NIOvsOIOTest.java	2011-08-05 00:39:07 UTC (rev 11126)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/client/NIOvsOIOTest.java	2011-08-05 00:56:43 UTC (rev 11127)
@@ -49,45 +49,35 @@
 
    // Public --------------------------------------------------------
 
-   public static TestSuite suite()
+   public void testNIOPerf() throws Exception
    {
-      return new TestSuite();
+      testPerf(true);
    }
    
-//   public void testNIOPerf() throws Exception
-//   {
-//      log.info("************* Testing NIO");
-//      testPerf(true);
-//   }
-//   
-//   public void testOIOPerf() throws Exception
-//   {
-//      log.info("************ Testing OIO");
-//      testPerf(false);
-//   }
+   public void testOIOPerf() throws Exception
+   {
+      testPerf(false);
+   }
    
    private void doTest(String dest) throws Exception
    {
-      System.getProperties().put("hq.batchHQ", "true");
       
-      String connectorFactoryClassName = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory";
-      
-      
       final int numSenders = 1;
 
       final int numReceivers = 1;
       
-      final int numMessages = 200000;
+      final int numMessages = 20000;
       
       Receiver[] receivers = new Receiver[numReceivers];
       
       Sender[] senders = new Sender[numSenders];
       
       List<ClientSessionFactory> factories = new ArrayList<ClientSessionFactory>();
+
+      ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
       
       for (int i = 0; i < numReceivers; i++)
       {
-         ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
 
          ClientSessionFactory sf = locator.createSessionFactory();
          
@@ -102,8 +92,6 @@
       
       for (int i = 0; i < numSenders; i++)
       {
-         ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
-
          ClientSessionFactory sf = locator.createSessionFactory();
 
          factories.add(sf);
@@ -134,7 +122,7 @@
       
       double rate = 1000 * (double)(numMessages * numSenders) / (end - start);
       
-      log.info("Rate is " + rate + " msgs sec");
+      logAndSystemOut("Rate is " + rate + " msgs sec");
       
       for (int i = 0; i < numSenders; i++)
       {         
@@ -150,6 +138,8 @@
       {      
          sf.close();
       }
+      
+      locator.close();
    }
 
    private void testPerf(boolean nio) throws Exception
@@ -217,7 +207,7 @@
 
       void prepare() throws Exception
       {
-         session = sf.createSession();
+         session = sf.createSession(true, true);
 
          producer = session.createProducer(dest);
       }
@@ -277,7 +267,7 @@
 
       void prepare() throws Exception
       {
-         session = sf.createSession();
+         session = sf.createSession(true, true, 0);
 
          queueName = UUIDGenerator.getInstance().generateStringUUID();
 



More information about the hornetq-commits mailing list