You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2009/02/08 22:28:38 UTC

svn commit: r742172 [6/7] - in /portals/jetspeed-2/portal/branches/JPA_BRANCH: ./ components/jetspeed-page-manager/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/ components/jetspeed-profiler/ components/jetspeed-profiler/...

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/PersistentJetspeedPermissionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/PersistentJetspeedPermissionImpl.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/PersistentJetspeedPermissionImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/PersistentJetspeedPermissionImpl.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.security.spi.jpa;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.NamedQuery;
+import javax.persistence.NamedQueries;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
+
+/**
+ * @version $Id: PersistentJetspeedPermissionImpl.java 700788 2008-10-01 14:33:30Z ate $
+ *
+ */
+@Entity (name="Permission")
+@Table (name="SECURITY_PERMISSION")
+@NamedQueries ({@NamedQuery(name="PERMISSION", query="select p from Permission p where p.id = :id"),
+                @NamedQuery(name="PERMISSION_TYPE_NAME", query="select p from Permission p where p.type = :type and p.name = :name"),
+                @NamedQuery(name="PERMISSIONS", query="select p from Permission p order by p.type asc, p.name asc"),
+                @NamedQuery(name="PERMISSIONS_LIKE_NAME", query="select p from Permission p where p.type = :type and p.name like :nameFilter order by p.name asc"),
+                @NamedQuery(name="PERMISSIONS_PRINCIPAL", query="select p from Permission p, PrincipalPermission pp where pp.permissionId = p.id and pp.principalId = :principalId order by p.type asc, p.name asc")})
+public class PersistentJetspeedPermissionImpl implements PersistentJetspeedPermission
+{
+    private static final long serialVersionUID = 9200223005769593282L;
+    
+    // Members
+    
+    @Id
+    @GeneratedValue (strategy=GenerationType.AUTO)
+    @Column (name="PERMISSION_ID")
+    private Long id;
+    @Version
+    @Column (name="JPA_VERSION")
+    @SuppressWarnings("unused")
+    private int jpaVersion;
+    @Basic
+    @Column (name="PERMISSION_TYPE")
+    private String type;
+    @Basic
+    @Column (name="NAME")
+    private String name;
+    @Basic
+    @Column (name="ACTIONS")
+    private String actions;
+    
+    // Implementation
+
+    public PersistentJetspeedPermissionImpl()
+    {
+    }
+
+    public PersistentJetspeedPermissionImpl(String type, String name)
+    {
+        this.type = type;
+        this.name = name;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    
+    public String getType()
+    {
+        return type;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public String getActions()
+    {
+        return actions;
+    }
+    
+    public void setActions(String actions)
+    {
+        this.actions = actions;
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/SecurityManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/SecurityManager.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/SecurityManager.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/SecurityManager.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.spi.jpa;
+
+import javax.persistence.EntityManager;
+
+/**
+ * SecurityManager
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public interface SecurityManager
+{
+    /**
+     * Return entity manager associated with current thread from
+     * registered context or default transactional entity manager
+     * created for this request.
+     * 
+     * @return entity manager.
+     */
+    public EntityManager getEntityManager();
+
+    /**
+     * Register security manager context with current thread.
+     * 
+     * @param context security manager context.
+     */
+    public void registerContext(Object context);
+
+    /**
+     * Get security manager context registered with current thread.
+     * 
+     * @return security manager context.
+     */
+    public Object getContext();
+
+    /**
+     * Unregister security manager context with current thread.
+     * 
+     * @param context security manager context.
+     */
+    public void unregisterContext(Object context);
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/SecurityManagerContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/SecurityManagerContext.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/SecurityManagerContext.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/SecurityManagerContext.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.spi.jpa;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+/**
+ * SecurityManagerContext
+ * 
+ * Stateful object uses to hold JPA extended entity manager.
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class SecurityManagerContext
+{
+    private EntityManager extendedEntityManager;
+    private SecurityManager securityManager;
+
+    /**
+     * Set extended conversational entity manager instance for context.
+     * 
+     * @param entityManager injected entity manager.
+     */
+    @PersistenceContext (type=PersistenceContextType.EXTENDED, unitName="jetspeed-security")
+    public void setExtendedEntityManager(EntityManager entityManager)
+    {
+        extendedEntityManager = entityManager;
+    }
+    
+    /**
+     * Get extended conversational entity manager instance for context.
+     * 
+     * @return entity manager.
+     */
+    public EntityManager getExtendedEntityManager()
+    {
+        return extendedEntityManager;
+    }
+    
+    /**
+     * Set security manager associated with context.
+     * 
+     * @param securityManager
+     */
+    public void setSecurityManager(SecurityManager securityManager)
+    {
+        this.securityManager = securityManager;
+    }
+    
+    /**
+     * Initialize context by registering with securityManager on creating thread.
+     */
+    public void initialize()
+    {
+        securityManager.registerContext(this);
+    }
+
+    /**
+     * Terminate context by unregistering with securityManager on creating thread.
+     */
+    public void terminate()
+    {
+        securityManager.unregisterContext(this);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/UserPasswordCredentialManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/UserPasswordCredentialManagerImpl.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/UserPasswordCredentialManagerImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/UserPasswordCredentialManagerImpl.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.spi.jpa;
+
+import org.apache.jetspeed.security.PasswordCredential;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.User;
+import org.apache.jetspeed.security.spi.UserPasswordCredentialAccessManager;
+import org.apache.jetspeed.security.spi.UserPasswordCredentialManager;
+import org.apache.jetspeed.security.spi.UserPasswordCredentialPolicyManager;
+import org.apache.jetspeed.security.spi.UserPasswordCredentialStorageManager;
+import org.apache.jetspeed.security.spi.impl.AbstractUserPasswordCredentialManagerImpl;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @version $Id: UserPasswordCredentialManagerImpl.java 698208 2008-09-23 15:57:18Z ate $
+ */
+@Repository
+public class UserPasswordCredentialManagerImpl extends AbstractUserPasswordCredentialManagerImpl implements UserPasswordCredentialManager
+{
+    private static final long serialVersionUID = 3029131908739644450L;
+
+    public UserPasswordCredentialManagerImpl(UserPasswordCredentialStorageManager upcsm, UserPasswordCredentialAccessManager upcam)
+    {
+        super(upcsm, upcam);
+    }
+
+    public UserPasswordCredentialManagerImpl(UserPasswordCredentialStorageManager upcsm, UserPasswordCredentialAccessManager upcam, UserPasswordCredentialPolicyManager upcpm)
+    {
+        super(upcsm, upcam, upcpm);
+    }
+
+    @Transactional (readOnly=true, rollbackFor=SecurityException.class)
+    public PasswordCredential getPasswordCredential(User user) throws SecurityException
+    {
+        return super.getPasswordCredential(user);
+    }
+
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public void storePasswordCredential(PasswordCredential credential) throws SecurityException
+    {
+        super.storePasswordCredential(credential);
+    }
+
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public PasswordCredential getAuthenticatedPasswordCredential(String userName, String password) throws SecurityException
+    {
+        return super.getAuthenticatedPasswordCredential(userName, password);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/UserPasswordCredentialPolicyManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/UserPasswordCredentialPolicyManagerImpl.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/UserPasswordCredentialPolicyManagerImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/jpa/UserPasswordCredentialPolicyManagerImpl.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.spi.jpa;
+
+import java.util.List;
+
+import org.apache.jetspeed.security.CredentialPasswordEncoder;
+import org.apache.jetspeed.security.CredentialPasswordValidator;
+import org.apache.jetspeed.security.PasswordCredential;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.spi.UserPasswordCredentialPolicyManager;
+import org.apache.jetspeed.security.spi.impl.AbstractUserPasswordCredentialPolicyManagerImpl;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @version $Id: UserPasswordCredentialPolicyManagerImpl.java 707423 2008-10-23 17:38:23Z vkumar $
+ */
+@Repository
+public class UserPasswordCredentialPolicyManagerImpl extends AbstractUserPasswordCredentialPolicyManagerImpl implements UserPasswordCredentialPolicyManager
+{
+    private static final long serialVersionUID = 7674880214710113834L;
+
+    public UserPasswordCredentialPolicyManagerImpl()
+    {
+        super();
+    }
+
+    public UserPasswordCredentialPolicyManagerImpl(CredentialPasswordEncoder encoder, CredentialPasswordValidator validator, List<?> interceptors)
+    {
+        super(encoder, validator, interceptors);
+    }
+
+    @Transactional (readOnly=true, rollbackFor=SecurityException.class)
+    public boolean onLoad(PasswordCredential credential, String userName) throws SecurityException
+    {
+        return super.onLoad(credential, userName);
+    }
+
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public boolean authenticate(PasswordCredential credential, String userName, String password) throws SecurityException
+    {
+        return super.authenticate(credential, userName, password);
+    }
+
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public void onStore(PasswordCredential credential) throws SecurityException
+    {
+        super.onStore(credential);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/resources/META-INF/persistence.xml?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/resources/META-INF/persistence.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/main/resources/META-INF/persistence.xml Sun Feb  8 21:28:35 2009
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
+
+    <persistence-unit name="jetspeed-security" transaction-type="JTA">
+
+        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+
+        <jta-data-source>jetspeed-xa</jta-data-source>
+        <non-jta-data-source>jetspeed</non-jta-data-source>
+
+        <class>org.apache.jetspeed.security.spi.jpa.PersistentJetspeedPermissionImpl</class>
+        <class>org.apache.jetspeed.security.spi.jpa.JetspeedPrincipalAssociation</class>
+        <class>org.apache.jetspeed.security.spi.jpa.PasswordCredentialImpl</class>
+        <class>org.apache.jetspeed.security.spi.jpa.JetspeedPrincipalPermission</class>
+        <class>org.apache.jetspeed.security.jpa.SecurityDomainImpl</class>
+        <class>org.apache.jetspeed.security.jpa.UserImpl</class>
+        <class>org.apache.jetspeed.security.jpa.SecurityAttributeValueImpl</class>
+        <class>org.apache.jetspeed.security.jpa.PersistentJetspeedPrincipal</class>
+        <class>org.apache.jetspeed.security.jpa.GroupImpl</class>
+        <class>org.apache.jetspeed.security.jpa.RoleImpl</class>
+
+        <exclude-unlisted-classes>true</exclude-unlisted-classes>
+
+    </persistence-unit>
+
+</persistence>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/AbstractSecurityTestcase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/AbstractSecurityTestcase.java?rev=742172&r1=742171&r2=742172&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/AbstractSecurityTestcase.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/AbstractSecurityTestcase.java Sun Feb  8 21:28:35 2009
@@ -25,7 +25,7 @@
 import javax.security.auth.Subject;
 
 import org.apache.jetspeed.JetspeedActions;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.security.GroupManager;
 import org.apache.jetspeed.security.JetspeedPermission;
 import org.apache.jetspeed.security.PasswordCredential;
@@ -44,7 +44,7 @@
  * @version $Id$
  *  
  */
-public class AbstractSecurityTestcase extends DatasourceEnabledSpringTestCase
+public class AbstractSecurityTestcase extends JPADatasourceEnabledSpringTestCase
 {
     /** The user manager. */
     protected UserManager ums;

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAGroupManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAGroupManager.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAGroupManager.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAGroupManager.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPAGroupManager
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPAGroupManager extends TestGroupManager
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPAGroupManager.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-security.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPALoginModule.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPALoginModule.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPALoginModule.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPALoginModule.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPALoginModule
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPALoginModule extends TestLoginModule
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPALoginModule.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-security.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAPermissionManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAPermissionManager.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAPermissionManager.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAPermissionManager.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPAPermissionManager
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPAPermissionManager extends TestPermissionManager
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPAPermissionManager.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-security.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARdbmsPolicy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARdbmsPolicy.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARdbmsPolicy.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARdbmsPolicy.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPARdbmsPolicy
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPARdbmsPolicy extends TestRdbmsPolicy
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPARdbmsPolicy.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-security.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARdbmsPolicyFolder.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARdbmsPolicyFolder.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARdbmsPolicyFolder.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARdbmsPolicyFolder.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPARdbmsPolicyFolder
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPARdbmsPolicyFolder extends TestRdbmsPolicyFolder
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPARdbmsPolicyFolder.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-security.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARoleManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARoleManager.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARoleManager.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPARoleManager.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPARoleManager
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPARoleManager extends TestRoleManager
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPARoleManager.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-security.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAUserManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAUserManager.java?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAUserManager.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestOpenJPAUserManager.java Sun Feb  8 21:28:35 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPAUserManager
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPAUserManager extends TestUserManager
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPAUserManager.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-security.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestRdbmsPolicyFolder.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestRdbmsPolicyFolder.java?rev=742172&r1=742171&r2=742172&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestRdbmsPolicyFolder.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/TestRdbmsPolicyFolder.java Sun Feb  8 21:28:35 2009
@@ -53,7 +53,7 @@
         {
             System.out.println("\t\t[TestRdbmsPolicy - Folder] Creating login context.");
             PassiveCallbackHandler pch = new PassiveCallbackHandler("anon", "password");
-            loginContext = new LoginContext("jetspeed", pch);
+            loginContext = new LoginContext("Jetspeed", pch);
             loginContext.login();
         }
         catch (LoginException le)
@@ -86,7 +86,7 @@
     public static Test suite()
     {
         // All methods starting with "test" will be executed in the test suite.
-        return new TestSuite(TestRdbmsPolicy.class);
+        return new TestSuite(TestRdbmsPolicyFolder.class);
     }
 
     /**

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/jndi.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/jndi.properties?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/jndi.properties (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/jndi.properties Sun Feb  8 21:28:35 2009
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# ------------------------------------------------------------------------
+#
+# JNDI Naming Configuration
+#
+# $Id: $
+#
+# ------------------------------------------------------------------------
+
+java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
+java.naming.factory.url.pkgs=org.apache.naming

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/jpa-security.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/jpa-security.xml?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/jpa-security.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/jpa-security.xml Sun Feb  8 21:28:35 2009
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <!-- Jetspeed XA DataSource -->
+    <bean id="JetspeedXADS" class="org.springframework.jndi.JndiObjectFactoryBean">
+        <property name="resourceRef" value="false"/>
+        <property name="jndiName" value="java:comp/env/jdbc/jetspeed-xa"/>
+    </bean>
+
+    <!-- JPA Configuration -->
+    <bean id="persistenceUnitManager" class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
+        <property name="dataSources">
+            <map>
+                <entry key="jetspeed-xa" value-ref="JetspeedXADS"/>
+                <entry key="jetspeed" value-ref="JetspeedDS"/>
+            </map>
+        </property>
+        <property name="defaultDataSource" ref="JetspeedDS"/>
+        <property name="persistenceXmlLocations">
+            <list>
+                <value>classpath*:META-INF/persistence.xml</value>
+            </list>
+        </property>
+    </bean>
+    <bean id="abstractEntityManagerFactory" abstract="true" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
+    </bean>
+
+    <!-- Spring/Atomikos/JTA Transaction Manager -->
+    <bean id="atomikosUserTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp" init-method="init" destroy-method="shutdownForce">
+        <constructor-arg>
+            <props>
+                <!-- standard atomikos standalone configuration -->
+                <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop>
+                <!-- server/process name overrides for log file names -->
+                <prop key="com.atomikos.icatch.tm_unique_name">${com.atomikos.icatch.tm_unique_name}</prop>
+                <prop key="com.atomikos.icatch.log_base_dir">${com.atomikos.icatch.log_base_dir}</prop>
+                <prop key="com.atomikos.icatch.log_base_name">${com.atomikos.icatch.log_base_name}</prop>
+                <prop key="com.atomikos.icatch.output_dir">${com.atomikos.icatch.output_dir}</prop>
+                <prop key="com.atomikos.icatch.console_file_name">${com.atomikos.icatch.console_file_name}</prop>
+            </props>
+        </constructor-arg>
+    </bean>
+    <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close" depends-on="atomikosUserTransactionService">
+        <property name="forceShutdown" value="true"/>
+    </bean>
+    <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
+        <property name="transactionManager" ref="atomikosTransactionManager"/>
+        <property name="userTransactionName" value="java:comp/UserTransaction"/>
+    </bean>
+    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
+
+    <!-- Spring Transaction Annotations -->
+    <tx:annotation-driven transaction-manager="jtaTransactionManager"/>
+
+    <!-- JPA/OpenJPA Security Components -->
+    <bean id="org.apache.jetspeed.security.CredentialPasswordEncoder" class="org.apache.jetspeed.security.spi.impl.MessageDigestCredentialPasswordEncoder">
+        <constructor-arg index="0"><value>SHA-1</value></constructor-arg>
+    </bean>
+    <bean id="org.apache.jetspeed.security.CredentialPasswordValidator" class="org.apache.jetspeed.security.spi.impl.DefaultCredentialPasswordValidator">
+    </bean>
+    <bean id="org.apache.jetspeed.security.spi.UserPasswordCredentialPolicyManager" class="org.apache.jetspeed.security.spi.jpa.UserPasswordCredentialPolicyManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.CredentialPasswordEncoder"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.CredentialPasswordValidator"/>
+        <constructor-arg index="2">
+            <list>
+                <bean class="org.apache.jetspeed.security.spi.impl.ValidatePasswordOnLoadInterceptor"/>
+                <bean class="org.apache.jetspeed.security.spi.impl.EncodePasswordOnFirstLoadInterceptor"/>
+            </list>
+        </constructor-arg>
+    </bean>
+    <bean id="org.apache.jetspeed.security.spi.UserPasswordCredentialManager" class="org.apache.jetspeed.security.spi.jpa.UserPasswordCredentialManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.UserPasswordCredentialPolicyManager"/>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.JetspeedPrincipalType.user" class="org.apache.jetspeed.security.impl.JetspeedPrincipalTypeImpl">
+        <constructor-arg index="0" value="user"/>
+        <constructor-arg index="1" value="org.apache.jetspeed.security.jpa.UserImpl"/>
+        <constructor-arg index="2">
+            <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypesImpl">
+                <constructor-arg index="0"><value>true</value></constructor-arg>
+                <constructor-arg index="1"><value>false</value></constructor-arg>
+                <constructor-arg index="2">
+                    <list>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="org.apache.jetspeed.user.subsite"/>
+                            <constructor-arg index="1" value="jetspeed"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="org.apache.jetspeed.prefered.locale"/>
+                            <constructor-arg index="1" value="jetspeed"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="user.name.given"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="user.name.family"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                    </list>
+                </constructor-arg>
+            </bean>
+        </constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.JetspeedPrincipalType.role" class="org.apache.jetspeed.security.impl.JetspeedPrincipalTypeImpl">
+        <constructor-arg index="0" value="role"/>
+        <constructor-arg index="1" value="org.apache.jetspeed.security.jpa.RoleImpl"/>
+        <constructor-arg index="2">
+            <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypesImpl">
+                <constructor-arg index="0"><value>true</value></constructor-arg>
+                <constructor-arg index="1"><value>false</value></constructor-arg>
+                <constructor-arg index="2">
+                    <list>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="role.display.name"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                    </list>
+                </constructor-arg>
+            </bean>
+        </constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.JetspeedPrincipalType.group" class="org.apache.jetspeed.security.impl.JetspeedPrincipalTypeImpl">
+        <constructor-arg index="0" value="group"/>
+        <constructor-arg index="1" value="org.apache.jetspeed.security.jpa.GroupImpl"/>
+        <constructor-arg index="2">
+            <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypesImpl">
+                <constructor-arg index="0"><value>true</value></constructor-arg>
+                <constructor-arg index="1"><value>false</value></constructor-arg>
+                <constructor-arg index="2">
+                    <list>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="group.display.name"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                    </list>
+                </constructor-arg>
+            </bean>
+        </constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.PrincipalManagerEventAdapter" class="org.apache.jetspeed.security.PrincipalManagerEventAdapter">
+    </bean>  
+
+    <bean id="org.apache.jetspeed.security.UserManager" class="org.apache.jetspeed.security.jpa.UserManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.JetspeedPrincipalType.user"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.JetspeedPrincipalType.role"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.JetspeedPrincipalType.group"/>
+        <constructor-arg index="3" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="4" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="5" ref="org.apache.jetspeed.security.spi.UserPasswordCredentialManager"/>
+    </bean>
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject"><ref local="org.apache.jetspeed.security.UserManager"/></property>
+        <property name="targetMethod"><value>addListener</value></property>
+        <property name="arguments"><ref bean="org.apache.jetspeed.security.PrincipalManagerEventAdapter"/></property>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.GroupManager" class="org.apache.jetspeed.security.jpa.GroupManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.JetspeedPrincipalType.group"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.JetspeedPrincipalType.user"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.JetspeedPrincipalType.role"/>
+        <constructor-arg index="3" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="4" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject"><ref local="org.apache.jetspeed.security.GroupManager"/></property>
+        <property name="targetMethod"><value>addListener</value></property>
+        <property name="arguments"><ref bean="org.apache.jetspeed.security.PrincipalManagerEventAdapter"/></property>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.RoleManager" class="org.apache.jetspeed.security.jpa.RoleManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.JetspeedPrincipalType.role"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.JetspeedPrincipalType.user"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.JetspeedPrincipalType.group"/>
+        <constructor-arg index="3" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="4" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject"><ref local="org.apache.jetspeed.security.RoleManager"/></property>
+        <property name="targetMethod"><value>addListener</value></property>
+        <property name="arguments"><ref bean="org.apache.jetspeed.security.PrincipalManagerEventAdapter"/></property>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.PermissionManager" class="org.apache.jetspeed.security.jpa.PermissionManagerImpl">
+        <constructor-arg index="0">
+            <list>
+                <bean class="org.apache.jetspeed.security.spi.impl.FolderPermission$Factory"/>
+                <bean class="org.apache.jetspeed.security.spi.impl.FragmentPermission$Factory"/>
+                <bean class="org.apache.jetspeed.security.spi.impl.PagePermission$Factory"/>
+                <bean class="org.apache.jetspeed.security.spi.impl.PortletPermission$Factory"/>
+            </list>
+        </constructor-arg>
+        <constructor-arg index="1"><ref bean="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/></constructor-arg>
+        <constructor-arg index="2"><ref bean="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/></constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.RdbmsPolicy" class="org.apache.jetspeed.security.impl.RdbmsPolicy">
+        <constructor-arg><ref bean="org.apache.jetspeed.security.PermissionManager"/></constructor-arg>
+    </bean>
+    <bean id="org.apache.jetspeed.security.AuthorizationProvider" class="org.apache.jetspeed.security.impl.AuthorizationProviderImpl">
+        <constructor-arg index="0"><ref bean="org.apache.jetspeed.security.RdbmsPolicy"/></constructor-arg>
+        <constructor-arg index="1"><value>false</value></constructor-arg>
+    </bean>
+
+    <bean id="userIsMemberOfRoleAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsMemberOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.UserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.RoleManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="userIsMemberOfGroupAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsMemberOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.UserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="groupIsMemberOfRoleAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsMemberOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.RoleManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="roleIsARoleAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsAPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.RoleManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="roleIsPartOfRoleAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsPartOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.RoleManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="groupIsAGroupAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsAPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="groupIsPartOfGroupAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsPartOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="userSubjectRolesResolver" class="org.apache.jetspeed.security.spi.impl.UserSubjectPrincipalsResolverImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.UserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.JetspeedPrincipalType.role"/>
+        <constructor-arg index="2">
+            <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+                <property name="targetObject"><ref bean="userIsMemberOfRoleAssociationHandler"/></property>
+                <property name="targetMethod"><value>getAssociationType</value></property>
+            </bean>
+        </constructor-arg>
+        <constructor-arg index="3">
+            <list>
+                <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+                    <property name="targetObject"><ref bean="roleIsARoleAssociationHandler"/></property>
+                    <property name="targetMethod"><value>getAssociationType</value></property>
+                </bean>
+                <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+                    <property name="targetObject"><ref bean="roleIsPartOfRoleAssociationHandler"/></property>
+                    <property name="targetMethod"><value>getAssociationType</value></property>
+                </bean>
+            </list>
+        </constructor-arg>
+    </bean>
+    <bean id="userSubjectGroupsResolver" class="org.apache.jetspeed.security.spi.impl.UserSubjectPrincipalsResolverImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.UserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.JetspeedPrincipalType.group"/>
+        <constructor-arg index="2">
+            <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+                <property name="targetObject"><ref bean="userIsMemberOfGroupAssociationHandler"/></property>
+                <property name="targetMethod"><value>getAssociationType</value></property>
+            </bean>
+        </constructor-arg>
+        <constructor-arg index="3">
+            <list>
+                <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+                    <property name="targetObject"><ref bean="groupIsMemberOfRoleAssociationHandler"/></property>
+                    <property name="targetMethod"><value>getAssociationType</value></property>
+                </bean>
+                <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+                    <property name="targetObject"><ref bean="groupIsAGroupAssociationHandler"/></property>
+                    <property name="targetMethod"><value>getAssociationType</value></property>
+                </bean>
+                <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+                    <property name="targetObject"><ref bean="groupIsPartOfGroupAssociationHandler"/></property>
+                    <property name="targetMethod"><value>getAssociationType</value></property>
+                </bean>
+            </list>
+        </constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider" class="org.apache.jetspeed.security.impl.JetspeedPrincipalManagerProviderImpl">
+        <constructor-arg index="0">
+            <set>
+                <ref bean="org.apache.jetspeed.security.UserManager"/>
+                <ref bean="org.apache.jetspeed.security.GroupManager"/>
+                <ref bean="org.apache.jetspeed.security.RoleManager"/>
+            </set>
+        </constructor-arg>
+    </bean>
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetClass" value="org.apache.jetspeed.security.impl.TransientJetspeedPrincipal"/>
+        <property name="targetMethod" value="setJetspeedPrincipalManagerProvider"/>
+        <property name="arguments">
+            <list>
+                <ref bean="org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider"/>
+            </list>
+        </property>
+    </bean>
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetClass" value="org.apache.jetspeed.security.impl.BaseJetspeedPrincipalManager"/>
+        <property name="targetMethod" value="setJetspeedPrincipalManagerProvider"/>
+        <property name="arguments">
+            <list>
+                <ref bean="org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider"/>
+            </list>
+        </property>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.AuthenticationProvider" class="org.apache.jetspeed.security.impl.DefaultAuthenticationProvider">
+        <constructor-arg index="0"><value>DefaultAuthenticator</value></constructor-arg>
+        <constructor-arg index="1"><value>The default authenticator</value></constructor-arg>
+        <constructor-arg index="2"><value>login.conf</value></constructor-arg>
+        <constructor-arg index="3"><ref bean="org.apache.jetspeed.security.spi.UserPasswordCredentialManager"/></constructor-arg>
+    </bean>
+    <bean id="org.apache.jetspeed.security.LoginModuleProxy" class="org.apache.jetspeed.security.impl.LoginModuleProxyImpl">
+        <constructor-arg index="0"><ref bean="org.apache.jetspeed.security.AuthenticationProvider"/></constructor-arg>
+        <constructor-arg index="1"><ref bean="org.apache.jetspeed.security.UserManager"/></constructor-arg>
+        <constructor-arg index="2"><ref bean="org.apache.jetspeed.security.RoleManager"/></constructor-arg>
+        <constructor-arg index="3"><value>portal-user</value></constructor-arg>
+    </bean>
+
+    <!-- JPA security Manager Context -->
+    <bean id="securityManagerContext" class="org.apache.jetspeed.security.spi.jpa.SecurityManagerContext" scope="prototype" init-method="initialize" destroy-method="terminate">
+        <property name="securityManager" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+
+</beans>

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/log4j.properties?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/log4j.properties (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/log4j.properties Sun Feb  8 21:28:35 2009
@@ -0,0 +1,78 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# ------------------------------------------------------------------------
+#
+# Logging Configuration
+#
+# $Id: log4j.properties 731466 2009-01-05 06:04:13Z rwatler $
+#
+# ------------------------------------------------------------------------
+
+log4j.rootCategory = ERROR, errorlogging
+
+#log4j.category.openjpa.Tool = INFO, infologging
+#log4j.category.openjpa.Runtime = INFO, infologging
+#log4j.category.openjpa.Remote = WARN, infologging
+#log4j.category.openjpa.DataCache = WARN, infologging
+#log4j.category.openjpa.MetaData = WARN, infologging
+#log4j.category.openjpa.Enhance = WARN, infologging
+#log4j.category.openjpa.Query = WARN, infologging
+#log4j.category.openjpa.jdbc.SQL = WARN, infologging
+#log4j.category.openjpa.jdbc.JDBC = WARN, infologging
+#log4j.category.openjpa.jdbc.Schema = WARN, infologging
+
+log4j.category.org.springframework = DEBUG, infologging
+log4j.additivity.org.springframework = false
+
+log4j.category.openjpa.Tool = TRACE, infologging
+log4j.additivity.openjpa.Tool = false
+log4j.category.openjpa.Runtime = TRACE, infologging
+log4j.additivity.openjpa.Runtime = false
+log4j.category.openjpa.Remote = TRACE, infologging
+log4j.additivity.openjpa.Remote = false
+log4j.category.openjpa.DataCache = TRACE, infologging
+log4j.additivity.openjpa.DataCache = false
+log4j.category.openjpa.MetaData = TRACE, infologging
+log4j.additivity.openjpa.MetaData = false
+log4j.category.openjpa.Enhance = TRACE, infologging
+log4j.additivity.openjpa.Enhance = false
+log4j.category.openjpa.Query = TRACE, infologging
+log4j.additivity.openjpa.Query = false
+log4j.category.openjpa.jdbc.SQL = TRACE, infologging
+log4j.additivity.openjpa.jdbc.SQL = false
+#log4j.category.openjpa.jdbc.JDBC = TRACE, infologging
+log4j.category.openjpa.jdbc.JDBC = DEBUG, infologging
+log4j.additivity.openjpa.jdbc.JDBC = false
+log4j.category.openjpa.jdbc.Schema = TRACE, infologging
+log4j.additivity.openjpa.jdbc.Schema = false
+
+log4j.category.org.apache.jetspeed = DEBUG, infologging
+log4j.additivity.org.apache.jetspeed = false
+
+log4j.category.atomikos = DEBUG, infologging
+log4j.additivity.atomikos = false
+
+log4j.appender.errorlogging = org.apache.log4j.FileAppender
+log4j.appender.errorlogging.file = ${basedir}/target/surefire-reports/tests-error.log
+log4j.appender.errorlogging.layout = org.apache.log4j.PatternLayout
+log4j.appender.errorlogging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.errorlogging.append = false
+
+log4j.appender.infologging = org.apache.log4j.FileAppender
+log4j.appender.infologging.file = ${basedir}/target/surefire-reports/tests-info.log
+log4j.appender.infologging.layout = org.apache.log4j.PatternLayout
+log4j.appender.infologging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.infologging.append = false

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml?rev=742172&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml Sun Feb  8 21:28:35 2009
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <import resource="jpa-security.xml"/>
+
+    <!-- OpenJPA/Atomikos Configuration -->
+    <bean id="jpaSecurityProperties" class="org.apache.jetspeed.components.rdbms.jpa.OpenJPAConfigurationProperties">
+        <property name="jpaProperties">
+            <props>
+		        <prop key="openjpa.ConnectionFactoryMode">managed</prop>
+		        <prop key="openjpa.TransactionMode">managed</prop>
+		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
+            </props>
+        </property>
+    </bean>
+    <bean id="securityEntityManagerFactory" parent="abstractEntityManagerFactory">
+        <property name="persistenceUnitName" value="jetspeed-security"/>
+        <property name="jpaProperties" ref="jpaSecurityProperties"/>
+        <property name="jpaDialect">
+            <bean class="org.springframework.orm.jpa.vendor.OpenJpaDialect"/>
+        </property>
+    </bean>
+
+    <!-- OpenJPA Security Components -->
+    <bean id="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager" name="org.apache.jetspeed.security.spi.SecurityDomainStorageManager,org.apache.jetspeed.security.spi.SecurityDomainAccessManager" class="org.apache.jetspeed.security.spi.jpa.OpenJPAJetspeedSecurityPersistenceManager" init-method="initialize" destroy-method="terminate">
+    </bean>
+
+</beans>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/LoginModuleProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/LoginModuleProxy.java?rev=742172&r1=742171&r2=742172&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/LoginModuleProxy.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/LoginModuleProxy.java Sun Feb  8 21:28:35 2009
@@ -35,6 +35,12 @@
     AuthenticationProvider getAuthenticationProvider();
 
     /**
+     * <p>Getter for the {@link RoleManager}.</p>
+     * @return The RoleManager.
+     */
+    RoleManager getRoleManager();
+    
+    /**
      * <p>Getter for the {@link UserManager}.</p>
      * @return The UserManager.
      */

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/security-schema.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/security-schema.xml?rev=742172&r1=742171&r2=742172&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/security-schema.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/security-schema.xml Sun Feb  8 21:28:35 2009
@@ -56,6 +56,7 @@
         <foreign-key foreignTable="SECURITY_DOMAIN" name="FK_SECURITY_DOMAIN_1" onDelete="cascade">
             <reference foreign="DOMAIN_ID" local="DOMAIN_ID"/>
         </foreign-key>  
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
 
    <!-- 
@@ -77,8 +78,8 @@
     </index>
         <foreign-key foreignTable="SECURITY_PRINCIPAL" name="FK_PRINCIPAL_ATTR" onDelete="cascade">
             <reference foreign="PRINCIPAL_ID" local="PRINCIPAL_ID"/>
-        </foreign-key>        
-    
+        </foreign-key>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
 
     <!--
@@ -98,6 +99,7 @@
         <foreign-key foreignTable="SECURITY_PRINCIPAL" name="FK_TO_PRINCIPAL_ASSOC" onDelete="cascade">
             <reference foreign="PRINCIPAL_ID" local="TO_PRINCIPAL_ID"/>
         </foreign-key>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--
@@ -112,6 +114,7 @@
           <unique-column name="PERMISSION_TYPE" />
           <unique-column name="NAME" />
         </unique>        
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--
@@ -126,6 +129,7 @@
         <foreign-key foreignTable="SECURITY_PRINCIPAL" name="FK_PRINCIPAL_PERMISSION_2" onDelete="cascade">
             <reference foreign="PRINCIPAL_ID" local="PRINCIPAL_ID"/>
         </foreign-key>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
         
     <!--
@@ -151,6 +155,7 @@
         <foreign-key foreignTable="SECURITY_PRINCIPAL" name="FK_SECURITY_CREDENTIAL_1" onDelete="cascade">
             <reference foreign="PRINCIPAL_ID" local="PRINCIPAL_ID"/>
         </foreign-key>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
 	
 
@@ -178,6 +183,7 @@
         <unique name="UIX_SITE_URL">
           <unique-column name="URL" />
         </unique>                
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <table name="SECURITY_DOMAIN">
@@ -192,6 +198,7 @@
         <!--<foreign-key foreignTable="SECURITY_DOMAIN" name="FK_OWNER_DOMAIN_ID" onDelete="none">
             <reference foreign="DOMAIN_ID" local="OWNER_DOMAIN_ID"/>
         </foreign-key>-->
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
          

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-atn.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-atn.xml?rev=742172&r1=742171&r2=742172&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-atn.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-atn.xml Sun Feb  8 21:28:35 2009
@@ -31,8 +31,12 @@
     <constructor-arg index="1">
       <ref bean="org.apache.jetspeed.security.UserManager" />
     </constructor-arg>
-    <!-- Portal user role name used to identify authenticated users in web.xml security constraints -->
+    <!-- Role Manager to construct JAAS subject/principals -->
     <constructor-arg index="2">
+      <ref bean="org.apache.jetspeed.security.RoleManager" />
+    </constructor-arg>
+    <!-- Portal user role name used to identify authenticated users in web.xml security constraints -->
+    <constructor-arg index="3">
       <value>portal-user</value>
     </constructor-arg>
   </bean>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql?rev=742172&r1=742171&r2=742172&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql Sun Feb  8 21:28:35 2009
@@ -1270,6 +1270,7 @@
     IS_REMOVABLE SMALLINT NOT NULL,
     CREATION_DATE DATETIME NOT NULL,
     MODIFIED_DATE DATETIME NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (PRINCIPAL_ID)
 );
 
@@ -1285,6 +1286,7 @@
     PRINCIPAL_ID INT NOT NULL,
     ATTR_NAME VARCHAR(200) NOT NULL,
     ATTR_VALUE VARCHAR(1000),
+    JPA_VERSION INT,
     PRIMARY KEY (ATTR_ID, PRINCIPAL_ID, ATTR_NAME)
 );
 
@@ -1299,6 +1301,7 @@
     ASSOC_NAME VARCHAR(30) NOT NULL,
     FROM_PRINCIPAL_ID INT NOT NULL,
     TO_PRINCIPAL_ID INT NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (ASSOC_NAME, FROM_PRINCIPAL_ID, TO_PRINCIPAL_ID)
 );
 
@@ -1314,6 +1317,7 @@
     PERMISSION_TYPE VARCHAR(30) NOT NULL,
     NAME VARCHAR(254) NOT NULL,
     ACTIONS VARCHAR(254) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (PERMISSION_ID)
 );
 
@@ -1327,6 +1331,7 @@
 (
     PRINCIPAL_ID INT NOT NULL,
     PERMISSION_ID INT NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (PRINCIPAL_ID, PERMISSION_ID)
 );
 
@@ -1352,6 +1357,7 @@
     PREV_AUTH_DATE DATETIME,
     LAST_AUTH_DATE DATETIME,
     EXPIRATION_DATE DATETIME,
+    JPA_VERSION INT,
     PRIMARY KEY (CREDENTIAL_ID)
 );
 
@@ -1371,6 +1377,7 @@
     FORM_USER_FIELD VARCHAR(128),
     FORM_PWD_FIELD VARCHAR(128),
     REALM VARCHAR(128),
+    JPA_VERSION INT,
     PRIMARY KEY (SITE_ID)
 );
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org