You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by sh...@apache.org on 2011/10/20 20:43:26 UTC

svn commit: r1186990 [38/43] - in /qpid/branches/QPID-2519: ./ bin/ cpp/ cpp/bindings/ cpp/bindings/qmf/python/ cpp/bindings/qmf/ruby/ cpp/bindings/qmf/tests/ cpp/bindings/qmf2/ cpp/bindings/qmf2/examples/cpp/ cpp/bindings/qmf2/python/ cpp/bindings/qmf...

Modified: qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-aclv2.xml
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-aclv2.xml?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-aclv2.xml (original)
+++ qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-aclv2.xml Thu Oct 20 18:42:46 2011
@@ -22,7 +22,7 @@
 <configuration>
     <system/>
     <override>
-        <xml fileName="${test.virtualhosts}" optional="true"/>
+        <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/>
         <xml fileName="${QPID_HOME}/etc/virtualhosts-systests-aclv2-settings.xml"/>
         <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/>
     </override>

Modified: qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-derby.xml
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-derby.xml?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-derby.xml (original)
+++ qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-derby.xml Thu Oct 20 18:42:46 2011
@@ -22,7 +22,7 @@
 <configuration>
     <system/>
     <override>
-        <xml fileName="${test.virtualhosts}" optional="true"/>
+        <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/>
         <xml fileName="${QPID_HOME}/etc/virtualhosts-systests-derby-settings.xml"/>
         <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/>
     </override>

Modified: qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-firewall.xml
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-firewall.xml?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-firewall.xml (original)
+++ qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests-firewall.xml Thu Oct 20 18:42:46 2011
@@ -22,7 +22,7 @@
 <configuration>
     <system/>
     <override>
-        <xml fileName="${test.virtualhosts}" optional="true"/>
+        <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/>
         <xml fileName="${QPID_FIREWALL_VIRTUALHOSTS_SETTINGS}" optional="true"/>
         <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/>                
     </override>

Modified: qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests.xml
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests.xml?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests.xml (original)
+++ qpid/branches/QPID-2519/java/systests/etc/virtualhosts-systests.xml Thu Oct 20 18:42:46 2011
@@ -22,7 +22,7 @@
 <configuration>
     <system/>
     <override>
-        <xml fileName="${test.virtualhosts}" optional="true"/>
+        <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/>
         <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/>                
     </override>
 </configuration>

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java Thu Oct 20 18:42:46 2011
@@ -30,19 +30,16 @@ import javax.jms.TextMessage;
 
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.client.transport.TransportConnection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class AMQQueueDeferredOrderingTest extends QpidBrokerTestCase
 {
-
-    private static final int NUM_MESSAGES = 1000;
-
     private Connection con;
     private Session session;
     private AMQQueue queue;
     private MessageConsumer consumer;
+    private int numMessages;
 
     private static final Logger _logger = LoggerFactory.getLogger(AMQQueueDeferredOrderingTest.class);
 
@@ -88,6 +85,8 @@ public class AMQQueueDeferredOrderingTes
     {
         super.setUp();
 
+        numMessages = isBrokerStorePersistent() ? 300 : 1000;
+
         _logger.info("Create Connection");
         con = getConnection();
         _logger.info("Create Session");
@@ -106,19 +105,19 @@ public class AMQQueueDeferredOrderingTes
 
         // Setup initial messages
         _logger.info("Creating first producer thread");
-        producerThread = new ASyncProducer(queue, 0, NUM_MESSAGES / 2);
+        producerThread = new ASyncProducer(queue, 0, numMessages / 2);
         producerThread.start();
         // Wait for them to be done
         producerThread.join();
 
         // Setup second set of messages to produce while we consume
         _logger.info("Creating second producer thread");
-        producerThread = new ASyncProducer(queue, NUM_MESSAGES / 2, NUM_MESSAGES);
+        producerThread = new ASyncProducer(queue, numMessages / 2, numMessages);
         producerThread.start();
 
         // Start consuming and checking they're in order
         _logger.info("Consuming messages");
-        for (int i = 0; i < NUM_MESSAGES; i++)
+        for (int i = 0; i < numMessages; i++)
         {
             Message msg = consumer.receive(3000);
             assertNotNull("Message should not be null", msg);

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java Thu Oct 20 18:42:46 2011
@@ -36,7 +36,6 @@ import javax.jms.Session;
 import javax.naming.Context;
 import javax.naming.spi.InitialContextFactory;
 
-import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 import org.slf4j.Logger;

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/ResetMessageListenerTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/ResetMessageListenerTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/ResetMessageListenerTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/ResetMessageListenerTest.java Thu Oct 20 18:42:46 2011
@@ -135,7 +135,7 @@ public class ResetMessageListenerTest ex
         try
         {
             assertTrue("Did not receive all first batch of messages", 
-                    _allFirstMessagesSent.await(1000, TimeUnit.MILLISECONDS));
+                    _allFirstMessagesSent.await(MSG_COUNT, TimeUnit.SECONDS));
             _logger.info("Received first batch of messages");
         }
         catch (InterruptedException e)
@@ -212,7 +212,7 @@ public class ResetMessageListenerTest ex
 
         try
         {
-            assertTrue(_allSecondMessagesSent.await(1000, TimeUnit.MILLISECONDS));
+            assertTrue(_allSecondMessagesSent.await(MSG_COUNT, TimeUnit.SECONDS));
         }
         catch (InterruptedException e)
         {

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessageTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessageTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessageTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessageTest.java Thu Oct 20 18:42:46 2011
@@ -27,6 +27,7 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import javax.jms.Connection;
 import javax.jms.JMSException;
@@ -51,6 +52,7 @@ public class AMQPEncodedMapMessageTest e
     private Session _session;
     MessageConsumer _consumer;
     MessageProducer _producer;
+    UUID myUUID = UUID.randomUUID();
     
     public void setUp() throws Exception
     {
@@ -119,7 +121,8 @@ public class AMQPEncodedMapMessageTest e
         m.setFloat("Float", Integer.MAX_VALUE + 5000);
         m.setInt("Int", Integer.MAX_VALUE - 5000);
         m.setShort("Short", (short)58);
-        m.setString("String", "Hello");            
+        m.setString("String", "Hello"); 
+        m.setObject("uuid", myUUID);
         _producer.send(m);
         
         AMQPEncodedMapMessage msg = (AMQPEncodedMapMessage)_consumer.receive(RECEIVE_TIMEOUT);
@@ -140,6 +143,7 @@ public class AMQPEncodedMapMessageTest e
         assertEquals(Integer.MAX_VALUE - 5000,m.getInt("Int"));
         assertEquals((short)58,m.getShort("Short"));
         assertEquals("Hello",m.getString("String"));
+        assertEquals(myUUID,(UUID)m.getObject("uuid"));
     }
     
     
@@ -149,7 +153,11 @@ public class AMQPEncodedMapMessageTest e
         
         List<Integer> myList = getList();
         
-        m.setObject("List", myList);            
+        m.setObject("List", myList);   
+        
+        List<UUID> uuidList = new ArrayList<UUID>();
+        uuidList.add(myUUID);
+        m.setObject("uuid-list", uuidList);
         _producer.send(m);
         
         AMQPEncodedMapMessage msg = (AMQPEncodedMapMessage)_consumer.receive(RECEIVE_TIMEOUT);
@@ -167,6 +175,10 @@ public class AMQPEncodedMapMessageTest e
             assertEquals(i,j.intValue());
             i++;
         }
+        
+        List<UUID> list2 = (List<UUID>)msg.getObject("uuid-list");
+        assertNotNull("UUID List not received",list2);
+        assertEquals(myUUID,list2.get(0));        
     }
     
     public void testMessageWithMapEntries() throws JMSException
@@ -174,8 +186,12 @@ public class AMQPEncodedMapMessageTest e
         MapMessage m = _session.createMapMessage();
         
         Map<String,String> myMap = getMap();
+        m.setObject("Map", myMap);          
+        
+        Map<String,UUID> uuidMap = new HashMap<String,UUID>();
+        uuidMap.put("uuid", myUUID);
+        m.setObject("uuid-map", uuidMap);      
         
-        m.setObject("Map", myMap);            
         _producer.send(m);
         
         AMQPEncodedMapMessage msg = (AMQPEncodedMapMessage)_consumer.receive(RECEIVE_TIMEOUT);
@@ -191,6 +207,10 @@ public class AMQPEncodedMapMessageTest e
             assertEquals("String" + i,map.get("Key" + i));
             i++;
         }
