You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2012/08/03 14:14:12 UTC

svn commit: r1368910 [22/27] - in /qpid/branches/asyncstore: ./ bin/ cpp/bindings/qmf/ruby/ cpp/bindings/qmf2/ruby/ cpp/bindings/qpid/python/ cpp/bindings/qpid/ruby/ cpp/bindings/qpid/ruby/features/ cpp/bindings/qpid/ruby/features/step_definitions/ cpp...

Modified: qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/ssl/SSLContextFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/ssl/SSLContextFactoryTest.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/ssl/SSLContextFactoryTest.java (original)
+++ qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/ssl/SSLContextFactoryTest.java Fri Aug  3 12:13:32 2012
@@ -31,13 +31,14 @@ public class SSLContextFactoryTest exten
     private static final String CLIENT_KEYSTORE_PATH = TEST_RESOURCES_DIR + "/ssl/java_client_keystore.jks";
     private static final String CLIENT_TRUSTSTORE_PATH = TEST_RESOURCES_DIR + "/ssl/java_client_truststore.jks";
     private static final String STORE_PASSWORD = "password";
+    private static final String STORE_TYPE = "JKS";
     private static final String DEFAULT_KEY_MANAGER_ALGORITHM = KeyManagerFactory.getDefaultAlgorithm();
     private static final String DEFAULT_TRUST_MANAGER_ALGORITHM = TrustManagerFactory.getDefaultAlgorithm();
     private static final String CERT_ALIAS_APP1 = "app1";
 
     public void testBuildServerContext() throws Exception
     {
-        SSLContext context = SSLContextFactory.buildServerContext(BROKER_KEYSTORE_PATH, STORE_PASSWORD, DEFAULT_KEY_MANAGER_ALGORITHM);
+        SSLContext context = SSLContextFactory.buildServerContext(BROKER_KEYSTORE_PATH, STORE_PASSWORD, STORE_TYPE, DEFAULT_KEY_MANAGER_ALGORITHM);
         assertNotNull("SSLContext should not be null", context);
     }
 
@@ -45,7 +46,7 @@ public class SSLContextFactoryTest exten
     {
         try
         {
-            SSLContextFactory.buildServerContext(BROKER_KEYSTORE_PATH, "sajdklsad", DEFAULT_KEY_MANAGER_ALGORITHM);
+            SSLContextFactory.buildServerContext(BROKER_KEYSTORE_PATH, "sajdklsad", STORE_TYPE, DEFAULT_KEY_MANAGER_ALGORITHM);
             fail("Exception was not thrown due to incorrect password");
         }
         catch (IOException e)
@@ -58,7 +59,7 @@ public class SSLContextFactoryTest exten
     {
         try
         {
-            SSLContextFactory.buildClientContext("/path/to/nothing", STORE_PASSWORD, DEFAULT_TRUST_MANAGER_ALGORITHM, CLIENT_KEYSTORE_PATH, STORE_PASSWORD, DEFAULT_KEY_MANAGER_ALGORITHM, null);
+            SSLContextFactory.buildClientContext("/path/to/nothing", STORE_PASSWORD, STORE_TYPE, DEFAULT_TRUST_MANAGER_ALGORITHM, CLIENT_KEYSTORE_PATH, STORE_PASSWORD, STORE_TYPE, DEFAULT_KEY_MANAGER_ALGORITHM, null);
             fail("Exception was not thrown due to incorrect path");
         }
         catch (IOException e)
@@ -69,19 +70,19 @@ public class SSLContextFactoryTest exten
 
     public void testBuildClientContextForSSLEncryptionOnly() throws Exception
     {
-        SSLContext context = SSLContextFactory.buildClientContext(CLIENT_TRUSTSTORE_PATH, STORE_PASSWORD, DEFAULT_TRUST_MANAGER_ALGORITHM, null, null, null, null);
+        SSLContext context = SSLContextFactory.buildClientContext(CLIENT_TRUSTSTORE_PATH, STORE_PASSWORD, STORE_TYPE, DEFAULT_TRUST_MANAGER_ALGORITHM, null, null, null, null, null);
         assertNotNull("SSLContext should not be null", context);
     }
 
     public void testBuildClientContextWithForClientAuth() throws Exception
     {
-        SSLContext context = SSLContextFactory.buildClientContext(CLIENT_TRUSTSTORE_PATH, STORE_PASSWORD, DEFAULT_TRUST_MANAGER_ALGORITHM, CLIENT_KEYSTORE_PATH, STORE_PASSWORD, DEFAULT_KEY_MANAGER_ALGORITHM, null);
+        SSLContext context = SSLContextFactory.buildClientContext(CLIENT_TRUSTSTORE_PATH, STORE_PASSWORD, STORE_TYPE, DEFAULT_TRUST_MANAGER_ALGORITHM, CLIENT_KEYSTORE_PATH, STORE_PASSWORD, STORE_TYPE, DEFAULT_KEY_MANAGER_ALGORITHM, null);
         assertNotNull("SSLContext should not be null", context);
     }
     
     public void testBuildClientContextWithForClientAuthWithCertAlias() throws Exception
     {
-        SSLContext context = SSLContextFactory.buildClientContext(CLIENT_TRUSTSTORE_PATH, STORE_PASSWORD, DEFAULT_TRUST_MANAGER_ALGORITHM, CLIENT_KEYSTORE_PATH, STORE_PASSWORD, DEFAULT_KEY_MANAGER_ALGORITHM, CERT_ALIAS_APP1);
+        SSLContext context = SSLContextFactory.buildClientContext(CLIENT_TRUSTSTORE_PATH, STORE_PASSWORD, STORE_TYPE, DEFAULT_TRUST_MANAGER_ALGORITHM, CLIENT_KEYSTORE_PATH, STORE_PASSWORD, STORE_TYPE, DEFAULT_KEY_MANAGER_ALGORITHM, CERT_ALIAS_APP1);
         assertNotNull("SSLContext should not be null", context);
     }
 }

Modified: qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java (original)
+++ qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java Fri Aug  3 12:13:32 2012
@@ -29,8 +29,6 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
-import java.net.DatagramSocket;
-import java.net.ServerSocket;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -110,8 +108,8 @@ public class QpidTestCase extends TestCa
         }
     }
 
-    protected static final String MS_FACTORY_CLASS_NAME_KEY = "messagestorefactory.class.name";
-    protected static final String MEMORY_STORE_FACTORY_CLASS_NAME = "org.apache.qpid.server.store.MemoryMessageStoreFactory";
+    protected static final String MESSAGE_STORE_CLASS_NAME_KEY = "messagestore.class.name";
+    protected static final String MEMORY_STORE_CLASS_NAME = "org.apache.qpid.server.store.MemoryMessageStore";
 
     private static List<String> _exclusionList;
     
@@ -140,12 +138,12 @@ public class QpidTestCase extends TestCa
         }
     }
 
-    public String getTestProfileMessageStoreFactoryClassName()
+    public String getTestProfileMessageStoreClassName()
     {
-        final String storeFactoryClass = System.getProperty(MS_FACTORY_CLASS_NAME_KEY);
-        _logger.debug("MS_FACTORY_CLASS_NAME_KEY " + storeFactoryClass);
+        final String storeClass = System.getProperty(MESSAGE_STORE_CLASS_NAME_KEY);
+        _logger.debug("MESSAGE_STORE_CLASS_NAME_KEY " + storeClass);
         
-        return storeFactoryClass != null ? storeFactoryClass : MEMORY_STORE_FACTORY_CLASS_NAME ;
+        return storeClass != null ? storeClass : MEMORY_STORE_CLASS_NAME ;
     }
 
 
@@ -166,9 +164,10 @@ public class QpidTestCase extends TestCa
             throw new IllegalArgumentException("Invalid start port: " + fromPort);
         }
 
+        PortHelper portHelper = new PortHelper();
         for (int i = fromPort; i <= MAX_PORT_NUMBER; i++)
         {
-            if (available(i)) {
+            if (portHelper.isPortAvailable(i)) {
                 return i;
             }
         }
@@ -176,54 +175,6 @@ public class QpidTestCase extends TestCa
         throw new NoSuchElementException("Could not find an available port above " + fromPort);
     }
 
