summaryrefslogtreecommitdiff
path: root/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLTest.java
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2013-02-28 16:14:30 +0000
committerKim van der Riet <kpvdr@apache.org>2013-02-28 16:14:30 +0000
commit9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch)
tree2a890e1df09e5b896a9b4168a7b22648f559a1f2 /java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLTest.java
parent172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff)
downloadqpid-python-asyncstore.tar.gz
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLTest.java')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLTest.java44
1 files changed, 39 insertions, 5 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLTest.java b/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLTest.java
index 0e45ca9493..8324ac74a5 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLTest.java
@@ -319,8 +319,12 @@ public class ExternalACLTest extends AbstractACLTestCase
public void setUpRequestResponseSuccess() throws Exception
{
- writeACLFile("test", "GROUP messaging-users client server",
- "ACL ALLOW-LOG messaging-users ACCESS VIRTUALHOST",
+ // The group "messaging-users", referenced in the ACL below, is currently defined
+ // in broker/etc/groups-systests.
+ // We tolerate a dependency from this test to that file because its
+ // contents are expected to change rarely.
+
+ writeACLFile("test", "ACL ALLOW-LOG messaging-users ACCESS VIRTUALHOST",
"# Server side",
"ACL ALLOW-LOG server CREATE QUEUE name=\"example.RequestQueue\"" ,
"ACL ALLOW-LOG server BIND EXCHANGE",
@@ -389,14 +393,44 @@ public class ExternalACLTest extends AbstractACLTestCase
conn.start();
// create kipper
- Topic kipper = sess.createTopic("kipper");
- TopicSubscriber subscriber = sess.createDurableSubscriber(kipper, "kipper");
+ String topicName = "kipper";
+ Topic topic = sess.createTopic(topicName);
+ TopicSubscriber subscriber = sess.createDurableSubscriber(topic, topicName);
subscriber.close();
- sess.unsubscribe("kipper");
+ sess.unsubscribe(topicName);
//Do something to show connection is active.
sess.rollback();
conn.close();
}
+
+ public void setUpFirewallAllow() throws Exception
+ {
+ writeACLFile("test", "ACL ALLOW client ACCESS VIRTUALHOST from_network=\"127.0.0.1\"");
+ }
+
+ public void testFirewallAllow() throws Exception
+ {
+ getConnection("test", "client", "guest");
+ // test pass because we successfully connected
+ }
+
+ public void setUpFirewallDeny() throws Exception
+ {
+ writeACLFile("test", "ACL DENY client ACCESS VIRTUALHOST from_network=\"127.0.0.1\"");
+ }
+
+ public void testFirewallDeny() throws Exception
+ {
+ try
+ {
+ getConnection("test", "client", "guest");
+ fail("We expected the connection to fail");
+ }
+ catch(JMSException e)
+ {
+ // pass
+ }
+ }
}