Author: ritchiem
Date: Thu Aug 21 06:17:30 2008
New Revision: 687743

URL: http://svn.apache.org/viewvc?rev=687743&view=rev
Log:
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.

Modified:
    
incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java

Modified: 
incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=687743&r1=687742&r2=687743&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
 Thu Aug 21 06:17:30 2008
@@ -28,6 +28,7 @@
 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.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 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
         {


Reply via email to