-    /**
-     * Checks to see if a specific port is available.
-     *
-     * @param port the port to check for availability
-     */
-    private boolean available(int port)
-    {
-        if ((port < MIN_PORT_NUMBER) || (port > MAX_PORT_NUMBER))
-        {
-            throw new IllegalArgumentException("Invalid start port: " + port);
-        }
-
-        ServerSocket ss = null;
-        DatagramSocket ds = null;
-        try
-        {
-            ss = new ServerSocket(port);
-            ss.setReuseAddress(true);
-            ds = new DatagramSocket(port);
-            ds.setReuseAddress(true);
-            return true;
-        }
-        catch (IOException e)
-        {
-        }
-        finally
-        {
-            if (ds != null)
-            {
-                ds.close();
-            }
-
-            if (ss != null)
-            {
-                try
-                {
-                    ss.close();
-                }
-                catch (IOException e)
-                {
-                    /* should not be thrown */
-                }
-            }
-        }
-
-        return false;
-    }
-
     public int findFreePort()
     {
         return getNextAvailable(10000);

Modified: qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java (original)
+++ qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java Fri Aug  3 12:13:32 2012
@@ -20,6 +20,7 @@
  */
 package org.apache.qpid.transport;
 
+import java.security.Principal;
 import org.apache.qpid.protocol.ProtocolEngineFactory;
 import org.apache.qpid.ssl.SSLContextFactory;
 import org.apache.qpid.transport.network.NetworkConnection;
@@ -71,6 +72,17 @@ public class TestNetworkConnection imple
 
     }
 
+    @Override
+    public void setPeerPrincipal(Principal principal)
+    {
+    }
+
+    @Override
+    public Principal getPeerPrincipal()
+    {
+        return null;
+    }
+
     public void setMaxWriteIdle(int idleTime)
     {
 

Modified: qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/util/SerialTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/util/SerialTest.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/util/SerialTest.java (original)
+++ qpid/branches/asyncstore/java/common/src/test/java/org/apache/qpid/util/SerialTest.java Fri Aug  3 12:13:32 2012
@@ -1,4 +1,3 @@
-package org.apache.qpid.util;
 /*
  * 
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,6 +18,7 @@ package org.apache.qpid.util;
  * under the License.
  * 
  */
+package org.apache.qpid.util;
 
 
 import junit.framework.TestCase;

Modified: qpid/branches/asyncstore/java/genpom
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/genpom?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/genpom (original)
+++ qpid/branches/asyncstore/java/genpom Fri Aug  3 12:13:32 2012
@@ -111,8 +111,10 @@ for module in module_depends:
       <groupId>%s</groupId>
       <artifactId>%s</artifactId>
       <version>%s</version>
+      <scope>%s</scope>
     </dependency>
-""" % (opts.group, artifactId, opts.version))
+""" % (opts.group, artifactId, opts.version,
+       scopes.get(artifactId, "compile")))
 
 for jar in jars:
   base, ext = os.path.splitext(os.path.basename(jar))

Modified: qpid/branches/asyncstore/java/jca/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/jca/build.xml?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/jca/build.xml (original)
+++ qpid/branches/asyncstore/java/jca/build.xml Fri Aug  3 12:13:32 2012
@@ -18,18 +18,20 @@
  - under the License.
  -
  -->
-<project name="Qpid JCA RA" default="build">
+<project name="Qpid JCA" default="build">
 
   <property name="module.depends" value="common client"/>
-  <property name="module.name" value="ra"/>
+  <property name="module.name" value="jca"/>
 
   <import file="../module.xml"/>
 
-  <property name="module.rar" value="${build.lib}/${project.name}-${module.name}-${project.version}.rar"/>
-  <property name="module.resources" value="src/main/resources"/>
+  <property name="module.rar" value="${build.lib}/${project.name}-ra-${project.version}.rar"/>
 
+  <property name="module.resources" value="src/main/resources"/>
 
   <target name="rar" depends="jar">
+      <!--Note we need to do this as we need to keep the ra in the name of the artificats but we can't override the module.jar property which is based on the directory name-->
+    <move file="${build.lib}/${project.name}-${module.name}-${project.version}.jar" tofile="${build.lib}/${project.name}-ra-${project.version}.jar"/>
     <jar destfile="${module.rar}">
       <fileset dir="${module.resources}">
         <include name="**/*.xml"/>
@@ -66,4 +68,5 @@
   <target name="examples" depends="example-properties-file, example-jars"/>
 
   <target name="build" depends="rar, examples"/>
+
 </project>

Modified: qpid/branches/asyncstore/java/jca/example/README-EXAMPLE.txt
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/jca/example/README-EXAMPLE.txt?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/jca/example/README-EXAMPLE.txt (original)
+++ qpid/branches/asyncstore/java/jca/example/README-EXAMPLE.txt Fri Aug  3 12:13:32 2012
@@ -232,4 +232,9 @@ While this documentation highlights the 
 the possiblities for modifcation are numerous. You are encouraged to experiment with the example as you work
 to develop your own messaging applications.
 
+***Note***
+Due to the way Ant handle XML escape characters in the Copy task, if you are attempting to deploy the
+examples to a clustered broker configuration, you will need to modify the resultant XML configuration
+file to remove the '&' character and replace it with the &amp; character. This file varies by app
+server. Please see the app server specific documentation for your platform for further details.
 

Modified: qpid/branches/asyncstore/java/jca/example/build-jboss7-properties.xml
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/jca/example/build-jboss7-properties.xml?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/jca/example/build-jboss7-properties.xml (original)
+++ qpid/branches/asyncstore/java/jca/example/build-jboss7-properties.xml Fri Aug  3 12:13:32 2012
@@ -53,19 +53,19 @@
 
     <path id="compile.classpath">
         <fileset dir="${jboss.modules}/javax/jms/api/main">
-            <include name="jboss-jms-api_1.1_spec-1.0.1.Final.jar"/>
+            <include name="jboss-jms-api_1.1_spec-*.Final.jar"/>
         </fileset>
         <fileset dir="${jboss.modules}/javax/ejb/api/main">
-            <include name="jboss-ejb-api_3.1_spec-1.0.2.Final.jar"/>
+            <include name="jboss-ejb-api_3.1_spec-*.Final.jar"/>
         </fileset>
         <fileset dir="${jboss.modules}/javax/servlet/api/main">
-            <include name="jboss-servlet-api_3.0_spec-1.0.1.Final.jar"/>
+            <include name="jboss-servlet-api_3.0_spec-*.Final.jar"/>
         </fileset>
         <fileset dir="${jboss.modules}/javax/transaction/api/main">
-            <include name="jboss-transaction-api_1.1_spec-1.0.1.Final.jar"/>
+            <include name="jboss-transaction-api_1.1_spec-*.Final.jar"/>
         </fileset>
         <fileset dir="${jboss.modules}/org/slf4j/main">
-            <include name="slf4j-api-1.6.1.jar"/>
+            <include name="slf4j-api-*.jar"/>
         </fileset>
     </path>
 
@@ -121,13 +121,10 @@
     <target name="deploy-config" depends="generate" description="Deploys the standalone file to the JBoss environment.">
         <copy todir="${jboss.config.dir}" overwrite="true">
             <fileset dir="${gen.dir}">
-                <include name="${jboss.server.config}.xml"/>
+                <include name="qpid-${jboss.server.config}.xml"/>
             </fileset>
         </copy>
     </target>
 
-    <target name="undeploy-ds" description="Undeploys the ds.xml file from the JBoss environment.">
-        <delete file="${jboss.deploy}/qpid-jca-ds.xml"/>
-    </target>
 
 </project>

Modified: qpid/branches/asyncstore/java/jca/example/conf/qpid-standalone.xml
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/jca/example/conf/qpid-standalone.xml?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/jca/example/conf/qpid-standalone.xml (original)
+++ qpid/branches/asyncstore/java/jca/example/conf/qpid-standalone.xml Fri Aug  3 12:13:32 2012
@@ -1,3 +1,4 @@
+<?xml version='1.0' encoding='UTF-8'?>
 <!--
  -
  - Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +19,6 @@
  - under the License.
  -
 -->
-<?xml version='1.0' encoding='UTF-8'?>
 
 <server xmlns="urn:jboss:domain:1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance">
 

Modified: qpid/branches/asyncstore/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java (original)
+++ qpid/branches/asyncstore/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java Fri Aug  3 12:13:32 2012
@@ -21,10 +21,13 @@
 
 package org.apache.qpid.ra;
 
+import java.util.List;
+
 import javax.transaction.xa.XAException;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
 
+import org.apache.qpid.client.AMQXAResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,7 +35,7 @@ import org.slf4j.LoggerFactory;
  * QpidRAXAResource.
  *
  */
-public class QpidRAXAResource implements XAResource
+public class QpidRAXAResource implements AMQXAResource
 {
    /** The logger */
    private static final Logger _log = LoggerFactory.getLogger(QpidRAXAResource.class);
@@ -192,7 +195,7 @@ public class QpidRAXAResource implements
       {
          _log.trace("isSameRM(" + xaRes + ")");
       }
-
+      
       return _xaResource.isSameRM(xaRes);
    }
 
@@ -242,4 +245,14 @@ public class QpidRAXAResource implements
 
       return _xaResource.setTransactionTimeout(seconds);
    }
