summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2008-08-21 13:17:30 +0000
committerMartin Ritchie <ritchiem@apache.org>2008-08-21 13:17:30 +0000
commitc96066c15fe3544b71d4a7e27d11695d38499104 (patch)
treed02d9a5e0a4e075fb47bcb8b45a3ed0c82c4e4cb
parentff455b342b1869e273635ae67cde3d44888603cb (diff)
downloadqpid-python-c96066c15fe3544b71d4a7e27d11695d38499104.tar.gz
QPID-1225 : Changed SimpleACLTest to use QpidTestCase so the failing test can be excluded. This change DOES NOT mean the test will run agains the exteranl brokers. The test explicitly shutsdown the QTC broker during the setUp and only runs InVM currently.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@687743 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java33
1 files changed, 31 insertions, 2 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
index a85faa230f..1740d37e38 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
@@ -28,6 +28,7 @@ import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
import org.apache.qpid.AMQException;
+import org.apache.qpid.test.utils.QpidTestCase;
import org.apache.qpid.jms.ConnectionListener;
import org.apache.qpid.url.URLSyntaxException;
@@ -35,12 +36,15 @@ import javax.jms.*;
import javax.jms.IllegalStateException;
import java.io.File;
-public class SimpleACLTest extends TestCase implements ConnectionListener
+public class SimpleACLTest extends QpidTestCase implements ConnectionListener
{
private String BROKER = "vm://:1";//"tcp://localhost:5672";
public void setUp() throws Exception
{
+ //Shutdown the QTC broker
+ stopBroker();
+
// Initialise ACLs.
final String QpidExampleHome = System.getProperty("QPID_EXAMPLE_HOME");
final File defaultaclConfigFile = new File(QpidExampleHome, "etc/acl.config.xml");
@@ -426,7 +430,32 @@ public class SimpleACLTest extends TestCase implements ConnectionListener
}
}
- public void testServerCreateTemporyQueueInvalid() throws JMSException, URLSyntaxException, AMQException
+ public void testServerCreateTemporaryQueueInvalid() throws JMSException, URLSyntaxException, AMQException
+ {
+ try
+ {
+ Connection conn = new AMQConnection(createConnectionString("server", "guest", BROKER));
+
+ Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ conn.start();
+
+ session.createTemporaryQueue();
+
+ fail("Test failed as creation succeded.");
+ //conn will be automatically closed
+ }
+ catch (JMSException e)
+ {
+ Throwable cause = e.getLinkedException();
+
+ assertNotNull("There was no liked exception", cause);
+ assertEquals("Wrong linked exception type", AMQAuthenticationException.class, cause.getClass());
+ assertEquals("Incorrect error code received", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
+ }
+ }
+
+ public void testServerCreateAutoDeleteQueueInvalid() throws JMSException, URLSyntaxException, AMQException
{
try
{