+        
+        Map<String,UUID> map2 = (Map<String,UUID>)msg.getObject("uuid-map");
+        assertNotNull("Map not received",map2);
+        assertEquals(myUUID,map2.get("uuid"));   
     }
     
     public void testMessageWithNestedListsAndMaps() throws JMSException

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java Thu Oct 20 18:42:46 2011
@@ -31,62 +31,72 @@ import org.apache.qpid.test.utils.QpidBr
 import org.apache.qpid.transport.Connection;
 
 public class SSLTest extends QpidBrokerTestCase
-{      
-    
+{
+    private static final String KEYSTORE = "test-profiles/test_resources/ssl/java_client_keystore.jks";
+    private static final String KEYSTORE_PASSWORD = "password";
+    private static final String TRUSTSTORE = "test-profiles/test_resources/ssl/java_client_truststore.jks";
+    private static final String TRUSTSTORE_PASSWORD = "password";
+    private static final String CERT_ALIAS_APP1 = "app1";
+    private static final String CERT_ALIAS_APP2 = "app2";
+
     @Override
     protected void setUp() throws Exception
     {
-        System.setProperty("javax.net.debug", "ssl");
+        if(isJavaBroker())
+        {
+            setTestClientSystemProperty("profile.use_ssl", "true");
+            setConfigurationProperty("connector.ssl.enabled", "true");
+            setConfigurationProperty("connector.ssl.sslOnly", "true");
+        }
+
+        // set the ssl system properties
+        setSystemProperty("javax.net.ssl.keyStore", KEYSTORE);
+        setSystemProperty("javax.net.ssl.keyStorePassword", KEYSTORE_PASSWORD);
+        setSystemProperty("javax.net.ssl.trustStore", TRUSTSTORE);
+        setSystemProperty("javax.net.ssl.trustStorePassword", TRUSTSTORE_PASSWORD);
+        setSystemProperty("javax.net.debug", "ssl");
         super.setUp();
     }
 
-    @Override
-    protected void tearDown() throws Exception
-    {
-        System.setProperty("javax.net.debug", "");
-        super.tearDown();
-    }
-        
-    public void testCreateSSLContextFromConnectionURLParams()
+    public void testCreateSSLConnectionUsingConnectionURLParams() throws Exception
     {
         if (Boolean.getBoolean("profile.use_ssl"))
-        {   
+        {
+            // Clear the ssl system properties
+            setSystemProperty("javax.net.ssl.keyStore", null);
+            setSystemProperty("javax.net.ssl.keyStorePassword", null);
+            setSystemProperty("javax.net.ssl.trustStore", null);
+            setSystemProperty("javax.net.ssl.trustStorePassword", null);
+            
             String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:%s" +
             "?ssl='true'&ssl_verify_hostname='true'" + 
             "&key_store='%s'&key_store_password='%s'" +
             "&trust_store='%s'&trust_store_password='%s'" +
             "'";
             
-            String keyStore = System.getProperty("javax.net.ssl.keyStore");
-            String keyStorePass = System.getProperty("javax.net.ssl.keyStorePassword");
-            String trustStore = System.getProperty("javax.net.ssl.trustStore");
-            String trustStorePass = System.getProperty("javax.net.ssl.trustStorePassword");
-            
-            url = String.format(url,System.getProperty("test.port.ssl"),
-                    keyStore,keyStorePass,trustStore,trustStorePass);
-            
-            // temporarily set the trust/key store jvm args to something else
-            // to ensure we only read from the connection URL param.
-            System.setProperty("javax.net.ssl.trustStore","fessgsdgd");
-            System.setProperty("javax.net.ssl.trustStorePassword","fessgsdgd");
-            System.setProperty("javax.net.ssl.keyStore","fessgsdgd");
-            System.setProperty("javax.net.ssl.keyStorePassword","fessgsdgd");
-            try
-            {
-                AMQConnection con = new AMQConnection(url);
-                Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); 
-            }
-            catch (Exception e)
-            {
-                fail("SSL Connection should be successful");
-            }
-            finally
-            {
-                System.setProperty("javax.net.ssl.trustStore",trustStore);
-                System.setProperty("javax.net.ssl.trustStorePassword",trustStorePass);
-                System.setProperty("javax.net.ssl.keyStore",keyStore);
-                System.setProperty("javax.net.ssl.keyStorePassword",keyStorePass);
-            }
+            url = String.format(url,QpidBrokerTestCase.DEFAULT_SSL_PORT,
+                    KEYSTORE,KEYSTORE_PASSWORD,TRUSTSTORE,TRUSTSTORE_PASSWORD);
+            
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should be successful", con);
+            Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); 
+            assertNotNull("create session should be successful", ssn);
+        }        
+    }
+
+    public void testCreateSSLConnectionUsingSystemProperties() throws Exception
+    {
+        if (Boolean.getBoolean("profile.use_ssl"))
+        {
+
+            String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:%s?ssl='true''";
+
+            url = String.format(url,QpidBrokerTestCase.DEFAULT_SSL_PORT);
+            
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should be successful", con);
+            Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); 
+            assertNotNull("create session should be successful", ssn);
         }        
     }
 