+   
+   public String getBrokerUUID()
+   {
+       return ((AMQXAResource)_xaResource).getBrokerUUID();
+   }
+   
+   public List<XAResource> getSiblings()
+   {
+       return ((AMQXAResource)_xaResource).getSiblings();
+   }
 }

Propchange: qpid/branches/asyncstore/java/lib/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug  3 12:13:32 2012
@@ -0,0 +1,5 @@
+*.jar
+bdbstore
+required
+csvjdbc
+jfree

Modified: qpid/branches/asyncstore/java/management/common/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/management/common/build.xml?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/management/common/build.xml (original)
+++ qpid/branches/asyncstore/java/management/common/build.xml Fri Aug  3 12:13:32 2012
@@ -24,4 +24,5 @@
     <property name="module.genpom" value="true"/>
 
     <target name="bundle" depends="bundle-tasks"/>
+
 </project>

Modified: qpid/branches/asyncstore/java/management/common/src/main/java/management-common.bnd
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/management/common/src/main/java/management-common.bnd?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/management/common/src/main/java/management-common.bnd (original)
+++ qpid/branches/asyncstore/java/management/common/src/main/java/management-common.bnd Fri Aug  3 12:13:32 2012
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-ver: 0.17.0
+ver: 0.19.0
 
 Bundle-SymbolicName: qpid-management-common
 Bundle-Version: ${ver}

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:r1333988-1368650

Modified: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java (original)
+++ qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java Fri Aug  3 12:13:32 2012
@@ -63,9 +63,14 @@ public interface ManagedQueue
     String ENCODING = "Encoding";
     String CONTENT = "Content";
     List<String> VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES_DESC = Collections.unmodifiableList(Arrays.asList(MSG_AMQ_ID, MIME, ENCODING, CONTENT));
-    
+
+    /** Date/time format used for message expiration and message timestamp formatting */
+    String JMSTIMESTAMP_DATETIME_FORMAT = "MM-dd-yy HH:mm:ss.SSS z";
+
     //Individual attribute name constants
     static final String ATTR_NAME = "Name";
+    static final String ATTR_DESCRIPTION = "Description";
+    static final String ATTR_QUEUE_TYPE = "QueueType";
     static final String ATTR_OWNER = "Owner";
     static final String ATTR_MAX_MSG_AGE = "MaximumMessageAge";
     static final String ATTR_MAX_MSG_COUNT = "MaximumMessageCount";
@@ -92,6 +97,8 @@ public interface ManagedQueue
                         new HashSet<String>(
                                 Arrays.asList(
                                     ATTR_NAME,
+                                    ATTR_QUEUE_TYPE,
+                                    ATTR_DESCRIPTION,
                                     ATTR_OWNER,
                                     ATTR_MAX_MSG_AGE,
                                     ATTR_MAX_MSG_COUNT,
@@ -235,7 +242,7 @@ public interface ManagedQueue
      * Tells the maximum number of messages that can be stored in the queue.
      * This is useful in setting the notifications or taking required
      * action is the number of message increase this limit.
-     * @return maximum muber of message allowed to be stored in the queue.
+     * @return maximum nuumber of message allowed to be stored in the queue.
      * @throws IOException
      */
     Long getMaximumMessageCount() throws IOException;
@@ -287,13 +294,33 @@ public interface ManagedQueue
      */
     @MBeanAttribute(name="Capacity", description="The flow control Capacity (Bytes) of the queue")
     void setCapacity(Long value) throws IOException, IllegalArgumentException;
+
+    /**
+     * Gets the free text queue description.
+     * @since Qpid JMX API 2.5
+     */
+    String getDescription();
+
+    /**
+     * Sets the free text queue description.
+     * @since Qpid JMX API 2.5
+     */
+    @MBeanAttribute(name="Description", description="Free text description of the queue")
+    void setDescription(String string);
+
+    /**
+     * Gets the queue type
+     * @since Qpid JMX API 2.5
+     */
+    @MBeanAttribute(name="QueueType", description="Type of the queue e.g. standard, priority, etc")
+    String getQueueType();
     
     /**
      * Returns the current flow control FlowResumeCapacity of the queue in bytes.
      * 
      * @since Qpid JMX API 1.6
      * @return Capacity below which flow resumes in bytes
-     * @throws IOException
+     * @throws IOExceptionm
      */
     Long getFlowResumeCapacity() throws IOException;
 
@@ -332,7 +359,7 @@ public interface ManagedQueue
      * @since Qpid JMX API 2.0
      * @param exclusive the capacity in bytes
      * @throws IOException
-     * @throws JMException 
+     * @throws JMException
      */
     @MBeanAttribute(name="Exclusive", description="Whether the queue is Exclusive or not")
     void setExclusive(boolean exclusive) throws IOException, JMException;
@@ -341,10 +368,13 @@ public interface ManagedQueue
      * Sets the Alternate Exchange for the queue, for use in dead letter queue functionality.
      *
      * @since Qpid JMX API 2.4
-     * @param the name of the exchange to use. Specifying null or the empty string will clear the alternate exchange.
+     * @param exchangeName the name of the exchange to use. Specifying null or the empty string will clear the
+     *                     alternate exchange.
      * @throws IOException
+     * @throws JMException
      */
-    void setAlternateExchange(String exchangeName) throws IOException;
+    @MBeanAttribute(name="AlternateExchange", description="Alternate exchange for the queue")
+    void setAlternateExchange(String exchangeName) throws IOException, JMException;
 
     /**
      * Returns the name of the Alternate Exchange for the queue, or null if there isn't one.
@@ -353,7 +383,6 @@ public interface ManagedQueue
      * @return the name of the Alternate Exchange for the queue, or null if there isn't one
      * @throws IOException
      */
-    @MBeanAttribute(name="AlternateExchange", description="Alternate exchange for the queue")
     String getAlternateExchange() throws IOException;
 
     //********** Operations *****************//
@@ -473,4 +502,5 @@ public interface ManagedQueue
                       @MBeanOperationParameter(name="to MessageId", description="to MessageId")long toMessageId,
                       @MBeanOperationParameter(name= ManagedQueue.TYPE, description="to Queue Name")String toQueue)
             throws IOException, JMException;
+
 }

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:r1333988-1368650

Modified: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java (original)
+++ qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java Fri Aug  3 12:13:32 2012
@@ -46,7 +46,7 @@ public interface ServerInformation
      *  Qpid JMX API 1.1 can be assumed.
      */
     int QPID_JMX_API_MAJOR_VERSION = 2;
