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
commit0d871420b20d4e98fde5b959883ec2a8f4eb4d5c (patch)
treec5bfa093fcace386d5c1b00282ed378d433fc92e
parentd9ec417fbf7eab5b2062ea9fc6ad48a8f9eda3c7 (diff)
downloadqpid-python-0d871420b20d4e98fde5b959883ec2a8f4eb4d5c.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/qpid@687743 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java33
1 files changed, 31 insertions, 2 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java b/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
index a85faa230f..1740d37e38 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
+++ b/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
{