@@ -95,8 +105,8 @@ public class SSLTest extends QpidBrokerT
         if (Boolean.getBoolean("profile.use_ssl"))
         {
             String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:" + 
-            System.getProperty("test.port.ssl") + 
-            "?ssl='true'&ssl_cert_alias='app1''";
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
+            "?ssl='true'&ssl_cert_alias='" + CERT_ALIAS_APP1 + "''";
             
             AMQTestConnection_0_10 con = new AMQTestConnection_0_10(url);      
             Connection transportCon = con.getConnection();
@@ -105,8 +115,8 @@ public class SSLTest extends QpidBrokerT
             con.close();
             
             url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:" + 
-            System.getProperty("test.port.ssl") + 
-            "?ssl='true'&ssl_cert_alias='app2''";
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
+            "?ssl='true'&ssl_cert_alias='" + CERT_ALIAS_APP2 + "''";
             
             con = new AMQTestConnection_0_10(url);      
             transportCon = con.getConnection();
@@ -116,12 +126,12 @@ public class SSLTest extends QpidBrokerT
         }        
     }
     
-    public void testVerifyHostName()
+    public void testVerifyHostNameWithIncorrectHostname()
     {
         if (Boolean.getBoolean("profile.use_ssl"))
         {
             String url = "amqp://guest:guest@test/?brokerlist='tcp://127.0.0.1:" + 
-            System.getProperty("test.port.ssl") + 
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
             "?ssl='true'&ssl_verify_hostname='true''";
             
             try
@@ -140,42 +150,53 @@ public class SSLTest extends QpidBrokerT
         }        
     }
     
-    public void testVerifyLocalHost()
+    public void testVerifyLocalHost() throws Exception
     {
         if (Boolean.getBoolean("profile.use_ssl"))
         {
             String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:" + 
-            System.getProperty("test.port.ssl") + 
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
             "?ssl='true'&ssl_verify_hostname='true''";
-            
-            try
-            {
-                AMQConnection con = new AMQConnection(url);
-            }
-            catch (Exception e)
-            {
-                fail("Hostname verification should succeed");
-            }            
-        }        
+
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should have been created", con); 
+        }
     }
     