-    int QPID_JMX_API_MINOR_VERSION = 4;
+    int QPID_JMX_API_MINOR_VERSION = 5;
     
     
     /**

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:r1333988-1368650

Propchange: qpid/branches/asyncstore/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:r1333988-1368650

Modified: qpid/branches/asyncstore/java/management/example/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/management/example/build.xml?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/management/example/build.xml (original)
+++ qpid/branches/asyncstore/java/management/example/build.xml Fri Aug  3 12:13:32 2012
@@ -19,7 +19,6 @@
  -
  -->
 <project name="Management Examples" default="build">
-
     <property name="module.depends" value="management/common"/>
 
     <import file="../../module.xml"/>

Modified: qpid/branches/asyncstore/java/module.xml
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/module.xml?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/module.xml (original)
+++ qpid/branches/asyncstore/java/module.xml Fri Aug  3 12:13:32 2012
@@ -22,7 +22,9 @@
 
   <import file="common.xml"/>
 
-  <path id="maven-ant-tasks.classpath" path="${project.root}/lib/maven-ant-tasks-2.1.1.jar" />
+  <property file="${project.root}/build.deps"/>
+
+  <path id="maven-ant-tasks.classpath" path="${project.root}/${maven-ant-tasks}" />
   <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
            uri="antlib:org.apache.maven.artifact.ant"
            classpathref="maven-ant-tasks.classpath" />
@@ -39,8 +41,6 @@
 	
   <echo message="Running ant for module : ${module}" level="info"/>
 
-  <property file="${project.root}/build.deps"/>
-
   <property name="module.build"        location="${build.scratch}/${module}"/>
   <property name="module.classes"      location="${module.build}/classes"/>
   <property name="module.instrumented" location="${module.build}/classes-instrumented"/>
@@ -55,6 +55,8 @@
   <property name="module.test.src"     location="src/test/java"/>
   <property name="module.bin"          location="bin"/>
   <property name="module.etc"          location="etc"/>
+  <property name="module.src.resources.metainf" location="src/main/resources/META-INF"/>
+  <property name="module.metainf" location="${module.build}/META-INF"/>
     
   <property name="module.namever"      value="${project.name}-${module.name}-${project.version}"/>
   <property name="module.namever.osgi" value="${project.name}-${module.name}_${project.version}.0.osgi"/>
@@ -82,6 +84,7 @@
   <available property="module.test.src.exists" file="${module.test.src}"/>
   <available property="module.etc.exists" file="${module.etc}"/>
   <available property="module.bin.exists" file="${module.bin}"/>
+  <available property="module.src.resources.metainf.exists" file="${module.src.resources.metainf}"/>
 
   <property name="module.source.jar"
             location="${build.lib}/${project.name}-${module.name}-${project.version}-sources.jar"/>
@@ -325,8 +328,42 @@
          <contains substring="${module.name}" string="${exclude.modules}" />
   </condition>
 
+  <!-- JVM args pass to forked Junit JVM -->
   <property name="jvm.args" value=""/>
+  <!-- Following properties are used by the tests -->
+  <property name="test.output" value="${module.results}"/>
+  <property name="QPID_HOME" value="${qpid.home}"/>
+  <property name="QPID_WORK" value="${qpid.work}"/>
   <property name="broker.existing.qpid.work" value=""/>
+  <!-- Used by PluginTest -->
+  <property name="example.plugin.target" value="${project.root}/build/lib/plugins"/>
+
+  <propertyset id="all.test.systemproperties">
+    <propertyref prefix="test"/>
+    <propertyref prefix="profile"/>
+    <propertyref prefix="javax.net.ssl"/>
+    <propertyref prefix="broker"/>
+
+    <propertyref name="amqj.logging.level"/>
+    <propertyref name="amqj.server.logging.level"/>
+    <propertyref name="amqj.protocol.logging.level"/>
+
+    <propertyref name="log4j.debug"/>
+    <propertyref name="log4j.configuration"/>
+
+    <propertyref name="root.logging.level"/>
+    <propertyref name="java.naming.factory.initial"/>
+    <propertyref name="java.naming.provider.url"/>
+    <propertyref name="messagestore.class.name" />
+    <propertyref name="qpid.amqp.version"/>
+    <propertyref name="max_prefetch"/>
+    <propertyref name="qpid.dest_syntax"/>
+
+    <propertyref name="test.output"/>
+    <propertyref name="QPID_HOME"/>
+    <propertyref name="QPID_WORK"/>
+    <propertyref name="example.plugin.target"/>
+  </propertyset>
 
   <target name="test" depends="build,compile-tests" if="module.test.src.exists"
          unless="${dontruntest}" description="execute unit tests">
@@ -341,38 +378,7 @@
 
       <jvmarg line="${jvm.args}" />
 
-      <sysproperty key="amqj.logging.level" value="${amqj.logging.level}"/>
-      <sysproperty key="amqj.server.logging.level" value="${amqj.server.logging.level}"/>
-      <sysproperty key="amqj.protocol.logging.level" value="${amqj.protocol.logging.level}"/>
-      <sysproperty key="log4j.debug" value="${log4j.debug}"/>
-      <sysproperty key="root.logging.level" value="${root.logging.level}"/>
-      <sysproperty key="log4j.configuration" value="${log4j.configuration}"/>
-      <sysproperty key="java.naming.factory.initial" value="${java.naming.factory.initial}"/>
-      <sysproperty key="java.naming.provider.url" value="${java.naming.provider.url}"/>
-      <sysproperty key="messagestorefactory.class.name" value="${messagestorefactory.class.name}" />
-      <sysproperty key="test.output" value="${module.results}"/>
-      <sysproperty key="qpid.amqp.version" value="${qpid.amqp.version}"/>
-
-      <syspropertyset>
-        <propertyref prefix="test"/>
-      </syspropertyset>
-      <syspropertyset>
-        <propertyref prefix="profile"/>
-      </syspropertyset>
-      <syspropertyset>
-        <propertyref prefix="javax.net.ssl"/>
-      </syspropertyset>  
-      <syspropertyset>
-         <propertyref prefix="broker"/>
-      </syspropertyset>
-      
-      <sysproperty key="max_prefetch" value ="${max_prefetch}"/>
-      <sysproperty key="qpid.dest_syntax" value ="${qpid.dest_syntax}"/>
-
-      <sysproperty key="example.plugin.target" value="${project.root}/build/lib/plugins"/>
-      <sysproperty key="QPID_EXAMPLE_HOME" value="${qpid.home}"/>
-      <sysproperty key="QPID_HOME" value="${qpid.home}"/>
-      <sysproperty key="QPID_WORK" value="${qpid.work}"/>
+      <syspropertyset refid="all.test.systemproperties"/>
 
       <formatter type="plain"/>
       <formatter type="xml"/>
@@ -442,16 +448,31 @@
   <target name="postbuild" description="run after a build"/>
 
   <target name="build" depends="jar,jar-tests,jar-sources,libs,copy-bin,copy-etc,postbuild" description="compile and copy resources into build tree"/>
-  <target name="jar.manifest" depends="compile" if="module.manifest">
-    <jar destfile="${module.jar}" basedir="${module.classes}" manifest="${module.manifest}"/>
+
+  <target name="jar.manifest" depends="compile, copy-module-metainf" if="module.manifest">
+    <jar destfile="${module.jar}" basedir="${module.classes}" manifest="${module.manifest}">
+       <metainf dir="${module.metainf}" />
+    </jar>
   </target>
 
-  <target name="jar.nomanifest" depends="compile" unless="module.manifest">
+  <target name="jar.nomanifest" depends="compile, copy-module-metainf" unless="module.manifest">
     <jar destfile="${module.jar}" basedir="${module.classes}">
-       <metainf dir="${project.root}/resources/" />
+       <metainf dir="${module.metainf}" />
     </jar>
   </target>
 
+  <target name="copy-module-metainf" depends="copy-metainf-resources" if="module.src.resources.metainf.exists">
+    <copy todir="${module.metainf}" failonerror="true">
+        <fileset dir="${module.src.resources.metainf}"/>
+    </copy>
+  </target>
+
+  <target name="copy-metainf-resources">
+    <copy todir="${module.metainf}" failonerror="true">
+        <fileset dir="${project.root}/resources/"/>
+    </copy>
+  </target>
+
   <target name="jar" depends="jar.manifest,jar.nomanifest" description="create jar"/>
 
   <target name="jar-tests" depends="compile-tests" description="create unit test jar">
@@ -599,7 +620,7 @@
   <target name="bundle" description="Build module osgi artifact. Override and depend on bundle-tasks to use"/>
 
   <target name="bundle-tasks" depends="jar">
-   <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${project.root}/lib/bnd-0.0.384.jar"/>
+   <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${project.root}/${bnd}"/>
    <echo message="Bundling ${build}/lib/${module.namever}.jar with ${module.src}/${module.name}.bnd"/>
    <bnd 
       classpath="${build}/lib/${module.namever}.jar"
@@ -657,41 +678,19 @@
     </cobertura-instrument>
   </target>
 
-  <target name="cover-test" depends="instrument">
+  <target name="cover-test" depends="instrument" if="module.test.src.exists">
 
-    <mkdir dir="${build.coveragereport}" />
     <junit fork="yes" forkmode="once" maxmemory="${test.mem}" reloading="no"
            haltonfailure="${haltonfailure}" haltonerror="${haltonerror}"
            failureproperty="test.failures" printsummary="on" timeout="600000"
            dir="${project.root}" >
+      <jvmarg line="${jvm.args}" />
 
-      <sysproperty key="amqj.logging.level" value="${amqj.logging.level}"/>
-      <sysproperty key="amqj.protocol.logging.level" value="${amqj.protocol.logging.level}"/>
-      <sysproperty key="log4j.debug" value="${log4j.debug}"/>
-      <sysproperty key="root.logging.level" value="${root.logging.level}"/>
-      <sysproperty key="log4j.configuration" value="${log4j.configuration}"/>
-      <sysproperty key="java.naming.factory.initial" value="${java.naming.factory.initial}"/>
-      <sysproperty key="java.naming.provider.url" value="${java.naming.provider.url}"/>
-      <sysproperty key="broker" value="${broker}"/>
-      <sysproperty key="broker.version" value="${broker.version}"/>
-      <sysproperty key="broker.ready" value="${broker.ready}" />
-      <sysproperty key="test.output" value="${module.results}"/>
-
-      <syspropertyset>
-        <propertyref prefix="test"/>
-      </syspropertyset>
-      <syspropertyset>
-          <propertyref prefix="broker"/>
-      </syspropertyset>
-
-      <sysproperty key="max_prefetch" value ="${max_prefetch}"/>
-      <sysproperty key="example.plugin.target" value="${project.root}/build/lib/plugins"/>
-      <sysproperty key="QPID_EXAMPLE_HOME" value="${project.root}/build"/>
-      <sysproperty key="QPID_HOME" value="${project.root}/build"/>
+      <syspropertyset refid="all.test.systemproperties"/>
 
       <sysproperty key="net.sourceforge.cobertura.datafile"
 		file="${cobertura.datafile}" />
-      
+
       <formatter type="plain"/>
       <formatter type="xml"/>
 
@@ -713,14 +712,13 @@
   </target>
 
   <target name="coverage-report" depends="cobertura-init">
-      <echo message="${cobertura.datafile}"/>
       <cobertura-report format="html"
                       destdir="${module.coverage}"
 		      datafile="${cobertura.datafile}">
       <fileset dir="${module.src}" includes="**/*.java" />
     </cobertura-report>
   </target>
