Author: ritchiem
Date: Tue Dec  8 13:06:09 2009
New Revision: 888387

URL: http://svn.apache.org/viewvc?rev=888387&view=rev
Log:
Log:
QPID-1992 : Exclude message move test from CPP broker as it uses JMX.

merged from trunk r887950


Added:
    qpid/branches/0.5.x-dev/qpid/java/test-profiles/cpp.excludes
      - copied unchanged from r887950, 
qpid/trunk/qpid/java/test-profiles/cpp.excludes
Modified:
    qpid/branches/0.5.x-dev/   (props changed)
    qpid/branches/0.5.x-dev/qpid/java/   (props changed)
    
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
    qpid/branches/0.5.x-dev/qpid/java/test-profiles/cpp.testprofile

Propchange: qpid/branches/0.5.x-dev/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec  8 13:06:09 2009
@@ -1 +1 @@
-/qpid/trunk:887948
+/qpid/trunk:887948,887950

Propchange: qpid/branches/0.5.x-dev/qpid/java/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec  8 13:06:09 2009
@@ -1,2 +1,2 @@
 /qpid/branches/java-broker-0-10/qpid/java:829414,829575
-/qpid/trunk/qpid/java:835115,884634-884635,884838,885765,887948,887952,888246,888248,888250,888348
+/qpid/trunk/qpid/java:835115,884634-884635,884838,885765,887948,887950,887952,888246,888248,888250,888348

Modified: 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java?rev=888387&r1=888386&r2=888387&view=diff
==============================================================================
--- 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
 (original)
+++ 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
 Tue Dec  8 13:06:09 2009
@@ -29,10 +29,10 @@
 import javax.jms.Destination;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.Topic;
-import javax.jms.MessageListener;
 import javax.management.openmbean.CompositeDataSupport;
 import javax.management.openmbean.TabularData;
 import java.util.Iterator;
@@ -50,7 +50,6 @@
 
     private Connection _connection;
     private Session _session;
-    private JMXTestUtils _jmxUtils;
 
     private static final String USER = "admin";
     private CountDownLatch _receiveMessage;
@@ -58,25 +57,13 @@
 
     public void setUp() throws Exception
     {
-        _jmxUtils = new JMXTestUtils(this, USER, USER);
-        _jmxUtils.setUp();
         super.setUp();
 
-        // Open the JMX Connection
-        _jmxUtils.open();
-
         _connection = getConnection();
 
         _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
     }
 
