You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2009/10/21 13:39:05 UTC
svn commit: r827968 - in /qpid/trunk/qpid/java:
broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java
systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
Author: robbie
Date: Wed Oct 21 11:39:05 2009
New Revision: 827968
URL: http://svn.apache.org/viewvc?rev=827968&view=rev
Log:
QPID-1872: remove systest and reinstate equivalent unit test
Modified:
qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java?rev=827968&r1=827967&r2=827968&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java Wed Oct 21 11:39:05 2009
@@ -151,10 +151,8 @@
{
Object[] authArgs = new Object[]{_queue};
Object[] grantArgs = new Object[]{_queueName, _ownQueue};
-
- /* FIXME: This throws a null pointer exception QPID-1599
- * assertFalse(_perms.authorise(Permission.CONSUME, authArgs));
- */
+
+ assertEquals(AuthzResult.DENIED,_perms.authorise(Permission.CONSUME, authArgs));
_perms.grant(Permission.CONSUME, grantArgs);
assertEquals(AuthzResult.ALLOWED, _perms.authorise(Permission.CONSUME, authArgs));
}
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=827968&r1=827967&r2=827968&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java Wed Oct 21 11:39:05 2009
@@ -193,54 +193,6 @@
}
}
- public void testGuestConsumeWithCreateRightsAndWithoutConsumeRights() throws NamingException, ConfigurationException, IOException, Exception
- {
- //Customise the ACL config to give the guest user some create (could be any, non-consume) rights to
- //force creation of a PrincipalPermissions instance to perform the consume rights check against.
- setConfigurationProperty("virtualhosts.virtualhost.test.security.access_control_list.create.queues.queue.users.user", "guest");
-
- setUpACLTest();
-
- //QPID-2081: use a latch to sync on exception causing connection close, to work
- //around the connection close race during tearDown() causing sporadic failures
- final CountDownLatch exceptionReceived = new CountDownLatch(1);
-
- try
- {
- Connection conn = getConnection("guest", "guest");
-
- conn.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException e)
- {
- exceptionReceived.countDown();
- }
- });
-
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- sesh.createConsumer(sesh.createQueue("example.RequestQueue"));
-
- conn.close();
- }
- 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());
-
- //use the latch to ensure the control thread waits long enough for the exception thread
- //to have done enough to mark the connection closed before teardown commences
- assertTrue("Timed out waiting for conneciton to report close",
- exceptionReceived.await(2, TimeUnit.SECONDS));
- }
- }
-
public void testClientConsumeFromTempQueueValid() throws AMQException, URLSyntaxException, Exception
{
setUpACLTest();
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org