-  
+
   <property name="version.file" location="${module.classes}/qpidversion.properties"/>
   <property file="${version.file}" prefix="old."/>
 
@@ -809,7 +807,7 @@ qpid.name=${project.name}
         <classpath>
           <pathelement path="${module.src}"/>
           <pathelement path="${velocity.compile.dir}" />
-          <fileset dir="${project.root}/lib">
+          <fileset dir="${project.root}/lib/required">
             <include name="**/*.jar"/>
           </fileset>
           <pathelement path="${gentools.home}/lib/velocity-1.4.jar" />

Modified: qpid/branches/asyncstore/java/perftests/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/build.xml?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/build.xml (original)
+++ qpid/branches/asyncstore/java/perftests/build.xml Fri Aug  3 12:13:32 2012
@@ -20,10 +20,16 @@
  -->
 <project name="Performance Tests" default="build">
     <condition property="perftests.optional.test.depends" value="bdbstore" else="">
+      <or>
         <and>
             <contains string="${modules.opt}" substring="bdbstore"/>
             <contains string="${profile}" substring="bdb"/>
         </and>
+        <and>
+            <istrue value="${optional}"/>
+            <contains string="${profile}" substring="bdb"/>
+        </and>
+      </or>
     </condition>
 
     <property name="module.depends" value="client common"/>
@@ -38,4 +44,24 @@
     <property name="log4j.config" value="-Dlog4j.configuration=perftests.log4j"/>
     <property name="properties" value="perftests.properties"/>
 
+    <target name="release-bin" depends="release-bin-tasks"/>
+
+    <target name="libs-release" description="overridden to not copy depended-on modules or their dependencies, so that a perf tests release is not tied to a particular client version">
+        <!-- Copy the module dependencies -->
+        <echo message="${module.libs}"/>
+        <echo message="overridden to not copy qpid-client or its dependencies so that this release is not tied to a particular client version"/>
+
+        <copylist todir="${module.release}/lib" dir="${project.root}" files="${module.libs}"/>
+        <!-- Copy the jar for this module -->
+        <copy todir="${module.release}/lib" failonerror="true">
+            <fileset file="${module.jar}"/>
+        </copy>
+    </target>
+
+	<target name="copy-etc-release" description="override target from module.xml to set flatten=false">
+        <copy todir="${module.release}/etc" failonerror="false" flatten="false">
+            <fileset dir="${module.etc}"/>
+        </copy>
+    </target>
+
 </project>

Modified: qpid/branches/asyncstore/java/perftests/etc/log4j.properties
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/etc/log4j.properties?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/etc/log4j.properties (original)
+++ qpid/branches/asyncstore/java/perftests/etc/log4j.properties Fri Aug  3 12:13:32 2012
@@ -25,4 +25,4 @@ log4j.appender.console=org.apache.log4j.
 log4j.appender.console.Threshold=all
 log4j.appender.console.layout=org.apache.log4j.PatternLayout
 
-log4j.appender.console.layout.ConversionPattern=%d %p [%c{1}] %m%n
\ No newline at end of file
+log4j.appender.console.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n

Modified: qpid/branches/asyncstore/java/perftests/etc/perftests-jndi.properties
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/etc/perftests-jndi.properties?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/etc/perftests-jndi.properties (original)
+++ qpid/branches/asyncstore/java/perftests/etc/perftests-jndi.properties Fri Aug  3 12:13:32 2012
@@ -15,12 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# this file is used for running system tests of the performance test framework,
-# (i.e. not for running the performance tests themselves!)
-
 java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
 
-# use QpidBrokerTestCase's default port
 connectionfactory.connectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
 
-destination.controllerqueue = direct://amq.direct//controllerqueue
+destination.controllerqueue = direct://amq.direct//controllerqueue?autodelete='true'

Modified: qpid/branches/asyncstore/java/perftests/example/log4j.properties
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/example/log4j.properties?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/example/log4j.properties (original)
+++ qpid/branches/asyncstore/java/perftests/example/log4j.properties Fri Aug  3 12:13:32 2012
@@ -25,11 +25,11 @@ log4j.appender.console=org.apache.log4j.
 log4j.appender.console.Threshold=all
 log4j.appender.console.layout=org.apache.log4j.PatternLayout
 
-log4j.appender.console.layout.ConversionPattern=%d %p [%c{1}] %m%n
+log4j.appender.console.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n
 
 log4j.appender.fileApp=org.apache.log4j.FileAppender
 log4j.appender.fileApp.file=perftests.log
 log4j.appender.fileApp.Threshold=info
 log4j.appender.fileApp.append=false
 log4j.appender.fileApp.layout=org.apache.log4j.PatternLayout
-log4j.appender.fileApp.layout.ConversionPattern=%d %p [%c{1}] %m%n
\ No newline at end of file
+log4j.appender.fileApp.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n

Modified: qpid/branches/asyncstore/java/perftests/example/perftests-jndi.properties
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/example/perftests-jndi.properties?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/example/perftests-jndi.properties (original)
+++ qpid/branches/asyncstore/java/perftests/example/perftests-jndi.properties Fri Aug  3 12:13:32 2012
@@ -23,4 +23,4 @@ java.naming.factory.initial = org.apache
 # use QpidBrokerTestCase's default port
 connectionfactory.connectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
 
-destination.controllerqueue = direct://amq.direct//controllerqueue
+destination.controllerqueue = direct://amq.direct//controllerqueue?autodelete='true'

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java Fri Aug  3 12:13:32 2012
@@ -19,13 +19,9 @@
  */
 package org.apache.qpid.disttest;
 
-import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileWriter;
-import java.io.FilenameFilter;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 import javax.naming.Context;
@@ -54,6 +50,7 @@ public class ControllerRunner extends Ab
 
     private final Aggregator _aggregator = new Aggregator();
 
+    private final ConfigFileHelper _configFileHelper = new ConfigFileHelper();
 
     public ControllerRunner()
     {
@@ -89,7 +86,8 @@ public class ControllerRunner extends Ab
     {
         Controller controller = new Controller(jmsDelegate, DistributedTestConstants.REGISTRATION_TIMEOUT, DistributedTestConstants.COMMAND_RESPONSE_TIMEOUT);
 
-        final List<String> testConfigFiles = getTestConfigFiles();
+        String testConfigPath = getCliOptions().get(ControllerRunner.TEST_CONFIG_PROP);
+        List<String> testConfigFiles = _configFileHelper.getTestConfigFiles(testConfigPath);
         createClientsIfNotDistributed(testConfigFiles);
 
         try
@@ -105,11 +103,14 @@ public class ControllerRunner extends Ab
                 runTest(controller, testConfigFile);
             }
         }
+        catch(Exception e)
+        {
+            LOGGER.error("Problem running test", e);
+        }
         finally
         {
             controller.stopAllRegisteredClients();
         }
-
     }
 
     private void runTest(Controller controller, String testConfigFile)
@@ -120,7 +121,8 @@ public class ControllerRunner extends Ab
         ResultsForAllTests rawResultsForAllTests = controller.runAllTests();
         ResultsForAllTests resultsForAllTests = _aggregator.aggregateResults(rawResultsForAllTests);
 
-        final String outputFile = generateOutputCsvNameFrom(testConfigFile);
+        String outputDir = getCliOptions().get(ControllerRunner.OUTPUT_DIR_PROP);
+        final String outputFile = _configFileHelper.generateOutputCsvNameFrom(testConfigFile, outputDir);
         writeResultsToFile(resultsForAllTests, outputFile);
     }
 
@@ -176,44 +178,6 @@ public class ControllerRunner extends Ab
         }
     }
 