-    public void tearDown() throws Exception
-    {
-        _jmxUtils.close();
-
-        super.tearDown();
-    }
-
     /**
      * Test a message sent to a queue comes back with JMSDestination queue
      *
@@ -145,55 +132,69 @@
      */
     public void testMovedToQueue() throws Exception
     {
+        // Setup JMXUtils
+        JMXTestUtils jmxUtils = new JMXTestUtils(this, USER, USER);
+        jmxUtils.setUp();
+        // Open the JMX Connection
+        jmxUtils.open();
+        try
+        {
 
-        Queue queue = _session.createQueue(getTestQueueName());
+            Queue queue = _session.createQueue(getTestQueueName());
 
-        _session.createConsumer(queue).close();
+            _session.createConsumer(queue).close();
 
-        sendMessage(_session, queue, 1);
+            sendMessage(_session, queue, 1);
 
-        Topic topic = _session.createTopic(getTestQueueName() + "Topic");
+            Topic topic = _session.createTopic(getTestQueueName() + "Topic");
 
-        MessageConsumer consumer = _session.createConsumer(topic);
+            MessageConsumer consumer = _session.createConsumer(topic);
 
-        // Use Management to move message.
+            // Use Management to move message.
 
-        ManagedQueue managedQueue = _jmxUtils.
-                getManagedObject(ManagedQueue.class,
-                                 
_jmxUtils.getQueueObjectName(getConnectionFactory().getVirtualPath().substring(1),
-                                                              
getTestQueueName()));
+            ManagedQueue managedQueue = jmxUtils.
+                    getManagedObject(ManagedQueue.class,
+                                     
jmxUtils.getQueueObjectName(getConnectionFactory().getVirtualPath().substring(1),
+                                                                  
getTestQueueName()));
 
-        // Find the first message on the queue
-        TabularData data = managedQueue.viewMessages(1L, 2L);
+            // Find the first message on the queue
+            TabularData data = managedQueue.viewMessages(1L, 2L);
 
-        Iterator values = data.values().iterator();
-        assertTrue("No Messages found via JMX", values.hasNext());
+            Iterator values = data.values().iterator();
+            assertTrue("No Messages found via JMX", values.hasNext());
 
-        // Get its message ID
-        Long msgID = (Long) ((CompositeDataSupport) values.next()).get("AMQ 
MessageId");
+            // Get its message ID
+            Long msgID = (Long) ((CompositeDataSupport) 
values.next()).get("AMQ MessageId");
 
-        // Start the connection and consume message that has been moved to the
-        // queue
-        _connection.start();
+            // Start the connection and consume message that has been moved to 
the
+            // queue
+            _connection.start();
 
-        Message message = consumer.receive(1000);
+            Message message = consumer.receive(1000);
 
-        //Validate we don't have a message on the queue before we start
-        assertNull("Message should be null", message);
+            //Validate we don't have a message on the queue before we start
+            assertNull("Message should be null", message);
 
-        // Move it to from the topic to the queue
-        managedQueue.moveMessages(msgID, msgID, ((AMQTopic) 
topic).getQueueName());
+            // Move it to from the topic to the queue
+            managedQueue.moveMessages(msgID, msgID, ((AMQTopic) 
topic).getQueueName());
 
-        // Retrieve the newly moved message
-        message = consumer.receive(1000);
+            // Retrieve the newly moved message
+            message = consumer.receive(1000);
 
-        assertNotNull("Message should not be null", message);
+            assertNotNull("Message should not be null", message);
 
-        Destination destination = message.getJMSDestination();
+            Destination destination = message.getJMSDestination();
 
-        assertNotNull("JMSDestination should not be null", destination);
+            assertNotNull("JMSDestination should not be null", destination);
+
+            assertEquals("Incorrect Destination type", queue.getClass(), 
destination.getClass());
+
+        }
+        finally
+        {
+            jmxUtils.close();
+        }
 
-        assertEquals("Incorrect Destination type", queue.getClass(), 
destination.getClass());
     }
 
     /**
@@ -217,8 +218,8 @@
         _receiveMessage = new CountDownLatch(1);
 
         consumer.setMessageListener(this);
-        
-        assertTrue("Timed out waiting for message to be received 
",_receiveMessage.await(1, TimeUnit.SECONDS));
+
+        assertTrue("Timed out waiting for message to be received ", 
_receiveMessage.await(1, TimeUnit.SECONDS));
 
         assertNotNull("Message should not be null", _message);
 

Modified: qpid/branches/0.5.x-dev/qpid/java/test-profiles/cpp.testprofile
URL: 
http://svn.apache.org/viewvc/qpid/branches/0.5.x-dev/qpid/java/test-profiles/cpp.testprofile?rev=888387&r1=888386&r2=888387&view=diff
==============================================================================
--- qpid/branches/0.5.x-dev/qpid/java/test-profiles/cpp.testprofile (original)
+++ qpid/branches/0.5.x-dev/qpid/java/test-profiles/cpp.testprofile Tue Dec  8 
13:06:09 2009
@@ -16,4 +16,4 @@
 broker=${broker.executable} -p @PORT --data-dir ${build.data}/@PORT -t --auth 
no --no-module-dir ${broker.modules} ${broker.args}
 
 profile.excludes=010PrefetchExcludes 010TransientExcludes
-test.excludes=Excludes 010Excludes ${profile}.excludes ${profile.excludes}
+test.excludes=Excludes 010Excludes ${profile}.excludes ${profile.excludes} 
cpp.excludes



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to