You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by tv...@apache.org on 2011/09/12 20:41:36 UTC
svn commit: r1169862 - in /turbine/fulcrum/trunk/security: api/src/changes/
hibernate/ hibernate/src/java/org/apache/fulcrum/security/hibernate/
hibernate/src/java/org/apache/fulcrum/security/hibernate/basic/
hibernate/src/java/org/apache/fulcrum/secur...
Author: tv
Date: Mon Sep 12 18:41:35 2011
New Revision: 1169862
URL: http://svn.apache.org/viewvc?rev=1169862&view=rev
Log:
Update fulcrum-hibernate to use a recent version of Hibernate (3.6.7-Final).
Removed dependencies on hibernate-avalon.
Modified:
turbine/fulcrum/trunk/security/api/src/changes/changes.xml
turbine/fulcrum/trunk/security/hibernate/pom.xml
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateGroupManagerImpl.java
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerImpl.java
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateRoleManagerImpl.java
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateUserManagerImpl.java
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelper.java
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImpl.java
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelperHibernateServiceImpl.java
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/basic/HibernateModelManagerImpl.java
turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/dynamic/HibernateModelManagerImpl.java
turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernate.hbm.xml
turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateComponentConfig.xml
turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateRoleConfig.xml
turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernate.hbm.xml
turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateComponentConfig.xml
turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateExtendedUserComponentConfig.xml
turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateRoleConfig.xml
turbine/fulcrum/trunk/security/hibernate/src/test/ExtendedUserHibernate.hbm.xml
turbine/fulcrum/trunk/security/hibernate/src/test/PersistenceHelperDefaultImplComponentConfig.xml
turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml
turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.xml
turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateComponentConfig.xml
turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateRoleConfig.xml
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateGroupManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateHelper.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateRoleManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateUserManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImplTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/PersistenceHelperTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateBasicModelManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateGroupManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateUserManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateDynamicModelManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateExtendedUserGroupManagerTest.java
turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/turbine/HibernateTurbineModelManagerTest.java
Modified: turbine/fulcrum/trunk/security/api/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/changes/changes.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/api/src/changes/changes.xml (original)
+++ turbine/fulcrum/trunk/security/api/src/changes/changes.xml Mon Sep 12 18:41:35 2011
@@ -25,6 +25,12 @@
<body>
<release version="1.1.0" date="">
+ <action type="update" dev="tv">
+ Update fulcrum-hibernate to use a recent version of Hibernate (3.6.7-Final).
+ </action>
+ <action type="update" dev="tv">
+ Move all builds to Maven2
+ </action>
<action type="update" dev="tv" issue="TRB-78" due-to="Ludwig Magnusson">
Move API build to Maven-2.
</action>
Modified: turbine/fulcrum/trunk/security/hibernate/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/pom.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/pom.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/pom.xml Mon Sep 12 18:41:35 2011
@@ -58,9 +58,11 @@
</testResources>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
<configuration>
- <forkMode>always</forkMode>
+ <forkMode>perTest</forkMode>
<includes>
<include>**/*Test.*</include>
<include>**/*TestCase.*</include>
@@ -69,20 +71,6 @@
</plugin>
</plugins>
</build>
- <repositories>
- <repository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>turbine</id>
- <name>Turbine Maven Repository</name>
- <url>http://turbine.apache.org/repo</url>
- <layout>legacy</layout>
- </repository>
- </repositories>
<dependencies>
<dependency>
<groupId>org.apache.fulcrum</groupId>
@@ -92,58 +80,21 @@
<!-- Needed for the Hibernate SPI -->
<dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.6.7.Final</version>
</dependency>
<dependency>
- <groupId>hibernate</groupId>
- <artifactId>hibernate</artifactId>
- <version>2.1.6</version>
- </dependency>
- <dependency>
- <groupId>ehcache</groupId>
- <artifactId>ehcache</artifactId>
- <version>1.2beta4</version>
- </dependency>
- <dependency>
- <groupId>hibernate</groupId>
- <artifactId>hibernate-avalon-api</artifactId>
- <version>0.4</version>
- </dependency>
- <dependency>
- <groupId>hibernate</groupId>
- <artifactId>hibernate-avalon-impl</artifactId>
- <version>0.4</version>
- </dependency>
- <dependency>
- <groupId>odmg</groupId>
- <artifactId>odmg</artifactId>
- <version>3.0</version>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.12.1.GA</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
- <version>2.0.1</version>
- </dependency>
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>1.4.1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- </dependency>
-
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>1.6.1</version>
- </dependency>
-
+ <version>2.2.2</version>
+ </dependency>
+
<dependency>
<groupId>org.apache.fulcrum</groupId>
<artifactId>fulcrum-security-api</artifactId>
@@ -181,6 +132,20 @@
<version>1.0.6</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.6.1</version>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
Modified: turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateGroupManagerImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateGroupManagerImpl.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateGroupManagerImpl.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateGroupManagerImpl.java Mon Sep 12 18:41:35 2011
@@ -19,14 +19,14 @@ package org.apache.fulcrum.security.hibe
*/
import java.util.List;
-import net.sf.hibernate.Hibernate;
-import net.sf.hibernate.HibernateException;
-
import org.apache.fulcrum.security.entity.Group;
import org.apache.fulcrum.security.spi.AbstractGroupManager;
import org.apache.fulcrum.security.util.DataBackendException;
+import org.apache.fulcrum.security.util.EntityExistsException;
import org.apache.fulcrum.security.util.GroupSet;
import org.apache.fulcrum.security.util.UnknownEntityException;
+import org.hibernate.Hibernate;
+import org.hibernate.HibernateException;
/**
* This implementation persists to a database via Hibernate.
*
Modified: turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerImpl.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerImpl.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerImpl.java Mon Sep 12 18:41:35 2011
@@ -19,14 +19,14 @@ package org.apache.fulcrum.security.hibe
*/
import java.util.List;
-import net.sf.hibernate.Hibernate;
-import net.sf.hibernate.HibernateException;
-
import org.apache.fulcrum.security.entity.Permission;
import org.apache.fulcrum.security.spi.AbstractPermissionManager;
import org.apache.fulcrum.security.util.DataBackendException;
+import org.apache.fulcrum.security.util.EntityExistsException;
import org.apache.fulcrum.security.util.PermissionSet;
import org.apache.fulcrum.security.util.UnknownEntityException;
+import org.hibernate.Hibernate;
+import org.hibernate.HibernateException;
/**
* This implementation persists to a database via Hibernate.
*
Modified: turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateRoleManagerImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateRoleManagerImpl.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateRoleManagerImpl.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateRoleManagerImpl.java Mon Sep 12 18:41:35 2011
@@ -19,16 +19,14 @@ package org.apache.fulcrum.security.hibe
*/
import java.util.List;
-import net.sf.hibernate.Hibernate;
-import net.sf.hibernate.HibernateException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.fulcrum.security.entity.Role;
import org.apache.fulcrum.security.spi.AbstractRoleManager;
import org.apache.fulcrum.security.util.DataBackendException;
+import org.apache.fulcrum.security.util.EntityExistsException;
import org.apache.fulcrum.security.util.RoleSet;
import org.apache.fulcrum.security.util.UnknownEntityException;
+import org.hibernate.Hibernate;
+import org.hibernate.HibernateException;
/**
*
* This implementation persists to a database via Hibernate.
@@ -38,13 +36,8 @@ import org.apache.fulcrum.security.util.
*/
public class HibernateRoleManagerImpl extends AbstractRoleManager
{
- /** Logging */
- private static Log log = LogFactory.getLog(HibernateRoleManagerImpl.class);
-
private PersistenceHelper persistenceHelper;
-
-
/**
* Renames an existing Role.
*
@@ -159,8 +152,6 @@ public class HibernateRoleManagerImpl ex
}
catch (Exception e)
{
- log.error("Failed to delete a Role");
- log.error(e);
throw new DataBackendException("removeRole(Role) failed", e);
}
}
@@ -168,7 +159,7 @@ public class HibernateRoleManagerImpl ex
/**
* @return Returns the persistenceHelper.
*/
- public PersistenceHelper getPersistenceHelper() throws DataBackendException
+ public PersistenceHelper getPersistenceHelper()
{
if (persistenceHelper == null)
{
Modified: turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateUserManagerImpl.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateUserManagerImpl.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/HibernateUserManagerImpl.java Mon Sep 12 18:41:35 2011
@@ -19,14 +19,14 @@ package org.apache.fulcrum.security.hibe
*/
import java.util.List;
-import net.sf.hibernate.Hibernate;
-import net.sf.hibernate.HibernateException;
-
import org.apache.fulcrum.security.entity.User;
import org.apache.fulcrum.security.spi.AbstractUserManager;
import org.apache.fulcrum.security.util.DataBackendException;
+import org.apache.fulcrum.security.util.EntityExistsException;
import org.apache.fulcrum.security.util.UnknownEntityException;
import org.apache.fulcrum.security.util.UserSet;
+import org.hibernate.Hibernate;
+import org.hibernate.HibernateException;
/**
* This implementation persists to a database via Hibernate.
*
Modified: turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelper.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelper.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelper.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelper.java Mon Sep 12 18:41:35 2011
@@ -18,11 +18,11 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-
import org.apache.fulcrum.security.entity.SecurityEntity;
import org.apache.fulcrum.security.util.DataBackendException;
+import org.hibernate.HibernateException;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.classic.Session;
/**
* @author Eric Pugh
@@ -32,14 +32,15 @@ import org.apache.fulcrum.security.util.
*/
public interface PersistenceHelper
{
- public static final String ROLE = PersistenceHelper.class.getName();
- public void removeEntity(SecurityEntity entity)throws DataBackendException;
+ String ROLE = PersistenceHelper.class.getName();
- public void updateEntity(SecurityEntity entity) throws DataBackendException;
+ void removeEntity(SecurityEntity entity)throws DataBackendException;
- public void addEntity(SecurityEntity entity) throws DataBackendException;
+ void updateEntity(SecurityEntity entity) throws DataBackendException;
- public Session retrieveSession() throws HibernateException;
+ void addEntity(SecurityEntity entity) throws DataBackendException;
+ Configuration getConfiguration();
+ Session retrieveSession() throws HibernateException;
}
Modified: turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImpl.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImpl.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImpl.java Mon Sep 12 18:41:35 2011
@@ -17,17 +17,19 @@ package org.apache.fulcrum.security.hibe
* specific language governing permissions and limitations
* under the License.
*/
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.SessionFactory;
-import net.sf.hibernate.Transaction;
-import net.sf.hibernate.cfg.Configuration;
-
-import org.apache.avalon.framework.component.Component;
+import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.activity.Initializable;
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.fulcrum.security.entity.SecurityEntity;
import org.apache.fulcrum.security.spi.AbstractManager;
import org.apache.fulcrum.security.util.DataBackendException;
import org.apache.fulcrum.security.util.UnknownEntityException;
+import org.hibernate.HibernateException;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.classic.Session;
/**
*
* This persistenceHelper expects you to either pass in a SessionFactory to use,
@@ -38,11 +40,11 @@ import org.apache.fulcrum.security.util.
*/
public class PersistenceHelperDefaultImpl
extends AbstractManager
- implements PersistenceHelper, Component
+ implements PersistenceHelper, Configurable, Initializable, Disposable
{
+ private Configuration configuration;
private SessionFactory sessionFactory;
private Session session;
- protected Transaction transaction;
/**
* Deletes an entity object
@@ -53,9 +55,11 @@ public class PersistenceHelperDefaultImp
*/
public void removeEntity(SecurityEntity entity) throws DataBackendException
{
+ Transaction transaction = null;
+
try
{
- session = retrieveSession();
+ Session session = retrieveSession();
transaction = session.beginTransaction();
session.delete(entity);
transaction.commit();
@@ -68,6 +72,7 @@ public class PersistenceHelperDefaultImp
}
catch (HibernateException hex)
{
+ // ignore
}
throw new DataBackendException(
"Problem removing entity:" + he.getMessage(),
@@ -83,15 +88,14 @@ public class PersistenceHelperDefaultImp
*/
public void updateEntity(SecurityEntity entity) throws DataBackendException
{
+ Transaction transaction = null;
+
try
{
-
- session = retrieveSession();
-
+ Session session = retrieveSession();
transaction = session.beginTransaction();
session.update(entity);
transaction.commit();
-
}
catch (HibernateException he)
{
@@ -118,6 +122,7 @@ public class PersistenceHelperDefaultImp
}
catch (HibernateException hex)
{
+ // ignore
}
}
@@ -132,9 +137,11 @@ public class PersistenceHelperDefaultImp
*/
public void addEntity(SecurityEntity entity) throws DataBackendException
{
+ Transaction transaction = null;
+
try
{
- session = retrieveSession();
+ Session session = retrieveSession();
transaction = session.beginTransaction();
session.save(entity);
transaction.commit();
@@ -147,6 +154,7 @@ public class PersistenceHelperDefaultImp
}
catch (HibernateException hex)
{
+ // ignore
}
throw new DataBackendException("addEntity(s,name)", he);
}
@@ -154,13 +162,6 @@ public class PersistenceHelperDefaultImp
}
/**
- * Allow an external session to be passed in.
- * @param session
- */
- public void setSession(Session session){
- this.session = session;
- }
- /**
* Returns a hibernate session, or if is null, opens one.
* @return An Open hibernate session.
* @throws HibernateException
@@ -175,6 +176,14 @@ public class PersistenceHelperDefaultImp
}
/**
+ * Return the hibernate configuration
+ */
+ public Configuration getConfiguration()
+ {
+ return configuration;
+ }
+
+ /**
* In some environments we will load the session factory up
* and pass it in.
*
@@ -191,13 +200,68 @@ public class PersistenceHelperDefaultImp
*/
public SessionFactory getSessionFactory() throws HibernateException
{
- if (sessionFactory == null)
+ return sessionFactory;
+ }
+
+ /** Avalon lifecycle method
+ * @see org.apache.avalon.framework.activity.Initializable#initialize()
+ */
+ public void initialize() throws Exception
+ {
+ sessionFactory = configuration.buildSessionFactory();
+ }
+
+ /** Avalon lifecycle method
+ * @see org.apache.fulcrum.security.spi.AbstractManager#dispose()
+ */
+ public void dispose()
+ {
+ sessionFactory.close();
+ super.dispose();
+ }
+
+ /** Avalon lifecycle method
+ * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
+ */
+ public void configure(org.apache.avalon.framework.configuration.Configuration conf) throws ConfigurationException
+ {
+ configuration = new Configuration();
+
+ // read properties
+ org.apache.avalon.framework.configuration.Configuration[] props =
+ conf.getChild("session-factory").getChildren("property");
+
+ for (int i = 0; i < props.length; i++)
{
- sessionFactory = new Configuration().buildSessionFactory();
+ String value = props[i].getValue(null);
+ String key = props[i].getAttribute("name", null);
+ if (key != null && value != null)
+ {
+ configuration.setProperty(key, value);
+ }
+ else
+ {
+ throw new ConfigurationException("Invalid configuration", props[i]);
+ }
}
- return sessionFactory;
- }
+ // read mappings
+ org.apache.avalon.framework.configuration.Configuration[] maps =
+ conf.getChild("mappings").getChildren("resource");
+ for (int i = 0; i < maps.length; i++)
+ {
+ String value = maps[i].getValue(null);
+
+ if (value != null)
+ {
+ configuration.addResource(value);
+ }
+ else
+ {
+ throw new ConfigurationException("Invalid configuration", maps[i]);
+ }
+ }
+ }
}
Modified: turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/basic/HibernateModelManagerImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/basic/HibernateModelManagerImpl.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/basic/HibernateModelManagerImpl.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/basic/HibernateModelManagerImpl.java Mon Sep 12 18:41:35 2011
@@ -17,9 +17,6 @@ package org.apache.fulcrum.security.hibe
* specific language governing permissions and limitations
* under the License.
*/
-import net.sf.hibernate.Session;
-import net.sf.hibernate.Transaction;
-
import org.apache.fulcrum.security.entity.Group;
import org.apache.fulcrum.security.entity.User;
import org.apache.fulcrum.security.hibernate.PersistenceHelper;
@@ -29,6 +26,8 @@ import org.apache.fulcrum.security.model
import org.apache.fulcrum.security.spi.AbstractManager;
import org.apache.fulcrum.security.util.DataBackendException;
import org.apache.fulcrum.security.util.UnknownEntityException;
+import org.hibernate.Transaction;
+import org.hibernate.classic.Session;
/**
* This implementation persists to a database via Hibernate.
*
Modified: turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/dynamic/HibernateModelManagerImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/dynamic/HibernateModelManagerImpl.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/dynamic/HibernateModelManagerImpl.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/java/org/apache/fulcrum/security/hibernate/dynamic/HibernateModelManagerImpl.java Mon Sep 12 18:41:35 2011
@@ -17,9 +17,6 @@ package org.apache.fulcrum.security.hibe
* specific language governing permissions and limitations
* under the License.
*/
-import net.sf.hibernate.Session;
-import net.sf.hibernate.Transaction;
-
import org.apache.fulcrum.security.entity.Group;
import org.apache.fulcrum.security.entity.Permission;
import org.apache.fulcrum.security.entity.Role;
@@ -33,6 +30,8 @@ import org.apache.fulcrum.security.model
import org.apache.fulcrum.security.model.dynamic.entity.DynamicUser;
import org.apache.fulcrum.security.util.DataBackendException;
import org.apache.fulcrum.security.util.UnknownEntityException;
+import org.hibernate.Transaction;
+import org.hibernate.classic.Session;
/**
* This implementation persists to a database via Hibernate.
*
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernate.hbm.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernate.hbm.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernate.hbm.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernate.hbm.xml Mon Sep 12 18:41:35 2011
@@ -18,8 +18,8 @@
under the License.
-->
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="true">
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateComponentConfig.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateComponentConfig.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateComponentConfig.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateComponentConfig.xml Mon Sep 12 18:41:35 2011
@@ -26,25 +26,25 @@
<userManager><className>org.apache.fulcrum.security.model.basic.entity.impl.BasicUserImpl</className></userManager>
<groupManager><className>org.apache.fulcrum.security.model.basic.entity.impl.BasicGroupImpl</className></groupManager>
- <persistenceHelper/>
- <hibernateService>
+ <persistenceHelper>
<parameter name="default.configuration" value="false"/>
<session-factory >
- <property name="show_sql">false</property>
- <property name="use_outer_join">auto</property>
+ <property name="hibernate.show_sql">false</property>
+ <property name="hibernate.use_outer_join">auto</property>
<!-- properties for this SessionFactory only -->
- <property name="hibernate.cglib.use_reflection_optimizer">false</property>
- <property name="connection.driver_class">com.mckoi.JDBCDriver</property>
- <property name="connection.username">test</property>
- <property name="connection.password">test</property>
- <property name="connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
- <property name="dialect">net.sf.hibernate.dialect.MckoiDialect</property>
+ <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
+ <property name="hibernate.connection.autocommit">true</property>
+ <property name="hibernate.connection.driver_class">com.mckoi.JDBCDriver</property>
+ <property name="hibernate.connection.username">test</property>
+ <property name="hibernate.connection.password">test</property>
+ <property name="hibernate.connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.MckoiDialect</property>
<!-- mapping files -->
</session-factory>
<mappings>
<resource>BasicHibernate.hbm.xml</resource>
</mappings>
- </hibernateService>
+ </persistenceHelper>
</my-system>
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateRoleConfig.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateRoleConfig.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateRoleConfig.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/BasicHibernateRoleConfig.xml Mon Sep 12 18:41:35 2011
@@ -48,11 +48,6 @@
<role
name="org.apache.fulcrum.security.hibernate.PersistenceHelper"
shorthand="persistenceHelper"
- default-class="org.apache.fulcrum.security.hibernate.PersistenceHelperHibernateServiceImpl"/>
-
- <role
- name="net.sf.hibernate.avalon.HibernateService"
- shorthand="hibernateService"
- default-class="net.sf.hibernate.avalon.HibernateServiceImpl"/>
+ default-class="org.apache.fulcrum.security.hibernate.PersistenceHelperDefaultImpl"/>
</role-list>
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernate.hbm.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernate.hbm.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernate.hbm.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernate.hbm.xml Mon Sep 12 18:41:35 2011
@@ -18,8 +18,8 @@
under the License.
-->
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="true">
<class name="org.apache.fulcrum.security.model.dynamic.entity.impl.DynamicPermissionImpl" table="PERMISSION" >
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateComponentConfig.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateComponentConfig.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateComponentConfig.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateComponentConfig.xml Mon Sep 12 18:41:35 2011
@@ -28,25 +28,25 @@
<roleManager><className>org.apache.fulcrum.security.model.dynamic.entity.impl.DynamicRoleImpl</className></roleManager>
<permissionManager><className>org.apache.fulcrum.security.model.dynamic.entity.impl.DynamicPermissionImpl</className></permissionManager>
- <persistenceHelper/>
- <hibernateService>
+ <persistenceHelper>
<parameter name="default.configuration" value="false"/>
<session-factory >
- <property name="show_sql">false</property>
- <property name="use_outer_join">auto</property>
+ <property name="hibernate.show_sql">false</property>
+ <property name="hibernate.use_outer_join">auto</property>
<!-- properties for this SessionFactory only -->
- <property name="hibernate.cglib.use_reflection_optimizer">false</property>
- <property name="connection.driver_class">com.mckoi.JDBCDriver</property>
- <property name="connection.username">test</property>
- <property name="connection.password">test</property>
- <property name="connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
- <property name="dialect">net.sf.hibernate.dialect.MckoiDialect</property>
+ <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
+ <property name="hibernate.connection.autocommit">true</property>
+ <property name="hibernate.connection.driver_class">com.mckoi.JDBCDriver</property>
+ <property name="hibernate.connection.username">test</property>
+ <property name="hibernate.connection.password">test</property>
+ <property name="hibernate.connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.MckoiDialect</property>
<!-- mapping files -->
</session-factory>
<mappings>
<resource>DynamicHibernate.hbm.xml</resource>
</mappings>
- </hibernateService>
+ </persistenceHelper>
</my-system>
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateExtendedUserComponentConfig.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateExtendedUserComponentConfig.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateExtendedUserComponentConfig.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateExtendedUserComponentConfig.xml Mon Sep 12 18:41:35 2011
@@ -28,25 +28,25 @@
<roleManager><className>org.apache.fulcrum.security.model.dynamic.entity.impl.DynamicRoleImpl</className></roleManager>
<permissionManager><className>org.apache.fulcrum.security.model.dynamic.entity.impl.DynamicPermissionImpl</className></permissionManager>
- <persistenceHelper/>
- <hibernateService>
+ <persistenceHelper>
<parameter name="default.configuration" value="false"/>
<session-factory >
- <property name="show_sql">false</property>
- <property name="use_outer_join">auto</property>
+ <property name="hibernate.show_sql">false</property>
+ <property name="hibernate.use_outer_join">auto</property>
<!-- properties for this SessionFactory only -->
- <property name="hibernate.cglib.use_reflection_optimizer">false</property>
- <property name="connection.driver_class">com.mckoi.JDBCDriver</property>
- <property name="connection.username">test</property>
- <property name="connection.password">test</property>
- <property name="connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
- <property name="dialect">net.sf.hibernate.dialect.MckoiDialect</property>
+ <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
+ <property name="hibernate.connection.autocommit">true</property>
+ <property name="hibernate.connection.driver_class">com.mckoi.JDBCDriver</property>
+ <property name="hibernate.connection.username">test</property>
+ <property name="hibernate.connection.password">test</property>
+ <property name="hibernate.connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.MckoiDialect</property>
<!-- mapping files -->
</session-factory>
<mappings>
<resource>ExtendedUserHibernate.hbm.xml</resource>
</mappings>
- </hibernateService>
+ </persistenceHelper>
</my-system>
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateRoleConfig.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateRoleConfig.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateRoleConfig.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/DynamicHibernateRoleConfig.xml Mon Sep 12 18:41:35 2011
@@ -56,11 +56,6 @@
<role
name="org.apache.fulcrum.security.hibernate.PersistenceHelper"
shorthand="persistenceHelper"
- default-class="org.apache.fulcrum.security.hibernate.PersistenceHelperHibernateServiceImpl"/>
-
- <role
- name="net.sf.hibernate.avalon.HibernateService"
- shorthand="hibernateService"
- default-class="net.sf.hibernate.avalon.HibernateServiceImpl"/>
+ default-class="org.apache.fulcrum.security.hibernate.PersistenceHelperDefaultImpl"/>
</role-list>
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/ExtendedUserHibernate.hbm.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/ExtendedUserHibernate.hbm.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/ExtendedUserHibernate.hbm.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/ExtendedUserHibernate.hbm.xml Mon Sep 12 18:41:35 2011
@@ -18,8 +18,8 @@
under the License.
-->
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="true">
<class name="org.apache.fulcrum.security.model.dynamic.entity.impl.DynamicPermissionImpl" table="PERMISSION" >
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/PersistenceHelperDefaultImplComponentConfig.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/PersistenceHelperDefaultImplComponentConfig.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/PersistenceHelperDefaultImplComponentConfig.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/PersistenceHelperDefaultImplComponentConfig.xml Mon Sep 12 18:41:35 2011
@@ -28,25 +28,25 @@
<roleManager><className>org.apache.fulcrum.security.model.dynamic.entity.impl.DynamicRoleImpl</className></roleManager>
<permissionManager><className>org.apache.fulcrum.security.model.dynamic.entity.impl.DynamicPermissionImpl</className></permissionManager>
- <persistenceHelper/>
- <hibernateService>
+ <persistenceHelper>
<parameter name="default.configuration" value="false"/>
<session-factory >
- <property name="show_sql">false</property>
- <property name="use_outer_join">auto</property>
+ <property name="hibernate.show_sql">false</property>
+ <property name="hibernate.use_outer_join">auto</property>
<!-- properties for this SessionFactory only -->
- <property name="hibernate.cglib.use_reflection_optimizer">false</property>
- <property name="connection.driver_class">com.mckoi.JDBCDriver</property>
- <property name="connection.username">test</property>
- <property name="connection.password">test</property>
- <property name="connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
- <property name="dialect">net.sf.hibernate.dialect.MckoiDialect</property>
+ <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
+ <property name="hibernate.connection.autocommit">true</property>
+ <property name="hibernate.connection.driver_class">com.mckoi.JDBCDriver</property>
+ <property name="hibernate.connection.username">test</property>
+ <property name="hibernate.connection.password">test</property>
+ <property name="hibernate.connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.MckoiDialect</property>
<!-- mapping files -->
</session-factory>
<mappings>
<resource>DynamicHibernate.hbm.xml</resource>
</mappings>
- </hibernateService>
+ </persistenceHelper>
</my-system>
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml Mon Sep 12 18:41:35 2011
@@ -18,8 +18,8 @@
under the License.
-->
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="true">
<class name="org.apache.fulcrum.security.model.turbine.entity.impl.TurbinePermissionImpl" table="PERMISSION" >
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.xml Mon Sep 12 18:41:35 2011
@@ -48,35 +48,31 @@
<component
role="org.apache.fulcrum.security.hibernate.PersistenceHelper"
- class="org.apache.fulcrum.security.hibernate.PersistenceHelperHibernateServiceImpl">
+ class="org.apache.fulcrum.security.hibernate.PersistenceHelperDefaultImpl">
+ <session-factory >
+ <property name="hibernate.show_sql">false</property>
+ <property name="hibernate.use_outer_join">auto</property>
+
+ <!-- properties for this SessionFactory only -->
+ <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
+ <property name="hibernate.connection.autocommit">true</property>
+ <property name="hibernate.connection.driver_class">com.mckoi.JDBCDriver</property>
+ <property name="hibernate.connection.username">test</property>
+ <property name="hibernate.connection.password">test</property>
+ <property name="hibernate.connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.MckoiDialect</property>
+
+ </session-factory>
+ <!-- mapping files -->
+ <mappings>
+ <resource>TurbineHibernate.hbm.xml</resource>
+ </mappings>
</component>
<component
role="org.apache.fulcrum.security.ModelManager"
class="org.apache.fulcrum.security.hibernate.turbine.HibernateModelManagerImpl">
</component>
- <component
- role="net.sf.hibernate.avalon.HibernateService"
- class="net.sf.hibernate.avalon.HibernateServiceImpl">
- <parameter name="default.configuration" value="false"/>
- <session-factory >
- <property name="show_sql">false</property>
- <property name="use_outer_join">auto</property>
-
- <!-- properties for this SessionFactory only -->
- <property name="hibernate.cglib.use_reflection_optimizer">false</property>
- <property name="connection.driver_class">com.mckoi.JDBCDriver</property>
- <property name="connection.username">test</property>
- <property name="connection.password">test</property>
- <property name="connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
- <property name="dialect">net.sf.hibernate.dialect.MckoiDialect</property>
-
- <!-- mapping files -->
- </session-factory>
- <mappings>
- <resource>TurbineHibernate.hbm.xml</resource>
- </mappings>
- </component>
<component
role="org.apache.fulcrum.security.authenticator.Authenticator"
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateComponentConfig.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateComponentConfig.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateComponentConfig.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateComponentConfig.xml Mon Sep 12 18:41:35 2011
@@ -28,25 +28,25 @@
<roleManager><className>org.apache.fulcrum.security.model.turbine.entity.impl.TurbineRoleImpl</className></roleManager>
<permissionManager><className>org.apache.fulcrum.security.model.turbine.entity.impl.TurbinePermissionImpl</className></permissionManager>
- <persistenceHelper/>
- <hibernateService>
+ <persistenceHelper>
<parameter name="default.configuration" value="false"/>
<session-factory >
- <property name="show_sql">false</property>
- <property name="use_outer_join">auto</property>
+ <property name="hibernate.show_sql">false</property>
+ <property name="hibernate.use_outer_join">auto</property>
<!-- properties for this SessionFactory only -->
- <property name="hibernate.cglib.use_reflection_optimizer">false</property>
- <property name="connection.driver_class">com.mckoi.JDBCDriver</property>
- <property name="connection.username">test</property>
- <property name="connection.password">test</property>
- <property name="connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
- <property name="dialect">net.sf.hibernate.dialect.MckoiDialect</property>
+ <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
+ <property name="hibernate.connection.autocommit">true</property>
+ <property name="hibernate.connection.driver_class">com.mckoi.JDBCDriver</property>
+ <property name="hibernate.connection.username">test</property>
+ <property name="hibernate.connection.password">test</property>
+ <property name="hibernate.connection.url">jdbc:mckoi:local://./src/test/mcKoi.conf?create=true</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.MckoiDialect</property>
<!-- mapping files -->
</session-factory>
<mappings>
<resource>TurbineHibernate.hbm.xml</resource>
</mappings>
- </hibernateService>
+ </persistenceHelper>
</my-system>
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateRoleConfig.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateRoleConfig.xml?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateRoleConfig.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernateRoleConfig.xml Mon Sep 12 18:41:35 2011
@@ -56,11 +56,6 @@
<role
name="org.apache.fulcrum.security.hibernate.PersistenceHelper"
shorthand="persistenceHelper"
- default-class="org.apache.fulcrum.security.hibernate.PersistenceHelperHibernateServiceImpl"/>
-
- <role
- name="net.sf.hibernate.avalon.HibernateService"
- shorthand="hibernateService"
- default-class="net.sf.hibernate.avalon.HibernateServiceImpl"/>
+ default-class="org.apache.fulcrum.security.hibernate.PersistenceHelperDefaultImpl"/>
</role-list>
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateGroupManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateGroupManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateGroupManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateGroupManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,8 +18,6 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
-
import org.apache.fulcrum.security.SecurityService;
import org.apache.fulcrum.security.model.test.AbstractGroupManagerTest;
/**
@@ -34,8 +32,8 @@ public class HibernateGroupManagerTest e
{
this.setRoleFileName("src/test/DynamicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/DynamicHibernateComponentConfig.xml");
- HibernateService hibernateService = (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
groupManager = securityService.getGroupManager();
}
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateHelper.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateHelper.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateHelper.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateHelper.java Mon Sep 12 18:41:35 2011
@@ -18,9 +18,8 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.SessionFactory;
-import net.sf.hibernate.cfg.Configuration;
-import net.sf.hibernate.tool.hbm2ddl.SchemaExport;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.tool.hbm2ddl.SchemaExport;
/**
* @author Eric Pugh
*
@@ -28,19 +27,8 @@ import net.sf.hibernate.tool.hbm2ddl.Sch
*/
public class HibernateHelper
{
- private static SessionFactory sessions;
- /**
- * @return
- */
- public static SessionFactory getSessions()
- {
- return sessions;
- }
-
public static void exportSchema(Configuration cfg) throws Exception
{
-
new SchemaExport(cfg).create(true, true);
- sessions = cfg.buildSessionFactory();
}
}
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernatePermissionManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,7 +18,6 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
import org.apache.fulcrum.security.SecurityService;
import org.apache.fulcrum.security.model.test.AbstractPermissionManagerTest;
/**
@@ -32,23 +31,24 @@ public class HibernatePermissionManagerT
this.setRoleFileName("src/test/DynamicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/DynamicHibernateComponentConfig.xml");
- HibernateService hibernateService = (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
- securityService = (SecurityService) lookup(SecurityService.ROLE);
- permissionManager = securityService.getPermissionManager();
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
+ securityService = (SecurityService) lookup(SecurityService.ROLE);
+ permissionManager = securityService.getPermissionManager();
}
+
public void tearDown()
{
-
permission = null;
permissionManager = null;
securityService = null;
}
+
/**
- * Constructor for HibernatePermissionManagerTest.
- * @param arg0
- */
+ * Constructor for HibernatePermissionManagerTest.
+ * @param arg0
+ */
public HibernatePermissionManagerTest(String arg0)
{
super(arg0);
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateRoleManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateRoleManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateRoleManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateRoleManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,9 +18,6 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
-
-import org.apache.fulcrum.security.RoleManager;
import org.apache.fulcrum.security.SecurityService;
import org.apache.fulcrum.security.model.test.AbstractRoleManagerTest;
/**
@@ -35,16 +32,17 @@ public class HibernateRoleManagerTest ex
{
this.setRoleFileName("src/test/DynamicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/DynamicHibernateComponentConfig.xml");
- HibernateService hibernateService = (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
- roleManager = (RoleManager) securityService.getRoleManager();
+ roleManager = securityService.getRoleManager();
}
catch (Exception e)
{
fail(e.toString());
}
}
+
public void tearDown()
{
try
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateUserManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateUserManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateUserManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/HibernateUserManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,8 +18,6 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
-
import org.apache.fulcrum.security.SecurityService;
import org.apache.fulcrum.security.model.test.AbstractUserManagerTest;
/**
@@ -34,8 +32,8 @@ public class HibernateUserManagerTest ex
{
this.setRoleFileName("src/test/DynamicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/DynamicHibernateComponentConfig.xml");
- HibernateService hibernateService = (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
userManager = securityService.getUserManager();
}
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImplTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImplTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImplTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImplTest.java Mon Sep 12 18:41:35 2011
@@ -18,10 +18,9 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.Session;
-
import org.apache.fulcrum.security.SecurityService;
import org.apache.fulcrum.testcontainer.BaseUnitTest;
+import org.hibernate.classic.Session;
/**
* @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
* @version $Id$
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateBasicModelManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateBasicModelManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateBasicModelManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateBasicModelManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,16 +18,14 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.Transaction;
-import net.sf.hibernate.avalon.HibernateService;
-
import org.apache.fulcrum.security.SecurityService;
-
import org.apache.fulcrum.security.entity.User;
import org.apache.fulcrum.security.hibernate.HibernateHelper;
import org.apache.fulcrum.security.hibernate.HibernateUserManagerImpl;
+import org.apache.fulcrum.security.hibernate.PersistenceHelper;
import org.apache.fulcrum.security.model.basic.entity.BasicUser;
import org.apache.fulcrum.security.model.basic.test.AbstractModelManagerTest;
+import org.hibernate.Transaction;
/**
* @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
* @version $Id$
@@ -36,25 +34,23 @@ public class HibernateBasicModelManagerT
{
public void setUp() throws Exception
{
-
this.setRoleFileName("src/test/BasicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/BasicHibernateComponentConfig.xml");
- HibernateService hibernateService =
- (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
super.setUp();
-
}
- public void testRevokeAllUser() throws Exception{
+ public void testRevokeAllUser() throws Exception
+ {
super.testRevokeAllUser();
- ((HibernateUserManagerImpl)userManager).getPersistenceHelper().retrieveSession().close();
+ // FIXME: Why is this here?
+ // ((HibernateUserManagerImpl)userManager).getPersistenceHelper().retrieveSession().close();
Transaction tx = ((HibernateUserManagerImpl)userManager).getPersistenceHelper().retrieveSession().beginTransaction();
User user = userManager.getUserInstance("Clint2");
assertEquals(0, ((BasicUser) user).getGroups().size());
tx.commit();
-
}
public void tearDown()
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateGroupManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateGroupManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateGroupManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateGroupManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,10 +18,9 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
-
import org.apache.fulcrum.security.SecurityService;
import org.apache.fulcrum.security.hibernate.HibernateHelper;
+import org.apache.fulcrum.security.hibernate.PersistenceHelper;
import org.apache.fulcrum.security.model.test.AbstractGroupManagerTest;
/**
* @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
@@ -35,8 +34,8 @@ public class HibernateGroupManagerTest e
{
this.setRoleFileName("src/test/BasicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/BasicHibernateComponentConfig.xml");
- HibernateService hibernateService = (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
groupManager = securityService.getGroupManager();
}
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateUserManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateUserManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateUserManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/basic/HibernateUserManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,10 +18,9 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
-
import org.apache.fulcrum.security.SecurityService;
import org.apache.fulcrum.security.hibernate.HibernateHelper;
+import org.apache.fulcrum.security.hibernate.PersistenceHelper;
import org.apache.fulcrum.security.model.test.AbstractUserManagerTest;
/**
* @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
@@ -35,8 +34,8 @@ public class HibernateUserManagerTest ex
{
this.setRoleFileName("src/test/BasicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/BasicHibernateComponentConfig.xml");
- HibernateService hibernateService = (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
userManager = securityService.getUserManager();
}
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateDynamicModelManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateDynamicModelManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateDynamicModelManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateDynamicModelManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,18 +18,10 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
-
import org.apache.fulcrum.security.SecurityService;
-import org
- .apache
- .fulcrum
- .security
- .model
- .dynamic
- .test
- .AbstractDynamicModelManagerTest;
import org.apache.fulcrum.security.hibernate.HibernateHelper;
+import org.apache.fulcrum.security.hibernate.PersistenceHelper;
+import org.apache.fulcrum.security.model.dynamic.test.AbstractDynamicModelManagerTest;
/**
* @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
@@ -44,18 +36,17 @@ public class HibernateDynamicModelManage
{
this.setRoleFileName("src/test/DynamicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/DynamicHibernateComponentConfig.xml");
- HibernateService hibernateService =
- (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
super.setUp();
-
}
catch (Exception e)
{
fail(e.toString());
}
}
+
public void tearDown()
{
try
@@ -69,6 +60,7 @@ public class HibernateDynamicModelManage
securityService = null;
}
+
/**
* Constructor for HibernatePermissionManagerTest.
*
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateExtendedUserGroupManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateExtendedUserGroupManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateExtendedUserGroupManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/dynamic/HibernateExtendedUserGroupManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,11 +18,10 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
-
import org.apache.fulcrum.security.SecurityService;
-import org.apache.fulcrum.security.model.test.AbstractGroupManagerTest;
import org.apache.fulcrum.security.hibernate.HibernateHelper;
+import org.apache.fulcrum.security.hibernate.PersistenceHelper;
+import org.apache.fulcrum.security.model.test.AbstractGroupManagerTest;
/**
* @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
* @version $Id$
@@ -35,8 +34,8 @@ public class HibernateExtendedUserGroupM
{
this.setRoleFileName("src/test/DynamicHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/DynamicHibernateExtendedUserComponentConfig.xml");
- HibernateService hibernateService = (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
groupManager = securityService.getGroupManager();
}
Modified: turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/turbine/HibernateTurbineModelManagerTest.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/turbine/HibernateTurbineModelManagerTest.java?rev=1169862&r1=1169861&r2=1169862&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/turbine/HibernateTurbineModelManagerTest.java (original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/org/apache/fulcrum/security/hibernate/turbine/HibernateTurbineModelManagerTest.java Mon Sep 12 18:41:35 2011
@@ -18,18 +18,10 @@ package org.apache.fulcrum.security.hibe
* under the License.
*/
-import net.sf.hibernate.avalon.HibernateService;
-
import org.apache.fulcrum.security.SecurityService;
import org.apache.fulcrum.security.hibernate.HibernateHelper;
-import org
- .apache
- .fulcrum
- .security
- .model
- .turbine
- .test
- .AbstractTurbineModelManagerTest;
+import org.apache.fulcrum.security.hibernate.PersistenceHelper;
+import org.apache.fulcrum.security.model.turbine.test.AbstractTurbineModelManagerTest;
/**
* @author Eric Pugh
@@ -47,18 +39,15 @@ public class HibernateTurbineModelManage
{
this.setRoleFileName("src/test/TurbineHibernateRoleConfig.xml");
this.setConfigurationFileName("src/test/TurbineHibernateComponentConfig.xml");
- HibernateService hibernateService =
- (HibernateService) lookup(HibernateService.ROLE);
- HibernateHelper.exportSchema(hibernateService.getConfiguration());
+ PersistenceHelper helper = (PersistenceHelper) lookup(PersistenceHelper.ROLE);
+ HibernateHelper.exportSchema(helper.getConfiguration());
securityService = (SecurityService) lookup(SecurityService.ROLE);
super.setUp();
-
}
catch (Exception e)
{
fail(e.toString());
}
-
}
public void tearDown()
{