-    private String generateOutputCsvNameFrom(String testConfigFile)
-    {
-        final String filenameOnlyWithExtension = new File(testConfigFile).getName();
-        final String cvsFile = filenameOnlyWithExtension.replaceFirst(".?\\w*$", ".csv");
-        final String outputDir = String.valueOf(getCliOptions().get(ControllerRunner.OUTPUT_DIR_PROP));
-
-        return new File(outputDir, cvsFile).getAbsolutePath();
-    }
-
-    private List<String> getTestConfigFiles()
-    {
-        final List<String> testConfigFile = new ArrayList<String>();
-        final File configFileOrDirectory = new File(getCliOptions().get(ControllerRunner.TEST_CONFIG_PROP));
-
-        if (configFileOrDirectory.isDirectory())
-        {
-            final String[] configFiles = configFileOrDirectory.list(new FilenameFilter()
-            {
-                @Override
-                public boolean accept(File dir, String name)
-                {
-                    return new File(dir, name).isFile() && name.endsWith(".json");
-                }
-            });
-
-            for (String configFile : configFiles)
-            {
-                testConfigFile.add(new File(configFileOrDirectory, configFile).getAbsolutePath());
-            }
-        }
-        else
-        {
-            testConfigFile.add(configFileOrDirectory.getAbsolutePath());
-        }
-
-        return testConfigFile;
-    }
-
     private Config buildTestConfigFrom(String testConfigFile)
     {
         ConfigReader configReader = new ConfigReader();

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java Fri Aug  3 12:13:32 2012
@@ -26,8 +26,10 @@ public abstract class DistributedTestCon
     public static final String MSG_COMMAND_PROPERTY = "COMMAND";
     public static final String MSG_JSON_PROPERTY = "JSON";
 
-    public static final long REGISTRATION_TIMEOUT = 60000;
-    public static final long COMMAND_RESPONSE_TIMEOUT = 10000;
+    public static final long REGISTRATION_TIMEOUT = 60 * 1000;
+
+    /** set to a long time out because stopping clients can take a long time */
+    public static final long COMMAND_RESPONSE_TIMEOUT = 120 * 1000;
 
     public static final String CONTROLLER_QUEUE_JNDI_NAME = "controllerqueue";
 }

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/Client.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/Client.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/Client.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/Client.java Fri Aug  3 12:13:32 2012
@@ -103,9 +103,9 @@ public class Client
 
     public void processInstruction(final Command command)
     {
-        if (LOGGER.isInfoEnabled())
+        if (LOGGER.isDebugEnabled())
         {
-            LOGGER.info("Client " + getClientName() + " received command: " + command);
+            LOGGER.debug("Client " + getClientName() + " received command: " + command);
         }
         String responseMessage = null;
         try
@@ -174,9 +174,9 @@ public class Client
     {
         if (_state.compareAndSet(ClientState.RUNNING_TEST, ClientState.READY))
         {
-            LOGGER.info("Tearing down test on client: " + _clientJmsDelegate.getClientName());
+            LOGGER.debug("Tearing down test on client: " + _clientJmsDelegate.getClientName());
 
-            _clientJmsDelegate.closeTestConnections();
+            _clientJmsDelegate.tearDownTest();
         }
         else
         {
@@ -190,7 +190,7 @@ public class Client
     public void sendResults(ParticipantResult testResult)
     {
         _clientJmsDelegate.sendResponseMessage(testResult);
-        LOGGER.info("Sent test results " + testResult);
+        LOGGER.debug("Sent test results " + testResult);
     }
 
     @Override

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ConsumerParticipant.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ConsumerParticipant.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ConsumerParticipant.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ConsumerParticipant.java Fri Aug  3 12:13:32 2012
@@ -20,13 +20,16 @@
 package org.apache.qpid.disttest.client;
 
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 import java.util.NavigableSet;
 import java.util.concurrent.ConcurrentSkipListSet;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
+import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageListener;
 
@@ -53,12 +56,17 @@ public class ConsumerParticipant impleme
     private long _startTime;
 
     private volatile Exception _asyncMessageListenerException;
+    private List<Long> _messageLatencies;
 
     public ConsumerParticipant(final ClientJmsDelegate delegate, final CreateConsumerCommand command)
     {
         _jmsDelegate = delegate;
         _command = command;
         _resultFactory = new ParticipantResultFactory();
+        if (command.isEvaluateLatency())
+        {
+            _messageLatencies = new ArrayList<Long>();
+        }
     }
 
     @Override
@@ -78,6 +86,8 @@ public class ConsumerParticipant impleme
         }
         else
         {
+            LOGGER.info("Consumer {} registering listener", getName());
+
             _jmsDelegate.registerListener(_command.getParticipantName(), new MessageListener(){
 
                 @Override
@@ -105,14 +115,14 @@ public class ConsumerParticipant impleme
                 numberOfMessagesSent,
                 payloadSize,
                 totalPayloadSize,
-                start, end);
+                start, end, _messageLatencies);
 
         return result;
     }
 
     private void synchronousRun()
     {
-        LOGGER.debug("entered synchronousRun: " + this);
+        LOGGER.info("Consumer {} about to consume messages", getName());
 
         _startTime = System.currentTimeMillis();
 
@@ -130,25 +140,42 @@ public class ConsumerParticipant impleme
      */
     private boolean processMessage(Message message)
     {
-        int messageCount = _totalNumberOfMessagesReceived.incrementAndGet();
-        if (LOGGER.isTraceEnabled())
-        {
-            LOGGER.trace("message " + messageCount + " received by " + this);
-        }
-        int messagePayloadSize = _jmsDelegate.calculatePayloadSizeFrom(message);
-        _allConsumedPayloadSizes.add(messagePayloadSize);
-        _totalPayloadSizeOfAllMessagesReceived.addAndGet(messagePayloadSize);
-
+        int messageCount = message == null? _totalNumberOfMessagesReceived.get() : _totalNumberOfMessagesReceived.incrementAndGet() ;
         boolean batchEnabled = _command.getBatchSize() > 0;
         boolean batchComplete = batchEnabled && messageCount % _command.getBatchSize() == 0;
-
-        if (!batchEnabled || batchComplete)
+        if (message != null)
         {
-            if (LOGGER.isTraceEnabled() && batchEnabled)
+            if (LOGGER.isTraceEnabled())
             {
-                LOGGER.trace("Committing: batch size " + _command.getBatchSize() );
+                LOGGER.trace("message " + messageCount + " received by " + this);
+            }
+            int messagePayloadSize = _jmsDelegate.calculatePayloadSizeFrom(message);
+            _allConsumedPayloadSizes.add(messagePayloadSize);
+            _totalPayloadSizeOfAllMessagesReceived.addAndGet(messagePayloadSize);
+
+            if (_command.isEvaluateLatency())
+            {
+                long mesageTimestamp;
+                try
+                {
+                    mesageTimestamp = message.getJMSTimestamp();
+                }
+                catch (JMSException e)
+                {
+                    throw new DistributedTestException("Cannot get message timestamp!", e);
+                }
+                long latency = System.currentTimeMillis() - mesageTimestamp;
+                _messageLatencies.add(latency);
+            }
+
+            if (!batchEnabled || batchComplete)
+            {
+                if (LOGGER.isTraceEnabled() && batchEnabled)
+                {
+                    LOGGER.trace("Committing: batch size " + _command.getBatchSize() );
+                }
+                _jmsDelegate.commitOrAcknowledgeMessage(message, _command.getSessionName());
             }
-            _jmsDelegate.commitOrAcknowledgeMessage(message, _command.getSessionName());
         }
 
         boolean reachedExpectedNumberOfMessages = _command.getNumberOfMessages() > 0 && messageCount >= _command.getNumberOfMessages();

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/MessageProvider.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/MessageProvider.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/MessageProvider.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/MessageProvider.java Fri Aug  3 12:13:32 2012
@@ -169,8 +169,14 @@ public class MessageProvider
     protected Message createTextMessage(Session ssn, final CreateProducerCommand command) throws JMSException
     {
         String payload = getMessagePayload(command);
-        TextMessage msg = ssn.createTextMessage();
+
+        TextMessage msg = null;
+        synchronized(ssn)
+        {
+            msg = ssn.createTextMessage();
+        }
         msg.setText(payload);
+
         return msg;
     }
 

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantExecutor.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantExecutor.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantExecutor.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantExecutor.java Fri Aug  3 12:13:32 2012
@@ -56,7 +56,7 @@ public class ParticipantExecutor
     {
         _client = client;
 
-        LOGGER.info("Starting test participant in background thread: " + this);
+        LOGGER.debug("Starting test participant in background thread: " + this);
         _executor.execute(new ParticipantRunnable());
     }
 
@@ -94,9 +94,9 @@ public class ParticipantExecutor
             ParticipantResult result = null;
             try
             {
-                if (LOGGER.isInfoEnabled())
+                if (LOGGER.isDebugEnabled())
                 {
-                    LOGGER.info("About to run participant " + _participant);
+                    LOGGER.debug("About to run participant " + _participant);
                 }
                 result = _participant.doIt(_client.getClientName());
             }

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantResultFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantResultFactory.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantResultFactory.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantResultFactory.java Fri Aug  3 12:13:32 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.qpid.disttest.client;
 
+import java.util.Collection;
 import java.util.Date;
 
 import org.apache.qpid.disttest.message.ConsumerParticipantResult;
@@ -26,12 +27,24 @@ import org.apache.qpid.disttest.message.
 import org.apache.qpid.disttest.message.CreateProducerCommand;
 import org.apache.qpid.disttest.message.ParticipantResult;
 import org.apache.qpid.disttest.message.ProducerParticipantResult;
+import org.apache.qpid.disttest.results.aggregation.SeriesStatistics;
 
 public class ParticipantResultFactory
 {
-    public ConsumerParticipantResult createForConsumer(String participantName, String clientRegisteredName, CreateConsumerCommand command, int acknowledgeMode, int numberOfMessagesReceived, int payloadSize, long totalPayloadReceived, Date start, Date end)
+    public ConsumerParticipantResult createForConsumer(String participantName, String clientRegisteredName,
+            CreateConsumerCommand command, int acknowledgeMode, int numberOfMessagesReceived, int payloadSize,
+            long totalPayloadReceived, Date start, Date end)
+    {
+        return createForConsumer(participantName, clientRegisteredName, command, acknowledgeMode, numberOfMessagesReceived,
+                payloadSize, totalPayloadReceived, start, end, null);
+    }
+
+    public ConsumerParticipantResult createForConsumer(String participantName, String clientRegisteredName,
+            CreateConsumerCommand command, int acknowledgeMode, int numberOfMessagesReceived, int payloadSize,
+            long totalPayloadReceived, Date start, Date end, Collection<Long> messageLatencies)
     {
         ConsumerParticipantResult consumerParticipantResult = new ConsumerParticipantResult();
+        consumerParticipantResult.setMessageLatencies(messageLatencies);
 
         setTestProperties(consumerParticipantResult, command, participantName, clientRegisteredName, acknowledgeMode);
         setTestResultProperties(consumerParticipantResult, numberOfMessagesReceived, payloadSize, totalPayloadReceived, start, end);
@@ -45,6 +58,11 @@ public class ParticipantResultFactory
         consumerParticipantResult.setTotalNumberOfConsumers(1);
         consumerParticipantResult.setTotalNumberOfProducers(0);
 
+        SeriesStatistics statistics = new SeriesStatistics(messageLatencies);
+        consumerParticipantResult.setAverageLatency(statistics.getAverage());
+        consumerParticipantResult.setMinLatency(statistics.getMinimum());
+        consumerParticipantResult.setMaxLatency(statistics.getMaximum());
+        consumerParticipantResult.setLatencyStandardDeviation(statistics.getStandardDeviation());
         return consumerParticipantResult;
     }
 

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ProducerParticipant.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ProducerParticipant.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ProducerParticipant.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/client/ProducerParticipant.java Fri Aug  3 12:13:32 2012
@@ -22,10 +22,14 @@ package org.apache.qpid.disttest.client;
 import java.util.Date;
 import java.util.NavigableSet;
 import java.util.TreeSet;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CancellationException;
 
 import javax.jms.Message;
 
 import org.apache.qpid.disttest.DistributedTestException;
+import org.apache.qpid.disttest.client.utils.ExecutorWithLimits;
+import org.apache.qpid.disttest.client.utils.ExecutorWithLimitsFactory;
 import org.apache.qpid.disttest.jms.ClientJmsDelegate;
 import org.apache.qpid.disttest.message.CreateProducerCommand;
 import org.apache.qpid.disttest.message.ParticipantResult;
@@ -40,7 +44,9 @@ public class ProducerParticipant impleme
 
     private final CreateProducerCommand _command;
 
-    private ParticipantResultFactory _resultFactory;
+    private final ParticipantResultFactory _resultFactory;
+
+    private ExecutorWithLimits _limiter;
 
     public ProducerParticipant(final ClientJmsDelegate jmsDelegate, final CreateProducerCommand command)
     {
@@ -59,10 +65,10 @@ public class ProducerParticipant impleme
 
         int acknowledgeMode = _jmsDelegate.getAcknowledgeMode(_command.getSessionName());
 
-        long expectedDuration = _command.getMaximumDuration() - _command.getStartDelay();
-
         doSleepForStartDelay();
 
+        final long requiredDuration = _command.getMaximumDuration() - _command.getStartDelay();
+
         final long startTime = System.currentTimeMillis();
 
         Message lastPublishedMessage = null;
@@ -70,11 +76,30 @@ public class ProducerParticipant impleme
         long totalPayloadSizeOfAllMessagesSent = 0;
         NavigableSet<Integer> allProducedPayloadSizes = new TreeSet<Integer>();
 
+        _limiter = ExecutorWithLimitsFactory.createExecutorWithLimit(startTime, requiredDuration);
+
+        LOGGER.info("Producer {} about to send messages", getName());
+
         while (true)
         {
-            numberOfMessagesSent++;
+            try
+            {
+                lastPublishedMessage = _limiter.execute(new Callable<Message>()
+                {
+                    @Override
+                    public Message call() throws Exception
+                    {
+                        return _jmsDelegate.sendNextMessage(_command);
+                    }
+                });
+            }
+            catch (CancellationException ce)
+            {
+                LOGGER.debug("Producer send was cancelled due to maximum duration {} ms", requiredDuration);
+                break;
+            }
 
-            lastPublishedMessage = _jmsDelegate.sendNextMessage(_command);
+            numberOfMessagesSent++;
 
             int lastPayloadSize = _jmsDelegate.calculatePayloadSizeFrom(lastPublishedMessage);
             totalPayloadSizeOfAllMessagesSent += lastPayloadSize;
@@ -96,15 +121,11 @@ public class ProducerParticipant impleme
                 }
                 _jmsDelegate.commitOrAcknowledgeMessage(lastPublishedMessage, _command.getSessionName());
 
-                if (_command.getInterval() > 0)
-                {
-                    // sleep for given time
-                    Thread.sleep(_command.getInterval());
-                }
+                doSleepForInterval();
             }
 
             if (_command.getNumberOfMessages() > 0 && numberOfMessagesSent >= _command.getNumberOfMessages()
-                            || expectedDuration > 0 && System.currentTimeMillis() - startTime >= expectedDuration)
+                            || requiredDuration > 0 && System.currentTimeMillis() - startTime >= requiredDuration)
             {
                 break;
             }
@@ -140,23 +161,43 @@ public class ProducerParticipant impleme
 
     private void doSleepForStartDelay()
     {
-        if (_command.getStartDelay() > 0)
+        long sleepTime = _command.getStartDelay();
+        if (sleepTime > 0)
         {
+            LOGGER.debug("{} sleeping for {} milliseconds before starting", getName(), sleepTime);
             // start delay is specified. Sleeping...
-            try
-            {
-                Thread.sleep(_command.getStartDelay());
-            }
-            catch (final InterruptedException e)
-            {
-                Thread.currentThread().interrupt();
-            }
+            doSleep(sleepTime);
+        }
+    }
+
+    private void doSleepForInterval() throws InterruptedException
+    {
+        long sleepTime = _command.getInterval();
+        if (sleepTime > 0)
+        {
+            doSleep(sleepTime);
+        }
+    }
+
+    private void doSleep(long sleepTime)
+    {
+        try
+        {
+            Thread.sleep(sleepTime);
+        }
+        catch (final InterruptedException e)
+        {
+            Thread.currentThread().interrupt();
         }
     }
 
     @Override
     public void releaseResources()
     {
+        if (_limiter != null)
+        {
+            _limiter.shutdown();
+        }
         _jmsDelegate.closeTestProducer(_command.getParticipantName());
     }
 
@@ -171,4 +212,5 @@ public class ProducerParticipant impleme
     {
         return "ProducerParticipant [command=" + _command + "]";
     }
+
 }

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java Fri Aug  3 12:13:32 2012
@@ -92,15 +92,18 @@ public class Controller
         }
     }
 
-    private void awaitLatch(CountDownLatch latch, long timeout, String messageWithOneDecimalPlaceholder)
+    private void awaitStopResponses(CountDownLatch latch, long timeout)
     {
+        String message = "Timed out after %d waiting for stop command responses. Expecting %d more responses.";
+
         try
         {
-            final boolean countedDownOK = latch.await(timeout, TimeUnit.MILLISECONDS);
+            boolean countedDownOK = latch.await(timeout, TimeUnit.MILLISECONDS);
             if (!countedDownOK)
             {
-                final long latchCount = latch.getCount();
-                String formattedMessage = String.format(messageWithOneDecimalPlaceholder, latchCount);
+                long latchCount = latch.getCount();
+                String formattedMessage = String.format(message, timeout, latchCount);
+                LOGGER.error(formattedMessage);
                 throw new DistributedTestException(formattedMessage);
             }
         }
@@ -141,7 +144,7 @@ public class Controller
             _jmsDelegate.sendCommandToClient(clientName, command);
         }
 
-        awaitLatch(_stopClientsResponseLatch, _commandResponseTimeout, "Timed out waiting for stop command responses. Expecting %d more responses.");
+        awaitStopResponses(_stopClientsResponseLatch, _commandResponseTimeout);
 
         LOGGER.info("Stopped all clients");
     }

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java Fri Aug  3 12:13:32 2012
@@ -104,6 +104,11 @@ public class TestRunner
 
             return _testResult;
         }
