[jboss-cvs] Picketbox SVN: r51 - in trunk/picketbox/src/test: java/org/picketbox/test/acl and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 2 22:13:42 EST 2010
Author: anil.saldhana at jboss.com
Date: 2010-03-02 22:13:40 -0500 (Tue, 02 Mar 2010)
New Revision: 51
Added:
trunk/picketbox/src/test/java/org/picketbox/test/acl/
trunk/picketbox/src/test/java/org/picketbox/test/acl/MemoryOnlyACLStrategy.java
Removed:
trunk/picketbox/src/test/java/org/picketbox/test/pojos/MemoryOnlyACLStrategy.java
Modified:
trunk/picketbox/src/test/java/org/picketbox/test/api/InstanceBasedAuthorizationUnitTestCase.java
trunk/picketbox/src/test/resources/config/acl-authorization.conf
Log:
move the MemoryOnlyACLStrategy out into a new pkg
Added: trunk/picketbox/src/test/java/org/picketbox/test/acl/MemoryOnlyACLStrategy.java
===================================================================
--- trunk/picketbox/src/test/java/org/picketbox/test/acl/MemoryOnlyACLStrategy.java (rev 0)
+++ trunk/picketbox/src/test/java/org/picketbox/test/acl/MemoryOnlyACLStrategy.java 2010-03-03 03:13:40 UTC (rev 51)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.picketbox.test.acl;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.security.acl.ACL;
+import org.jboss.security.acl.ACLEntry;
+import org.jboss.security.acl.ACLImpl;
+import org.jboss.security.acl.ACLPersistenceStrategy;
+import org.jboss.security.authorization.Resource;
+
+/**
+ * <p>
+ * This class implements an {@code ACLPersistenceStrategy} that maintains the ACLs in memory.
+ * NOTE: this class is not thread safe and should be used solely for testing purposes.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
+ */
+public class MemoryOnlyACLStrategy implements ACLPersistenceStrategy
+{
+
+ private static final Map<Resource, ACL> acls = new HashMap<Resource, ACL>();
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.security.acl.ACLPersistenceStrategy#createACL(org.jboss.security.authorization.Resource)
+ */
+ public ACL createACL(Resource resource)
+ {
+ ACL acl = new ACLImpl(resource);
+ acls.put(resource, acl);
+ return acl;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.security.acl.ACLPersistenceStrategy#createACL(org.jboss.security.authorization.Resource, java.util.Collection)
+ */
+ public ACL createACL(Resource resource, Collection<ACLEntry> entries)
+ {
+ ACL acl = new ACLImpl(resource.toString(), entries);
+ acls.put(resource, acl);
+ return acl;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.security.acl.ACLPersistenceStrategy#getACL(org.jboss.security.authorization.Resource)
+ */
+ public ACL getACL(Resource resource)
+ {
+ return acls.get(resource);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.security.acl.ACLPersistenceStrategy#getACLs()
+ */
+ public Collection<ACL> getACLs()
+ {
+ return acls.values();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.security.acl.ACLPersistenceStrategy#removeACL(org.jboss.security.acl.ACL)
+ */
+ public boolean removeACL(ACL acl)
+ {
+ return this.removeACL(acl.getResource());
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.security.acl.ACLPersistenceStrategy#removeACL(org.jboss.security.authorization.Resource)
+ */
+ public boolean removeACL(Resource resource)
+ {
+ ACL removedACL = acls.remove(resource);
+ return removedACL != null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.security.acl.ACLPersistenceStrategy#updateACL(org.jboss.security.acl.ACL)
+ */
+ public boolean updateACL(ACL acl)
+ {
+ ACL updatedACL = acls.put(acl.getResource(), acl);
+ return updatedACL != null;
+ }
+}
Modified: trunk/picketbox/src/test/java/org/picketbox/test/api/InstanceBasedAuthorizationUnitTestCase.java
===================================================================
--- trunk/picketbox/src/test/java/org/picketbox/test/api/InstanceBasedAuthorizationUnitTestCase.java 2010-03-03 02:37:07 UTC (rev 50)
+++ trunk/picketbox/src/test/java/org/picketbox/test/api/InstanceBasedAuthorizationUnitTestCase.java 2010-03-03 03:13:40 UTC (rev 51)
@@ -51,7 +51,7 @@
import org.jboss.security.identity.plugins.IdentityFactory;
import org.picketbox.config.PicketBoxConfiguration;
import org.picketbox.factories.SecurityFactory;
-import org.picketbox.test.pojos.MemoryOnlyACLStrategy;
+import org.picketbox.test.acl.MemoryOnlyACLStrategy;
/**
* <p>
Deleted: trunk/picketbox/src/test/java/org/picketbox/test/pojos/MemoryOnlyACLStrategy.java
===================================================================
--- trunk/picketbox/src/test/java/org/picketbox/test/pojos/MemoryOnlyACLStrategy.java 2010-03-03 02:37:07 UTC (rev 50)
+++ trunk/picketbox/src/test/java/org/picketbox/test/pojos/MemoryOnlyACLStrategy.java 2010-03-03 03:13:40 UTC (rev 51)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.picketbox.test.pojos;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.security.acl.ACL;
-import org.jboss.security.acl.ACLEntry;
-import org.jboss.security.acl.ACLImpl;
-import org.jboss.security.acl.ACLPersistenceStrategy;
-import org.jboss.security.authorization.Resource;
-
-/**
- * <p>
- * This class implements an {@code ACLPersistenceStrategy} that maintains the ACLs in memory.
- * NOTE: this class is not thread safe and should be used solely for testing purposes.
- * </p>
- *
- * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
- */
-public class MemoryOnlyACLStrategy implements ACLPersistenceStrategy
-{
-
- private static final Map<Resource, ACL> acls = new HashMap<Resource, ACL>();
-
- /*
- * (non-Javadoc)
- * @see org.jboss.security.acl.ACLPersistenceStrategy#createACL(org.jboss.security.authorization.Resource)
- */
- public ACL createACL(Resource resource)
- {
- ACL acl = new ACLImpl(resource);
- acls.put(resource, acl);
- return acl;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.security.acl.ACLPersistenceStrategy#createACL(org.jboss.security.authorization.Resource, java.util.Collection)
- */
- public ACL createACL(Resource resource, Collection<ACLEntry> entries)
- {
- ACL acl = new ACLImpl(resource.toString(), entries);
- acls.put(resource, acl);
- return acl;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.security.acl.ACLPersistenceStrategy#getACL(org.jboss.security.authorization.Resource)
- */
- public ACL getACL(Resource resource)
- {
- return acls.get(resource);
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.security.acl.ACLPersistenceStrategy#getACLs()
- */
- public Collection<ACL> getACLs()
- {
- return acls.values();
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.security.acl.ACLPersistenceStrategy#removeACL(org.jboss.security.acl.ACL)
- */
- public boolean removeACL(ACL acl)
- {
- return this.removeACL(acl.getResource());
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.security.acl.ACLPersistenceStrategy#removeACL(org.jboss.security.authorization.Resource)
- */
- public boolean removeACL(Resource resource)
- {
- ACL removedACL = acls.remove(resource);
- return removedACL != null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.security.acl.ACLPersistenceStrategy#updateACL(org.jboss.security.acl.ACL)
- */
- public boolean updateACL(ACL acl)
- {
- ACL updatedACL = acls.put(acl.getResource(), acl);
- return updatedACL != null;
- }
-}
Modified: trunk/picketbox/src/test/resources/config/acl-authorization.conf
===================================================================
--- trunk/picketbox/src/test/resources/config/acl-authorization.conf 2010-03-03 02:37:07 UTC (rev 50)
+++ trunk/picketbox/src/test/resources/config/acl-authorization.conf 2010-03-03 03:13:40 UTC (rev 51)
@@ -15,7 +15,7 @@
</authentication>
<acl>
<acl-module code="org.jboss.security.acl.ACLProviderImpl" flag="required">
- <module-option name="persistenceStrategy">org.picketbox.test.pojos.MemoryOnlyACLStrategy</module-option>
+ <module-option name="persistenceStrategy">org.picketbox.test.acl.MemoryOnlyACLStrategy</module-option>
<module-option name="checkParentACL">true</module-option>
</acl-module>
</acl>
More information about the jboss-cvs-commits
mailing list