-    public void testVerifyLocalHostLocalDomain()
+    public void testVerifyLocalHostLocalDomain() throws Exception
     {
         if (Boolean.getBoolean("profile.use_ssl"))
         {
             String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost.localdomain:" + 
-            System.getProperty("test.port.ssl") + 
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
             "?ssl='true'&ssl_verify_hostname='true''";
+
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should have been created", con);
+        }        
+    }
+
+    public void testCreateSSLConnectionUsingConnectionURLParamsTrustStoreOnly() throws Exception
+    {
+        if (Boolean.getBoolean("profile.use_ssl"))
+        {
+            // Clear the ssl system properties
+            setSystemProperty("javax.net.ssl.keyStore", null);
+            setSystemProperty("javax.net.ssl.keyStorePassword", null);
+            setSystemProperty("javax.net.ssl.trustStore", null);
+            setSystemProperty("javax.net.ssl.trustStorePassword", null);
             
-            try
-            {
-                AMQConnection con = new AMQConnection(url);
-            }
-            catch (Exception e)
-            {
-                fail("Hostname verification should succeed");
-            }
-            
+            String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:%s" +
+            "?ssl='true'&ssl_verify_hostname='true'" + 
+            "&trust_store='%s'&trust_store_password='%s'" +
+            "'";
+
+            url = String.format(url,QpidBrokerTestCase.DEFAULT_SSL_PORT, TRUSTSTORE,TRUSTSTORE_PASSWORD);
+
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should be successful", con);
+            Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); 
+            assertNotNull("create session should be successful", ssn);
         }        
     }
 }

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -68,61 +68,6 @@ public class ManagementActorLoggingTest 
 
     /**
      * Description:
-     * When a JMX Management connection is made then this will be logged out.
-     *
-     * Input:
-     *
-     * 1. Running Broker
-     * 2. Connect Management client via JMX
-     * Output:
-     *
-     * <date> MNG-1007 : Open <user>
-     *
-     * Validation Steps:
-     * 1. The MNG ID is correct
-     * 2. The user is correct
-     *
-     * On connection close a MNG-1008 is expected
-     *
-     * * <date> MNG-1008 : Close
-     *
-     * Validation Steps:
-     * 1. The MNG ID is correct
-     *
-     * @throws java.io.IOException - if there is a problem reseting the log monitor
-     */
-    public void testJMXManagementConsoleConnection() throws IOException
-    {
-        List<String> results = waitAndFindMatches("MNG-1007");
-
-        assertEquals("Unexpected Management Connection count", 1, results.size());
-
-        String log = getLogMessage(results, 0);
-
-        validateMessageID("MNG-1007", log);
-
-        assertTrue("User not in log message:" + log, log.endsWith(USER));
-        // Extract the id from the log string
-        //  MESSAGE [mng:1(rmi://169.24.29.116)] MNG-1007 : Open : User admin
-        int connectionID = Integer.parseInt(fromActor(getLog(results.get(0))).charAt(4) + "");
-
-        results = findMatches("MNG-1008");
-
-        assertEquals("Unexpected Management Connection close count", 0, results.size());
-
-        _jmxUtils.close();
-        _closed  = true;
-        
-        results = waitAndFindMatches("MNG-1008");
-
-        assertEquals("Unexpected Management Connection count", 1, results.size());
-
-        assertEquals("Close does not have same id as open,", connectionID,
-                     Integer.parseInt(fromActor(getLog(results.get(0))).charAt(4) + ""));
-    }
-
-    /**
-     * Description:
      * When a connected client has its connection closed via the Management Console this will be logged as a CON-1002 message.
      * Input:
      *
@@ -161,7 +106,7 @@ public class ManagementActorLoggingTest 
         });
 
         //Remove the connection close from any 0-10 connections
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         // Get a managedConnection
         ManagedConnection mangedConnection = _jmxUtils.getManagedObject(ManagedConnection.class, "org.apache.qpid:type=VirtualHost.Connection,*");
@@ -202,7 +147,7 @@ public class ManagementActorLoggingTest 
      */
     public void testCreateExchangeDirectTransientViaManagementConsole() throws IOException, JMException
     {
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createExchange("test", getName(), "direct", false);
 
@@ -226,7 +171,7 @@ public class ManagementActorLoggingTest 
     public void testCreateExchangeTopicTransientViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous exchange declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createExchange("test", getName(), "topic", false);
 
@@ -251,7 +196,7 @@ public class ManagementActorLoggingTest 
     public void testCreateExchangeFanoutTransientViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous exchange declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createExchange("test", getName(), "fanout", false);
 
@@ -276,7 +221,7 @@ public class ManagementActorLoggingTest 
     public void testCreateExchangeHeadersTransientViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous exchange declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createExchange("test", getName(), "headers", false);
 
@@ -320,7 +265,7 @@ public class ManagementActorLoggingTest 
     public void testCreateQueueTransientViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous queue declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createQueue("test", getName(), null, false);
 
@@ -363,7 +308,7 @@ public class ManagementActorLoggingTest 
     public void testQueueDeleteViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous queue declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createQueue("test", getName(), null, false);
 
@@ -409,7 +354,7 @@ public class ManagementActorLoggingTest 
     public void testBindingCreateOnDirectViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous queue declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createQueue("test", getName(), null, false);
 
@@ -436,7 +381,7 @@ public class ManagementActorLoggingTest 
     public void testBindingCreateOnTopicViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous queue declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createQueue("test", getName(), null, false);
 
@@ -463,7 +408,7 @@ public class ManagementActorLoggingTest 
     public void testBindingCreateOnFanoutViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous queue declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createQueue("test", getName(), null, false);
 
@@ -510,7 +455,7 @@ public class ManagementActorLoggingTest 
     public void testUnRegisterExchangeViaManagementConsole() throws IOException, JMException
     {
         //Remove any previous queue declares
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _jmxUtils.createExchange("test", getName(), "direct", false);
 

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java Thu Oct 20 18:42:46 2011
@@ -70,13 +70,13 @@ public class BrokerStartupTest extends A
     {
         // This logging startup code only occurs when you run a Java broker,
         // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker() && isExternalBroker() && !isInternalBroker())
         {
             //Remove test Log4j config from the commandline
-            _broker = _broker.substring(0, _broker.indexOf("-l"));
+            _brokerCommand = _brokerCommand.substring(0, _brokerCommand.indexOf("-l"));
 
             // Add an invalid value
-            _broker += " -l invalid";
+            _brokerCommand += " -l invalid";
 
             // The  broker has a built in default log4j configuration set up
             // so if the the broker cannot load the -l value it will use default

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java Thu Oct 20 18:42:46 2011
@@ -61,21 +61,6 @@ public class ServerConfigurationFileTest
                       _serverConfig.getConfig().getProperty(property));
     }
 
-    public void testProtectIOEnabled() throws ConfigurationException
-    {
-        validatePropertyDefinedInFile(ServerConfiguration.CONNECTOR_PROTECTIO_ENABLED);
-    }
-
-    public void testProtectIOReadBufferLimitSize() throws ConfigurationException
-    {
-        validatePropertyDefinedInFile(ServerConfiguration.CONNECTOR_PROTECTIO_READ_BUFFER_LIMIT_SIZE);
-    }
-
-    public void testProtectIOWriteBufferLimitSize() throws ConfigurationException
-    {
-        validatePropertyDefinedInFile(ServerConfiguration.CONNECTOR_PROTECTIO_WRITE_BUFFER_LIMIT_SIZE);
-    }
-
     public void testStatusUpdates() throws ConfigurationException
     {
         validatePropertyDefinedInFile(ServerConfiguration.STATUS_UPDATES);

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/exchange/MessagingTestConfigProperties.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/exchange/MessagingTestConfigProperties.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/exchange/MessagingTestConfigProperties.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/exchange/MessagingTestConfigProperties.java Thu Oct 20 18:42:46 2011
@@ -83,15 +83,9 @@ public class MessagingTestConfigProperti
     /** Holds the name of the default connection factory configuration property. */
     public static final String CONNECTION_PROPNAME = "connectionfactory.broker";
 
-    /** Defeins the default connection configuration. */
-    public static final String CONNECTION_DEFAULT = "amqp://guest:guest@clientid/?brokerlist='vm://:1'";
-
     /** Holds the name of the property to get the test broker url from. */
     public static final String BROKER_PROPNAME = "qpid.test.broker";
 
-    /** Holds the default broker url for the test. */
-    public static final String BROKER_DEFAULT = "vm://:1";
-
     /** Holds the name of the property to get the test broker virtual path. */
     public static final String VIRTUAL_HOST_PROPNAME = "virtualHost";
 
@@ -274,7 +268,6 @@ public class MessagingTestConfigProperti
     static
     {
         defaults.setPropertyIfNull(INITIAL_CONTEXT_FACTORY_PROPNAME, INITIAL_CONTEXT_FACTORY_DEFAULT);
-        defaults.setPropertyIfNull(CONNECTION_PROPNAME, CONNECTION_DEFAULT);
         defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT);
         defaults.setPropertyIfNull(PUBLISHER_PRODUCER_BIND_PROPNAME, PUBLISHER_PRODUCER_BIND_DEFAULT);
         defaults.setPropertyIfNull(PUBLISHER_CONSUMER_BIND_PROPNAME, PUBLISHER_CONSUMER_BIND_DEFAULT);
@@ -284,7 +277,6 @@ public class MessagingTestConfigProperti
         defaults.setPropertyIfNull(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME, RECEIVE_DESTINATION_NAME_ROOT_DEFAULT);
         defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT);
         defaults.setPropertyIfNull(TRANSACTED_PROPNAME, TRANSACTED_DEFAULT);
-        defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT);
         defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT);
         defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT);
         defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT);

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java Thu Oct 20 18:42:46 2011
@@ -20,58 +20,40 @@
  */
 package org.apache.qpid.server.failover;
 
-import junit.framework.TestCase;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
 
+import org.apache.qpid.AMQConnectionClosedException;
 import org.apache.qpid.AMQDisconnectedException;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.util.InternalBrokerBaseCase;