+        catch(RuntimeException e)
+        {
+            LOGGER.error("Couldn't run test", e);
+            throw e;
+        }
         finally
         {
             _jmsDelegate.removeCommandListener(participantResultListener);
@@ -140,7 +145,6 @@ public class TestRunner
             }
 
             Runtime.getRuntime().removeShutdownHook(_removeQueuesShutdownHook);
-
         }
     }
 
@@ -176,7 +180,7 @@ public class TestRunner
 
     void awaitCommandResponses()
     {
-        awaitLatch(_commandResponseLatch, _commandResponseTimeout, "Timed out waiting for command responses. Expecting %d more responses.");
+        awaitLatch(_commandResponseLatch, _commandResponseTimeout, "Timed out waiting for command responses");
     }
 
 
@@ -204,7 +208,7 @@ public class TestRunner
         {
             try
             {
-                awaitLatch(_testResultsLatch, interval, "Waiting for participant results... Expecting %d more responses.");
+                awaitLatch(_testResultsLatch, interval, "still waiting for participant results");
             }
             catch (DistributedTestException e)
             {
@@ -253,7 +257,7 @@ public class TestRunner
         setOriginalTestDetailsOn(result);
 
         _testResult.addParticipantResult(result);
-        LOGGER.info("Received result " + result);
+        LOGGER.debug("Received result " + result);
 
         _testResultsLatch.countDown();
         checkForResponseError(result);
@@ -276,7 +280,7 @@ public class TestRunner
         _jmsDelegate.sendCommandToClient(registeredClientName, command);
     }
 
-    private void awaitLatch(CountDownLatch latch, long timeout, String messageWithOneDecimalPlaceholder)
+    private void awaitLatch(CountDownLatch latch, long timeout, String message)
     {
         try
         {
@@ -284,7 +288,8 @@ public class TestRunner
             if (!countedDownOK)
             {
                 final long latchCount = latch.getCount();
-                String formattedMessage = String.format(messageWithOneDecimalPlaceholder, latchCount);
+                String formattedMessage = "After " + timeout + "ms ... " + message + " ... Expecting " + latchCount + " more responses.";
+                LOGGER.info(formattedMessage); // info rather than error because we time out periodically so we can log progress
                 throw new DistributedTestException(formattedMessage);
             }
         }

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConfigReader.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConfigReader.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConfigReader.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConfigReader.java Fri Aug  3 12:13:32 2012
@@ -22,24 +22,44 @@ package org.apache.qpid.disttest.control
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.Reader;
+import java.io.StringReader;
 
 import org.apache.qpid.disttest.client.property.PropertyValue;
 import org.apache.qpid.disttest.json.PropertyValueAdapter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 
 public class ConfigReader
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigReader.class);
 
     public Config getConfigFromFile(String fileName) throws FileNotFoundException
     {
-        FileReader reader = new FileReader(fileName);
+        Reader reader = getConfigReader(fileName);
 
         Config config = readConfig(reader);
         return config;
     }
 
+    protected Reader getConfigReader(String fileName) throws FileNotFoundException
+    {
+        Reader reader = null;
+        if (fileName.endsWith(".js"))
+        {
+            LOGGER.info("Evaluating javascript:" + fileName);
+            reader = new StringReader(new JavaScriptConfigEvaluator().evaluateJavaScript(fileName));
+        }
+        else
+        {
+            LOGGER.info("Loading JSON:" + fileName);
+            reader = new FileReader(fileName);
+        }
+        return reader;
+    }
+
     public Config readConfig(Reader reader)
     {
         Gson gson = new GsonBuilder()

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConsumerConfig.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConsumerConfig.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConsumerConfig.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConsumerConfig.java Fri Aug  3 12:13:32 2012
@@ -1,3 +1,23 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
 package org.apache.qpid.disttest.controller.config;
 
 import org.apache.qpid.disttest.message.CreateConsumerCommand;
@@ -10,6 +30,7 @@ public class ConsumerConfig extends Part
     private String _selector;
     private boolean _noLocal;
     private boolean _synchronous;
+    private boolean _evaluateLatency;
 
     // For Gson
     public ConsumerConfig()
@@ -58,6 +79,7 @@ public class ConsumerConfig extends Part
         createConsumerCommand.setSelector(_selector);
         createConsumerCommand.setNoLocal(_noLocal);
         createConsumerCommand.setSynchronous(_synchronous);
+        createConsumerCommand.setEvaluateLatency(_evaluateLatency);
 
         return createConsumerCommand;
     }

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ParticipantConfig.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ParticipantConfig.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ParticipantConfig.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ParticipantConfig.java Fri Aug  3 12:13:32 2012
@@ -18,10 +18,20 @@
  */
 package org.apache.qpid.disttest.controller.config;
 
+import org.apache.commons.lang.ObjectUtils;
 import org.apache.qpid.disttest.message.CreateParticpantCommand;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public abstract class ParticipantConfig
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantConfig.class);
+
+    public static final String DURATION_OVERRIDE_SYSTEM_PROPERTY = "qpid.disttest.duration";
+
+    /** used to ensure we only log about the overridden duration once */
+    private boolean _alreadyLoggedAboutOverriddenDuration;
+
     private String _destinationName;
     private long _numberOfMessages;
     private String _name;
