You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2017/05/21 21:47:04 UTC

[19/40] archiva-redback-core git commit: Add jpa config to test spring contexts

Add jpa config to test spring contexts


Project: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/commit/45b429e7
Tree: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/tree/45b429e7
Diff: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/diff/45b429e7

Branch: refs/heads/master
Commit: 45b429e7788d4eeabd76ed9d366de0763a74a2d7
Parents: 994c7cb
Author: Martin Stockhammer <ma...@apache.org>
Authored: Tue Oct 25 15:52:26 2016 +0200
Committer: Martin Stockhammer <ma...@apache.org>
Committed: Tue Oct 25 15:52:26 2016 +0200

----------------------------------------------------------------------
 .../src/test/resources/spring-context.xml       | 30 ++++++++++++++--
 .../src/test/resources/spring-context.xml       | 37 ++++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 35 ++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 36 +++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 36 +++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 35 ++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 36 +++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 34 ++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 34 ++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 35 ++++++++++++++++--
 .../src/test/resources/spring-context.xml       | 30 ++++++++++++++--
 .../src/test/resources/spring-context.xml       | 30 ++++++++++++++--
 12 files changed, 384 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-authentication/redback-authentication-providers/redback-authentication-users/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-authentication/redback-authentication-providers/redback-authentication-users/src/test/resources/spring-context.xml b/redback-authentication/redback-authentication-providers/redback-authentication-users/src/test/resources/spring-context.xml
index 0638e2a..87b428c 100644
--- a/redback-authentication/redback-authentication-providers/redback-authentication-users/src/test/resources/spring-context.xml
+++ b/redback-authentication/redback-authentication-providers/redback-authentication-users/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd"
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="true">
 
   <bean name="authenticator#user-manager" class="org.apache.archiva.redback.authentication.users.UserManagerAuthenticator">
@@ -35,4 +35,30 @@
 
   <alias name="userManager#configurable" alias="userManager#default"/>
 
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml b/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml
index ce2a5e1..8d84682 100644
--- a/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml
+++ b/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd"
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="true">
 
   <bean name="userManager#cached" class="org.apache.archiva.redback.users.cached.CachedUserManager">
@@ -46,4 +46,37 @@
   <alias name="userConfiguration#redback" alias="userConfiguration#default"/>
 
   <alias name="userManager#configurable" alias="userManager#default"/>
+
+  <!--
+  *** jpa init ***
+  Needed because of the dependency redback-user-cache -> redback-user-jpa
+  ***
+-->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
+
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-data-management/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-data-management/src/test/resources/spring-context.xml b/redback-data-management/src/test/resources/spring-context.xml
index b6fb123..54b5521 100644
--- a/redback-data-management/src/test/resources/spring-context.xml
+++ b/redback-data-management/src/test/resources/spring-context.xml
@@ -20,11 +20,11 @@
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
   <context:property-placeholder system-properties-mode="OVERRIDE"/>
 
@@ -49,4 +49,35 @@
 
   <alias name="userConfiguration#redback" alias="userConfiguration#default"/>
 
+  <!--
+*** jpa init ***
+Needed because of the dependency redback-user-cache -> redback-user-jpa
+***
+-->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml b/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml
index fc4f0ad..099a82d 100644
--- a/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml
+++ b/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml
@@ -20,11 +20,11 @@
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
   <context:property-placeholder system-properties-mode="OVERRIDE"/>
 
@@ -57,4 +57,36 @@
 
   <alias name="userConfiguration#redback" alias="userConfiguration#default"/>
 
+  <!--
+    *** jpa init ***
+        Needed because of the dependency redback-user-cache -> redback-user-jpa
+    ***
+  -->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
+
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-integrations/redback-rest/redback-rest-services/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/resources/spring-context.xml b/redback-integrations/redback-rest/redback-rest-services/src/test/resources/spring-context.xml
index 1aae21a..a790bf1 100644
--- a/redback-integrations/redback-rest/redback-rest-services/src/test/resources/spring-context.xml
+++ b/redback-integrations/redback-rest/redback-rest-services/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd">
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration"
       init-method="initialize">
@@ -46,4 +46,36 @@
 
   <alias name="userManager#configurable" alias="userManager#default"/>
 
+  <!--
+  *** jpa init ***
+      Needed because of the dependency redback-user-cache -> redback-user-jpa
+  ***
+  -->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
+
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
index 83f1084..71c14e2 100755
--- a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd"
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="false">
 
   <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
@@ -80,5 +80,36 @@
     <property name="timeToLiveSeconds" value="600"/>
   </bean>
 
+  <!--
+  *** jpa init ***
+  Needed because of the dependency redback-user-cache -> redback-user-jpa
+  ***
+-->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
 
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/test/resources/spring-context.xml
index c7b54f0..34e8738 100644
--- a/redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-jdo/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd">
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
   <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
     <property name="driverName" value="org.hsqldb.jdbcDriver"/>
@@ -41,6 +41,38 @@
     </property>
   </bean>
 
+  <!--
+    *** jpa init ***
+    Needed because of the dependency redback-user-cache -> redback-user-jpa
+    ***
+  -->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
+
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="registry" ref="test-conf"/>
   </bean>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml
index 1018308..beae9e0 100755
--- a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml
@@ -20,11 +20,11 @@
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="false">
 
   <context:property-placeholder system-properties-mode="OVERRIDE"/>
@@ -123,5 +123,35 @@
     <property name="timeToLiveSeconds" value="600"/>
   </bean>
 
+  <!--
+  *** jpa init ***
+  Needed because of the dependency redback-user-cache -> redback-user-jpa
+  ***
+-->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
 
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml
index 3359284..cec014e 100755
--- a/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd">
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
   <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
     <property name="driverName" value="org.hsqldb.jdbcDriver"/>
@@ -47,6 +47,36 @@
   <alias name="commons-configuration" alias="test-conf"/>
 
 
+  <!--
+    *** jpa init ***
+    Needed because of the dependency redback-user-cache -> redback-user-jpa
+    ***
+  -->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
 
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
 
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml
index 53d5343..9ba16d9 100755
--- a/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd"
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="false">
 
 
@@ -72,4 +72,35 @@
   <alias name="templateProcessor#memory" alias="roleTemplateProcessor"/>
   -->
 
+  <!--
+*** jpa init ***
+Needed because of the dependency redback-user-cache -> redback-user-jpa
+***
+-->
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+  <!-- ****  jpa init *** -->
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-system/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-system/src/test/resources/spring-context.xml b/redback-system/src/test/resources/spring-context.xml
index 3cb2eef..2b4f86e 100644
--- a/redback-system/src/test/resources/spring-context.xml
+++ b/redback-system/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd">
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
   <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
     <property name="driverName" value="org.hsqldb.jdbcDriver"/>
@@ -36,6 +36,32 @@
     </property>
   </bean>
 
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="registry" ref="test-conf"/>
   </bean>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/45b429e7/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml b/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml
index 5ad17ae..57a2c08 100644
--- a/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml
+++ b/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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-3.0.xsd"
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="true">
 
   <bean name="userManager#cached" class="org.apache.archiva.redback.users.cached.CachedUserManager">
@@ -46,4 +46,30 @@
 
   <alias name="userManager#configurable" alias="userManager#default"/>
 
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+
 </beans>
\ No newline at end of file