You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2014/06/25 18:56:01 UTC

svn commit: r1605498 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java

Author: kwall
Date: Wed Jun 25 16:56:00 2014
New Revision: 1605498

URL: http://svn.apache.org/r1605498
Log:
NO-JIRA: [Java Broker Tests] Add test checking the ability to delete (i.e. close) a messaging connection from the
management layer.

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java?rev=1605498&r1=1605497&r2=1605498&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java Wed Jun 25 16:56:00 2014
@@ -30,6 +30,7 @@ import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQSession;
@@ -113,6 +114,31 @@ public class ConnectionRestTest extends 
         assertConnection(connectionDetails);
     }
 
+    public void testDeleteConnection() throws Exception
+    {
+        // get connection name
+        String connectionName = getConnectionName();
+
+        List<Map<String, Object>> connections = getRestTestHelper().getJsonAsList("connection/test/test");
+        assertEquals("Unexpected number of connections before deletion", 1, connections.size());
+
+        String connectionUrl = "connection/test/test/" + URLDecoder.decode(connectionName, "UTF-8");
+        getRestTestHelper().submitRequest(connectionUrl, "DELETE", HttpServletResponse.SC_OK);
+
+        connections = getRestTestHelper().getJsonAsList("connection/test/test");
+        assertEquals("Unexpected number of connections before deletion", 0, connections.size());
+
+        try
+        {
+            _connection.createSession(true, javax.jms.Session.SESSION_TRANSACTED);
+            fail("Exception not thrown");
+        }
+        catch (JMSException je)
+        {
+            // PASS
+        }
+    }
+
     public void testGetAllSessions() throws Exception
     {
         List<Map<String, Object>> sessions = getRestTestHelper().getJsonAsList("session");



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