@@ -58,7 +68,34 @@ public abstract class ParticipantConfig
         createParticipantCommand.setDestinationName(_destinationName);
         createParticipantCommand.setNumberOfMessages(_numberOfMessages);
         createParticipantCommand.setBatchSize(_batchSize);
-        createParticipantCommand.setMaximumDuration(_maximumDuration);
+
+        Long maximumDuration = (Long)ObjectUtils.defaultIfNull(getOverriddenDuration(), _maximumDuration);
+        createParticipantCommand.setMaximumDuration(maximumDuration);
     }
 
+    private Long getOverriddenDuration()
+    {
+        String overriddenDurationString = System.getProperty(DURATION_OVERRIDE_SYSTEM_PROPERTY);
+        if(overriddenDurationString != null)
+        {
+            try
+            {
+                long overriddenDuration = Long.valueOf(overriddenDurationString);
+
+                if(!_alreadyLoggedAboutOverriddenDuration)
+                {
+                    LOGGER.info("Applied overridden maximum duration " + overriddenDuration);
+                    _alreadyLoggedAboutOverriddenDuration = true;
+                }
+
+                return overriddenDuration;
+            }
+            catch (NumberFormatException e)
+            {
+                LOGGER.error("Couldn't parse overridden duration " + overriddenDurationString, e);
+            }
+        }
+
+        return null;
+    }
 }
\ No newline at end of file

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ProducerConfig.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ProducerConfig.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ProducerConfig.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ProducerConfig.java Fri Aug  3 12:13:32 2012
@@ -37,7 +37,7 @@ public class ProducerConfig extends Part
     public ProducerConfig()
     {
         _deliveryMode = Message.DEFAULT_DELIVERY_MODE;
-        _messageSize = 0;
+        _messageSize = 1024;
         _priority = Message.DEFAULT_PRIORITY;
         _timeToLive = Message.DEFAULT_TIME_TO_LIVE;
         _interval = 0;

Modified: qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/QueueConfig.java
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/QueueConfig.java?rev=1368910&r1=1368909&r2=1368910&view=diff
==============================================================================
--- qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/QueueConfig.java (original)
+++ qpid/branches/asyncstore/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/QueueConfig.java Fri Aug  3 12:13:32 2012
@@ -38,7 +38,6 @@ public class QueueConfig
 
     public QueueConfig(String name, boolean durable, Map<String, Object> attributes)
     {
-        super();
         this._name = name;
         this._durable = durable;
         this._attributes = attributes;
@@ -49,8 +48,6 @@ public class QueueConfig
         return _name;
     }
 
-    // TODO x-qpid-capacity and x-qpid-flow-resume-capacity need to be typed as numeric but we currrently
-    // pass these as a string.
     public Map<String, Object> getAttributes()
     {
         return _attributes;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org