From 4eb9192b70dcde3c3fa6cba6441fba227110e6b5 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Fri, 16 Nov 2007 21:03:06 +0000 Subject: [PATCH] open jpa support --- spring-webflow/.classpath | 10 ++++---- spring-webflow/ivy.xml | 18 ++++++++++++--- .../JpaFlowExecutionListenerTests.java | 23 +++---------------- 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/spring-webflow/.classpath b/spring-webflow/.classpath index 1dcebcc5..63e5ca1c 100644 --- a/spring-webflow/.classpath +++ b/spring-webflow/.classpath @@ -10,7 +10,6 @@ - @@ -21,12 +20,7 @@ - - - - - @@ -48,5 +42,9 @@ + + + + diff --git a/spring-webflow/ivy.xml b/spring-webflow/ivy.xml index bef2af5f..79be9514 100644 --- a/spring-webflow/ivy.xml +++ b/spring-webflow/ivy.xml @@ -69,9 +69,21 @@ - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowExecutionListenerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowExecutionListenerTests.java index 63e0b12d..589ff47b 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowExecutionListenerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowExecutionListenerTests.java @@ -8,13 +8,12 @@ import javax.sql.DataSource; import junit.framework.TestCase; -import org.hibernate.Hibernate; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.orm.jpa.JpaTemplate; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; -import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; +import org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter; import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.webflow.engine.EndState; import org.springframework.webflow.execution.FlowExecutionException; @@ -178,22 +177,6 @@ public class JpaFlowExecutionListenerTests extends TestCase { assertSessionNotBound(); } - public void testLazilyInitalizedCollection() { - MockRequestContext context = new MockRequestContext(); - MockFlowSession flowSession = new MockFlowSession(); - flowSession.getDefinitionInternal().getAttributeMap().put("persistenceContext", "true"); - jpaListener.sessionStarting(context, flowSession, null); - context.setActiveSession(flowSession); - assertSessionBound(); - - TestBean bean = (TestBean) jpaTemplate.getReference(TestBean.class, Long.valueOf(0)); - assertFalse("addresses should not be initialized", Hibernate.isInitialized(bean.getAddresses())); - jpaListener.paused(context); - assertFalse("addresses should not be initialized", Hibernate.isInitialized(bean.getAddresses())); - Hibernate.initialize(bean.getAddresses()); - assertTrue("addresses should be initialized", Hibernate.isInitialized(bean.getAddresses())); - } - private DataSource getDataSource() { DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName("org.hsqldb.jdbcDriver"); @@ -236,8 +219,8 @@ public class JpaFlowExecutionListenerTests extends TestCase { LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); factory.setDataSource(dataSource); factory.setPersistenceXmlLocation("classpath:org/springframework/webflow/persistence/persistence.xml"); - HibernateJpaVendorAdapter hibernate = new HibernateJpaVendorAdapter(); - factory.setJpaVendorAdapter(hibernate); + OpenJpaVendorAdapter openJpa = new OpenJpaVendorAdapter(); + factory.setJpaVendorAdapter(openJpa); factory.afterPropertiesSet(); return factory.getObject(); }