diff options
| author | Keith Wall <kwall@apache.org> | 2014-06-25 16:56:00 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-06-25 16:56:00 +0000 |
| commit | d360f54b9ad1174fe7d2c4a75e37533cf938a297 (patch) | |
| tree | 5d3d16bf23b82d2711102dd4b14bd40412e24596 /qpid/java/systests/src | |
| parent | a1a22c139817675a924dc3947a84cdda83e60e61 (diff) | |
| download | qpid-python-d360f54b9ad1174fe7d2c4a75e37533cf938a297.tar.gz | |
NO-JIRA: [Java Broker Tests] Add test checking the ability to delete (i.e. close) a messaging connection from the
management layer.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1605498 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java index cbdd4ff35c..5be3be615f 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java @@ -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 QpidRestTestCase 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"); |