-import org.apache.qpid.url.URLSyntaxException;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import java.util.concurrent.CountDownLatch;
-
-public class FailoverMethodTest extends InternalBrokerBaseCase implements ExceptionListener
+public class FailoverMethodTest extends QpidBrokerTestCase implements ExceptionListener
 {
     private CountDownLatch _failoverComplete = new CountDownLatch(1);
     protected static final Logger _logger = LoggerFactory.getLogger(FailoverMethodTest.class);
 
-    @Override
-    public void createBroker() throws Exception
-    {
-        super.createBroker();
-        TransportConnection.createVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
-    }
 
-    @Override
-    public void stopBroker()
-    {
-        TransportConnection.killVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
-        super.stopBroker();
-    }
 
     /**
      * Test that the round robin method has the correct delays.
-     * The first connection to vm://:1 will work but the localhost connection should fail but the duration it takes
+     * The first connection will work but the localhost connection should fail but the duration it takes
      * to report the failure is what is being tested.
      *
-     * @throws URLSyntaxException
-     * @throws InterruptedException
-     * @throws JMSException
      */
-    public void testFailoverRoundRobinDelay() throws URLSyntaxException, InterruptedException, JMSException
+    public void testFailoverRoundRobinDelay() throws Exception
     {
-        //note: The VM broker has no connect delay and the default 1 retry
+        //note: The first broker has no connect delay and the default 1 retry
         //        while the tcp:localhost broker has 3 retries with a 2s connect delay
         String connectionString = "amqp://guest:guest@/test?brokerlist=" +
-                                  "'vm://:" + ApplicationRegistry.DEFAULT_INSTANCE +
+                                  "'tcp://:" + getPort() +
                                   ";tcp://localhost:5670?connectdelay='2000',retries='3''";
 
         AMQConnectionURL url = new AMQConnectionURL(connectionString);
@@ -79,13 +61,15 @@ public class FailoverMethodTest extends 
         try
         {
             long start = System.currentTimeMillis();
-            AMQConnection connection = new AMQConnection(url, null);
+            AMQConnection connection = new AMQConnection(url);
 
             connection.setExceptionListener(this);
 
             stopBroker();
 
-            _failoverComplete.await();
+            _failoverComplete.await(30, TimeUnit.SECONDS);
+            assertEquals("failoverLatch was not decremented in given timeframe",
+                    0, _failoverComplete.getCount());
 
             long end = System.currentTimeMillis();
 
@@ -112,23 +96,24 @@ public class FailoverMethodTest extends 
         }
     }
 
-    public void testFailoverSingleDelay() throws URLSyntaxException, AMQVMBrokerCreationException,
-                                                 InterruptedException, JMSException
+    public void testFailoverSingleDelay() throws Exception
     {
-        String connectionString = "amqp://guest:guest@/test?brokerlist='vm://:1?connectdelay='2000',retries='3''";
+        String connectionString = "amqp://guest:guest@/test?brokerlist='tcp://localhost:" + getPort() + "?connectdelay='2000',retries='3''";
 
         AMQConnectionURL url = new AMQConnectionURL(connectionString);
 
         try
         {
             long start = System.currentTimeMillis();
-            AMQConnection connection = new AMQConnection(url, null);
+            AMQConnection connection = new AMQConnection(url);
 
             connection.setExceptionListener(this);
 
             stopBroker();
 
-            _failoverComplete.await();
+            _failoverComplete.await(30, TimeUnit.SECONDS);
+            assertEquals("failoverLatch was not decremented in given timeframe",
+                    0, _failoverComplete.getCount());
 
             long end = System.currentTimeMillis();
 
@@ -144,8 +129,8 @@ public class FailoverMethodTest extends 
             assertTrue("Failover took less than 6 seconds", duration > 6000);
 
             // Ensure we don't have delays before initial connection and reconnection.
-            // We allow 1 second for initial connection and failover logic on top of 6s of sleep.
-            assertTrue("Failover took more than 7 seconds:(" + duration + ")", duration < 7000);
+            // We allow 3 second for initial connection and failover logic on top of 6s of sleep.
+            assertTrue("Failover took more than 9 seconds:(" + duration + ")", duration < 9000);
         }
         catch (AMQException e)
         {
@@ -155,11 +140,15 @@ public class FailoverMethodTest extends 
 
     public void onException(JMSException e)
     {
-        if (e.getLinkedException() instanceof AMQDisconnectedException)
+        if (e.getLinkedException() instanceof AMQDisconnectedException || e.getLinkedException() instanceof AMQConnectionClosedException)
         {
             _logger.debug("Received AMQDisconnectedException");
             _failoverComplete.countDown();
         }
+        else
+        {
+            _logger.error("Unexpected underlying exception", e.getLinkedException());
+        }
     }
 
     /**
@@ -168,28 +157,37 @@ public class FailoverMethodTest extends 
      *
      * Test validates that there is a connection delay as required on initial
      * connection.
-     *
-     * @throws URLSyntaxException
-     * @throws AMQVMBrokerCreationException
-     * @throws InterruptedException
-     * @throws JMSException
      */
-    public void testNoFailover() throws URLSyntaxException, AMQVMBrokerCreationException,
-                                        InterruptedException, JMSException
+    public void testNoFailover() throws Exception
     {
+        if (!isInternalBroker())
+        {
+            // QPID-3359
+            // These tests always used to be inVM tests, then QPID-2815, with removal of ivVM, 
+            // converted the test to use QpidBrokerTestCase.  However, since then we notice this
+            // test fails on slower CI boxes.  It turns out the test design is *extremely*
+            // sensitive the length of time the broker takes to start up.
+            //
+            // Making the test a same-VM test to temporarily avoid the issue.  In long term, test
+            // needs redesigned to avoid the issue.
+            return;
+        }
+
         int CONNECT_DELAY = 2000;
-        String connectionString = "amqp://guest:guest@/test?brokerlist='vm://:1?connectdelay='" + CONNECT_DELAY + "'," +
+        String connectionString = "amqp://guest:guest@/test?brokerlist='tcp://localhost:" + getPort() + "?connectdelay='" + CONNECT_DELAY + "'," +
                                   "retries='3'',failover='nofailover'";
 
+        
         AMQConnectionURL url = new AMQConnectionURL(connectionString);
 
+        Thread brokerStart = null;
         try
         {
             //Kill initial broker
             stopBroker();
 
             //Create a thread to start the broker asynchronously
-            Thread brokerStart = new Thread(new Runnable()
+            brokerStart = new Thread(new Runnable()
             {
                 public void run()
                 {
@@ -198,7 +196,7 @@ public class FailoverMethodTest extends 
                         //Wait before starting broker
                         // The wait should allow atleast 1 retries to fail before broker is ready
                         Thread.sleep(750);
-                        createBroker();
+                        startBroker();
                     }
                     catch (Exception e)
                     {
@@ -212,9 +210,8 @@ public class FailoverMethodTest extends 
             brokerStart.start();
             long start = System.currentTimeMillis();
 
-
             //Start the connection so it will use the retries
-            AMQConnection connection = new AMQConnection(url, null);
+            AMQConnection connection = new AMQConnection(url);
 
             long end = System.currentTimeMillis();
 
@@ -228,13 +225,16 @@ public class FailoverMethodTest extends 
 
             //Ensure we collect the brokerStart thread
             brokerStart.join();
+            brokerStart = null;
 
             start = System.currentTimeMillis();
 
             //Kill connection
             stopBroker();
 
-            _failoverComplete.await();
+            _failoverComplete.await(30, TimeUnit.SECONDS);
+            assertEquals("failoverLatch was not decremented in given timeframe",
+                    0, _failoverComplete.getCount());
 
             end = System.currentTimeMillis();
 
@@ -249,6 +249,23 @@ public class FailoverMethodTest extends 
         {
             fail(e.getMessage());
         }
+        finally
+        {
+            // Guard against the case where the broker took too long to start
+            // and the initial connection failed to be formed.
+            if (brokerStart != null)
+            {
+                brokerStart.join();
+            }
+        }
+    }
+
+    public void stopBroker(int port) throws Exception
+    {
+        if (isBrokerPresent(port))
+        {
+            super.stopBroker(port);
+        }
     }
 
 }

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/failover/MessageDisappearWithIOExceptionTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/failover/MessageDisappearWithIOExceptionTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/failover/MessageDisappearWithIOExceptionTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/failover/MessageDisappearWithIOExceptionTest.java Thu Oct 20 18:42:46 2011
@@ -20,13 +20,10 @@
  */
 package org.apache.qpid.server.failover;
 
-import org.apache.mina.common.WriteTimeoutException;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.protocol.AMQProtocolSession;
 import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
 import org.apache.qpid.test.utils.FailoverBaseCase;
-import org.apache.qpid.AMQConnectionClosedException;
 
 import javax.jms.Destination;
 import javax.jms.Message;
@@ -34,6 +31,7 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
@@ -195,7 +193,7 @@ public class MessageDisappearWithIOExcep
 
         // Send IO Exception - causing failover
         _connection.getProtocolHandler().
-                exception(new WriteTimeoutException("WriteTimeoutException to cause failover."));
+                exception(new IOException("IOException to cause failover."));
 
         // Verify Failover occured through ConnectionListener
         assertTrue("Failover did not occur",

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java Thu Oct 20 18:42:46 2011
@@ -349,7 +349,7 @@ public class AbstractTestLogging extends
 
     public boolean waitForMessage(String message, long wait) throws FileNotFoundException, IOException
     {
-        return _monitor.waitForMessage(message, wait, true);
+        return _monitor.waitForMessage(message, wait);
     }
 
     /**

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Thu Oct 20 18:42:46 2011
@@ -46,7 +46,7 @@ public class AlertingTest extends Abstra
     {
         // Update the configuration to make our virtualhost Persistent.
         makeVirtualHostPersistent(VIRTUALHOST);
-        setConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".housekeeping.expiredMessageCheckPeriod", "5000");
+        setConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".housekeeping.checkPeriod", "5000");
 
         _numMessages = 50;
 
@@ -136,7 +136,7 @@ public class AlertingTest extends Abstra
         stopBroker();
 
         // Rest the monitoring clearing the current output file.
-        _monitor.reset();
+        _monitor.markDiscardPoint();
         startBroker();
         wasAlertFired();
     }
@@ -169,14 +169,14 @@ public class AlertingTest extends Abstra
 
         stopBroker();
 
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         // Change max message count to 5, start broker and make sure that that's triggered at the right time
         setConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount", "5");
 
         startBroker();
 
-        if (!isExternalBroker())
+        if (isInternalBroker())
         {
             assertEquals("Alert Max Msg Count is not correct", 5, ApplicationRegistry.getInstance().getVirtualHostRegistry().
                     getVirtualHost(VIRTUALHOST).getQueueRegistry().getQueue(new AMQShortString(_destination.getQueueName())).

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -55,7 +55,7 @@ public class BindingLoggingTest extends 
     {
         super.setUp();
         //Ignore broker startup messages
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _connection = getConnection();
 

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -21,6 +21,8 @@
 package org.apache.qpid.server.logging;
 
 import junit.framework.AssertionFailedError;
+
+import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.Main;
 import org.apache.qpid.transport.ConnectionException;
 import org.apache.qpid.util.LogMonitor;
@@ -151,12 +153,12 @@ public class BrokerLoggingTest extends A
     {
         // This logging startup code only occurs when you run a Java broker,
         // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker() && isExternalBroker() && !isInternalBroker())
         {
             String TESTID = "BRK-1007";
 
             //Remove test Log4j config from the commandline
-            _broker = _broker.substring(0, _broker.indexOf("-l"));
+            _brokerCommand = _brokerCommand.substring(0, _brokerCommand.indexOf("-l"));
 
             startBroker();
 
@@ -203,7 +205,7 @@ public class BrokerLoggingTest extends A
                                  1, findMatches(TESTID).size());
 
                     //3
-                    String defaultLog4j = _configFile.getParent() + "/" + Main.DEFAULT_LOG_CONFIG_FILENAME;
+                    String defaultLog4j = System.getProperty(QPID_HOME) + "/" + BrokerOptions.DEFAULT_LOG_CONFIG_FILE;
                     assertTrue("Log4j file(" + defaultLog4j + ") details not correctly logged:" + getMessageString(log),
                                getMessageString(log).endsWith(defaultLog4j));
 
@@ -240,12 +242,11 @@ public class BrokerLoggingTest extends A
      */
     public void testBrokerStartupCustomLog4j() throws Exception
     {
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
+        // This logging startup code only occurs when you run a Java broker
         if (isJavaBroker() && isExternalBroker())
         {
             // Get custom -l value used during testing for the broker startup
-            String customLog4j = _broker.substring(_broker.indexOf("-l") + 2);
+            String customLog4j = _brokerCommand.substring(_brokerCommand.indexOf("-l") + 2).trim();
 
             String TESTID = "BRK-1007";
 
@@ -518,7 +519,7 @@ public class BrokerLoggingTest extends A
             setConfigurationProperty("connector.ssl.keyStorePath", getConfigurationStringProperty("management.ssl.keyStorePath"));
             setConfigurationProperty("connector.ssl.keyStorePassword", getConfigurationStringProperty("management.ssl.keyStorePassword"));
 
-            Integer sslPort = Integer.parseInt(getConfigurationStringProperty("connector.sslport"));
+            Integer sslPort = Integer.parseInt(getConfigurationStringProperty("connector.ssl.port"));
 
             startBroker();
 

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -77,7 +77,7 @@ public class ChannelLoggingTest extends 
         validateMessageID("CHN-1001", log);
         assertEquals("Incorrect Channel in actor:"+fromActor(log), isBroker010()? 0 : 1, getChannelID(fromActor(log)));
 
-        if (isBroker08())
+        if (!isBroker010())
         {
             // Wait to ensure that the CHN-1004 message is logged
             waitForMessage("CHN-1004");
@@ -89,7 +89,7 @@ public class ChannelLoggingTest extends 
             log = getLogMessage(results, 0);
             //  MESSAGE [con:0(guest@anonymous(3273383)/test)/ch:1] CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}
             validateMessageID("CHN-1004", log);
-            assertEquals("Incorrect Channel in actor:"+fromActor(log), isBroker010()? 0 : 1, getChannelID(fromActor(log)));
+            assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log)));
             assertTrue("Prefetch Count not correct",getMessageString(fromMessage(log)).endsWith("Count "+PREFETCH));
         }
 

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -496,7 +496,7 @@ public class DerbyMessageStoreLoggingTes
             stopBroker();
 
             // Clear our monitor
-            _monitor.reset();
+            _monitor.markDiscardPoint();
 
             startBroker();
 

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/DurableQueueLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/DurableQueueLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/DurableQueueLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/DurableQueueLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -58,7 +58,7 @@ public class DurableQueueLoggingTest ext
     {
         super.setUp();
         //Ensure we only have logs from our test
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _connection = getConnection();
         _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -20,6 +20,16 @@
  */
 package org.apache.qpid.server.logging;
 
+import java.io.IOException;
+import java.util.List;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQSession_0_10;
 import org.apache.qpid.framing.AMQFrame;
@@ -28,13 +38,6 @@ import org.apache.qpid.framing.ExchangeD
 import org.apache.qpid.framing.ExchangeDeleteOkBody;
 import org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0;
 
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.Session;
-import java.io.IOException;
-import java.util.List;
-
 /**
  * Exchange
  *
@@ -122,7 +125,7 @@ public class ExchangeLoggingTest extends
     public void testExchangeCreate() throws JMSException, IOException
     {
         //Ignore broker startup messages
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _session.createConsumer(_queue);
         // Ensure we have received the EXH log msg.
@@ -176,7 +179,7 @@ public class ExchangeLoggingTest extends
     public void testExchangeDelete() throws Exception, IOException
     {
         //Ignore broker startup messages
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         //create the exchange by creating a consumer
         _session.createConsumer(_queue);
@@ -214,4 +217,38 @@ public class ExchangeLoggingTest extends
 
     }
 
+    public void testDiscardedMessage() throws Exception
+    {
+        //Ignore broker startup messages
+        _monitor.markDiscardPoint();
+
+        if (!isBroker010())
+        {
+            // Default 0-8..-0-9-1 behaviour is for messages to be rejected (returned to client).
+            setTestClientSystemProperty("qpid.default_mandatory", "false");
+        }
+
+        _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+        // Do not create consumer so queue is not created and message will be discarded.
+        final MessageProducer producer = _session.createProducer(_queue);
+
+        // Sending message
+        final TextMessage msg = _session.createTextMessage("msg");
+        producer.send(msg);
+
+        final String expectedMessageBody = "Discarded Message : Name: " + _name + " Routing Key: " + _queue.getQueueName();
+
+        // Ensure we have received the EXH log msg.
+        waitForMessage("EXH-1003");
+
+        List<String> results = findMatches(EXH_PREFIX);
+        assertEquals("Result set larger than expected.", 2, results.size());
+
+        final String log = getLogMessage(results, 1);
+        validateMessageID("EXH-1003", log);
+
+        final String message = getMessageString(fromMessage(log));
+        assertEquals("Log Message not as expected", expectedMessageBody, message);
+    }
 }

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -22,6 +22,7 @@ package org.apache.qpid.server.logging;
 
 import junit.framework.AssertionFailedError;
 
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.util.LogMonitor;
 
 import java.util.List;
@@ -76,9 +77,8 @@ public class ManagementLoggingTest exten
      */
     public void testManagementStartupEnabled() throws Exception
     {
-        // This test only works on external java brokers due to the fact that
-        // Management is disabled on InVM brokers.
-        if (isJavaBroker() && isExternalBroker())
+        // This test only works on java brokers
+        if (isJavaBroker())
         {
             startBrokerAndCreateMonitor(true, false);
 
@@ -130,9 +130,7 @@ public class ManagementLoggingTest exten
      */
     public void testManagementStartupDisabled() throws Exception
     {
-        // This test only works on external java brokers due to the fact that
-        // Management is disabled on InVM brokers.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             startBrokerAndCreateMonitor(false, false);
 
@@ -191,9 +189,7 @@ public class ManagementLoggingTest exten
      */
     public void testManagementStartupRMIEntries() throws Exception
     {
-        // This test only works on external java brokers due to the fact that
-        // Management is disabled on InVM brokers.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             startBrokerAndCreateMonitor(true, false);
             
@@ -211,7 +207,7 @@ public class ManagementLoggingTest exten
                 validateMessageID("MNG-1002", log);
 
                 //Check the RMI Registry port is as expected
-                int mPort = getPort() + (DEFAULT_MANAGEMENT_PORT - DEFAULT_PORT);
+                int mPort = getManagementPort(getPort());
                 assertTrue("RMI Registry port not as expected(" + mPort + ").:" + getMessageString(log),
                            getMessageString(log).endsWith(String.valueOf(mPort)));
 
@@ -222,7 +218,7 @@ public class ManagementLoggingTest exten
 
                 // We expect the RMI Registry port (the defined 'management port') to be
                 // 100 lower than the JMX RMIConnector Server Port (the actual JMX server)
-                int jmxPort = mPort + 100;
+                int jmxPort = mPort + ServerConfiguration.JMXPORT_CONNECTORSERVER_OFFSET;
                 assertTrue("JMX RMIConnectorServer port not as expected(" + jmxPort + ").:" + getMessageString(log),
                            getMessageString(log).endsWith(String.valueOf(jmxPort)));
             }
@@ -250,9 +246,7 @@ public class ManagementLoggingTest exten
      */
     public void testManagementStartupSSLKeystore() throws Exception
     {
-        // This test only works on external java brokers due to the fact that
-        // Management is disabled on InVM brokers.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             startBrokerAndCreateMonitor(true, true);
 

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -53,7 +53,7 @@ public class QueueLoggingTest extends Ab
     {
         super.setUp();
         //Remove broker startup logging messages
-        _monitor.reset();
+        _monitor.markDiscardPoint();
         
         _connection = getConnection();
         _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java Thu Oct 20 18:42:46 2011
@@ -58,7 +58,7 @@ public class SubscriptionLoggingTest ext
     {
         super.setUp();
         //Remove broker startup logging messages
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         _connection = getConnection();
 

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/persistent/NoLocalAfterRecoveryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/persistent/NoLocalAfterRecoveryTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/persistent/NoLocalAfterRecoveryTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/persistent/NoLocalAfterRecoveryTest.java Thu Oct 20 18:42:46 2011
@@ -78,21 +78,10 @@ public class NoLocalAfterRecoveryTest ex
 
         BrokerDetails details = _connectionURL.getBrokerDetails(0);
 
-        // Due to the problem with SingleServer delaying on all connection
-        // attempts. So using a high retry value.
-        if (_broker.equals(VM))
-        {
-            // Local testing suggests InVM restart takes under a second
-            details.setProperty(BrokerDetails.OPTIONS_RETRY, "5");
-            details.setProperty(BrokerDetails.OPTIONS_CONNECT_DELAY, "200");
-        }
-        else
-        {
-            // This will attempt to failover for 3 seconds.
-            // Local testing suggests failover takes 2 seconds
-            details.setProperty(BrokerDetails.OPTIONS_RETRY, "10");
-            details.setProperty(BrokerDetails.OPTIONS_CONNECT_DELAY, "500");
-        }
+        // This will attempt to failover for 3 seconds.
+        // Local testing suggests failover takes 2 seconds
+        details.setProperty(BrokerDetails.OPTIONS_RETRY, "10");
+        details.setProperty(BrokerDetails.OPTIONS_CONNECT_DELAY, "500");
 
         super.setUp();        
     }

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java Thu Oct 20 18:42:46 2011
@@ -23,7 +23,6 @@ package org.apache.qpid.server.queue;
 import junit.framework.TestCase;
 import junit.framework.Assert;
 import org.apache.log4j.Logger;
-import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.client.AMQQueue;

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java Thu Oct 20 18:42:46 2011
@@ -64,7 +64,7 @@ public class ProducerFlowControlTest ext
         _jmxUtilConnected=false;
         super.setUp();
 
-        _monitor.reset();
+        _monitor.markDiscardPoint();
 
         producerConnection = getConnection();
         producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java Thu Oct 20 18:42:46 2011
@@ -110,18 +110,13 @@ public class QueueDepthWithSelectorTest 
         try
         {
             Connection connection = getConnection();
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            AMQSession session = (AMQSession)connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-            Thread.sleep(2000);
-            long queueDepth = ((AMQSession) session).getQueueDepth((AMQDestination) _queue);
+            long queueDepth = session.getQueueDepth((AMQDestination) _queue);
             assertEquals("Session reports Queue depth not as expected", expectedDepth, queueDepth);
             
             connection.close();
         }
-        catch (InterruptedException e)
-        {
-            fail(e.getMessage());
-        }
         catch (AMQException e)
         {
             fail(e.getMessage());
@@ -158,6 +153,10 @@ public class QueueDepthWithSelectorTest 
         {
             assertTrue("Message " + msgId + " not received.", msgIdRecevied[msgId]);
         }
+
+        //do a synchronous op to ensure the acks are processed
+        //on the broker before proceeding
+        ((AMQSession)_clientSession).sync();
     }
 
     /**

Modified: qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java?rev=1186990&r1=1186989&r2=1186990&view=diff
==============================================================================
--- qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java (original)
+++ qpid/branches/QPID-2519/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java Thu Oct 20 18:42:46 2011
@@ -52,7 +52,6 @@ import org.apache.qpid.url.URLSyntaxExce
  * 
  * TODO move the pre broker-startup setup method invocation code to {@link QpidBrokerTestCase}
  * 
- * @see SimpleACLTest
  * @see ExternalACLTest
  * @see ExternalACLFileTest
  * @see ExternalACLJMXTest
@@ -65,10 +64,7 @@ public abstract class AbstractACLTestCas
 	protected CountDownLatch _exceptionReceived;
 	
     /** Override this to return the name of the configuration XML file. */
-    public String getConfig()
-    {
-        return "config-systests-acl.xml";
-    }
+    public abstract String getConfig();
     
     /** Override this to setup external ACL files for virtual hosts. */
     public List<String> getHostList()
@@ -87,14 +83,8 @@ public abstract class AbstractACLTestCas
     @Override
     public void setUp() throws Exception
     {
-        if (QpidHome == null)
-        {
-            fail("QPID_HOME not set");
-        }
-
         // Initialise ACLs.
-        _configFile = new File(QpidHome, "etc" + File.separator + getConfig());
-        
+        _configFile = new File("build" + File.separator + "etc" + File.separator + getConfig());
         // Initialise ACL files
         for (String virtualHost : getHostList())
         {
@@ -160,7 +150,7 @@ public abstract class AbstractACLTestCas
      */
     public void setUpACLFile(String virtualHost) throws IOException, ConfigurationException
     {
-        String path = QpidHome + File.separator + "etc";
+        String path = "build" + File.separator + "etc";
         String className = StringUtils.substringBeforeLast(getClass().getSimpleName().toLowerCase(), "test");
         String testName = StringUtils.substringAfter(getName(), "test").toLowerCase();
         
@@ -200,7 +190,7 @@ public abstract class AbstractACLTestCas
         }
 
         PrintWriter out = new PrintWriter(new FileWriter(aclFile));
-        out.println(String.format("# %s", _testName));
+        out.println(String.format("# %s", getTestName()));
         for (String line : rules)
         {
             out.println(line);



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org