myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r513315 - in /myfaces/fusion/trunk: core/src/main/java/org/apache/myfaces/fusion/conversation/ core/src/main/java/org/apache/myfaces/fusion/conversation/spring/ core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/ core/src/test/ja...
Date Thu, 01 Mar 2007 13:45:42 GMT
Author: imario
Date: Thu Mar  1 05:45:41 2007
New Revision: 513315

URL: http://svn.apache.org/viewvc?view=rev&rev=513315
Log:
added testcase for conversation with persistence

Added:
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java
  (contents, props changed)
      - copied, changed from r513248, myfaces/fusion/trunk/core/src/test/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java
    myfaces/fusion/trunk/core15/src/test/java/META-INF/
    myfaces/fusion/trunk/core15/src/test/java/META-INF/persistence.xml   (with props)
    myfaces/fusion/trunk/core15/src/test/java/org/
    myfaces/fusion/trunk/core15/src/test/java/org/apache/
    myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/
    myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/
    myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/
    myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/PersistentConversation.java
  (with props)
    myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/TestConversationPersistence.java
  (with props)
    myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/
    myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/UserData.java
  (with props)
    myfaces/fusion/trunk/core15/src/test/java/testApplicationContext.xml
      - copied, changed from r513248, myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml
Modified:
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java
    myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml
    myfaces/fusion/trunk/core15/pom.xml
    myfaces/fusion/trunk/examples/pom.xml
    myfaces/fusion/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java?view=diff&rev=513315&r1=513314&r2=513315
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java
(original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java
Thu Mar  1 05:45:41 2007
@@ -46,9 +46,9 @@
 	{
 		String name = conversation.getName();
 
-		Conversation newConversation = conversation.invalidateAndRestart();
+		conversation.invalidateAndRestart();
 
-		return newConversation.getAttribute(name);
+		return FrameworkAdapter.getInstance().getApplicationContext().getBean(name);
 	}
 
 	/**

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java?view=diff&rev=513315&r1=513314&r2=513315
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java
(original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java
Thu Mar  1 05:45:41 2007
@@ -126,6 +126,8 @@
 				// create the bean (if not already done)
 				Object value = objectFactory.getObject();
 
+				System.err.println(">>>>>>>>>>> CREATED BEAN: " + value);
+
 				ProxyFactory factory = new ProxyFactory(value);
 				factory.setProxyTargetClass(true);
 				factory.addAdvice(new CurrentConversationAdvice(conversation));

Copied: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java
(from r513248, myfaces/fusion/trunk/core/src/test/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java)
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java?view=diff&rev=513315&p1=myfaces/fusion/trunk/core/src/test/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java&r1=513248&p2=myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java&r2=513315
==============================================================================
    (empty)

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/MockFrameworkAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml?view=diff&rev=513315&r1=513314&r2=513315
==============================================================================
--- myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml (original)
+++ myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml Thu Mar  1 05:45:41
2007
@@ -38,6 +38,9 @@
 		</property>
 	</bean>
 
+
+	<!-- our beans -->
+
 	<bean
 		name="dummyConversation"
 		class="org.apache.myfaces.fusion.conversation.DummyConversation"

Modified: myfaces/fusion/trunk/core15/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core15/pom.xml?view=diff&rev=513315&r1=513314&r2=513315
==============================================================================
--- myfaces/fusion/trunk/core15/pom.xml (original)
+++ myfaces/fusion/trunk/core15/pom.xml Thu Mar  1 05:45:41 2007
@@ -83,7 +83,35 @@
 			<scope>provided</scope>
 		</dependency>
 
-		<!-- test dependencies -->
+
+                <!-- test dependencies -->
+                <dependency>
+                        <groupId>org.springframework</groupId>
+                        <artifactId>spring-mock</artifactId>
+                        <version>2.0.2</version>
+                        <scope>test</scope>
+                </dependency>
+
+                <dependency>
+                        <groupId>cglib</groupId>
+                        <artifactId>cglib</artifactId>
+                        <version>2.1_3</version>
+                        <scope>test</scope>
+                </dependency>
+
+                <dependency>
+                        <groupId>javax.persistence</groupId>
+                        <artifactId>toplink-essentials</artifactId>
+                        <version>1.0</version>
+                        <scope>test</scope>
+                </dependency>
+
+                <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derby</artifactId>
+                        <version>10.2.2.0</version>
+                        <scope>test</scope>
+                </dependency>
 
 	</dependencies>
 

Added: myfaces/fusion/trunk/core15/src/test/java/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core15/src/test/java/META-INF/persistence.xml?view=auto&rev=513315
==============================================================================
--- myfaces/fusion/trunk/core15/src/test/java/META-INF/persistence.xml (added)
+++ myfaces/fusion/trunk/core15/src/test/java/META-INF/persistence.xml Thu Mar  1 05:45:41
2007
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  -->
+
+<persistence version="1.0"
+        xmlns="http://java.sun.com/xml/ns/persistence"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
+
+		<persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
+			<class>org.apache.myfaces.fusion.conversation.model.UserData</class>
+		</persistence-unit>
+</persistence>
\ No newline at end of file

Propchange: myfaces/fusion/trunk/core15/src/test/java/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core15/src/test/java/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core15/src/test/java/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/PersistentConversation.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/PersistentConversation.java?view=auto&rev=513315
==============================================================================
--- myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/PersistentConversation.java
(added)
+++ myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/PersistentConversation.java
Thu Mar  1 05:45:41 2007
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.myfaces.fusion.conversation;
+
+import org.apache.myfaces.fusion.conversation.model.UserData;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+public class PersistentConversation implements ConversationBindingListener
+{
+	@PersistenceContext
+	private EntityManager entityManager;
+
+	private UserData restartedUser;
+	private UserData createdUser;
+
+	public PersistentConversation()
+	{
+	}
+
+	public void valueBound(ConversationBindingEvent event)
+	{
+	}
+
+	public void valueUnbound(ConversationBindingEvent event)
+	{
+	}
+
+	public UserData getRestartedUser()
+	{
+		return restartedUser;
+	}
+
+	@Transactional
+	public UserData createUser()
+	{
+		UserData userData = new UserData();
+		userData.setUsername("test");
+		entityManager.persist(userData);
+
+		createdUser = userData;
+
+		return userData;
+	}
+
+	public UserData readUser(Long id)
+	{
+		return entityManager.find(UserData.class, id);
+	}
+
+	public void invalidate()
+	{
+		Conversation.getCurrentInstance().invalidate();
+	}
+
+	public void invalidateAndRestart()
+	{
+		PersistentConversation conv = (PersistentConversation) ConversationUtils.invalidateAndRestart(Conversation.getCurrentInstance());
+		conv.setRestartedUser(createdUser.getId());
+	}
+
+	public void setRestartedUser(Long id)
+	{
+		restartedUser = readUser(id);
+	}
+
+	public void updateUser(Long id, String username)
+	{
+		UserData user = readUser(id);
+		user.setUsername(username);
+	}
+}

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/PersistentConversation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/PersistentConversation.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/PersistentConversation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/TestConversationPersistence.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/TestConversationPersistence.java?view=auto&rev=513315
==============================================================================
--- myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/TestConversationPersistence.java
(added)
+++ myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/TestConversationPersistence.java
Thu Mar  1 05:45:41 2007
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.fusion.conversation;
+
+import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
+import org.apache.myfaces.fusion.frameworkAdapter.MockFrameworkAdapter;
+import org.apache.myfaces.fusion.conversation.model.UserData;
+
+/**
+ * Test various aspects of the conversation handling
+ */
+public class TestConversationPersistence extends AbstractDependencyInjectionSpringContextTests
+{
+	protected String[] getConfigLocations()
+	{
+		return new String[]
+			{
+				"classpath:testApplicationContext.xml"
+			};
+	}
+
+	protected void onSetUp() throws Exception
+	{
+		super.onSetUp();
+
+		MockFrameworkAdapter frameworkAdapter = MockFrameworkAdapter.register();
+		frameworkAdapter.setApplicationContext(applicationContext);
+	}
+
+	public void testPersistence()
+	{
+		final String CONVERSATION_NAME = "persistentConversation";
+
+		PersistentConversation conv = (PersistentConversation) applicationContext.getBean(CONVERSATION_NAME);
+
+		/* create and reread a user */
+		UserData user = conv.createUser();
+		UserData user2 = conv.readUser(user.getId());
+
+		assertSame("has to be the same user",user , user2);
+
+		/* invalidate conversation */
+		conv.invalidate();
+
+		/* restart conversatin */
+		UserData user3 = conv.readUser(user.getId());
+
+		assertNotSame("should not be the same user", user ,user3);
+
+		/* end all conversations*/
+		ConversationManager.getInstance().clearCurrentConversationContext();
+
+		conv.updateUser(user.getId(), "test2");
+
+		/* invalidate conversation */
+		conv.invalidate();
+
+		UserData user4 = conv.readUser(user.getId());
+
+		assertNotNull(user4);
+		assertEquals(user.getId(), user4.getId());
+		assertEquals("test", user4.getUsername());
+	}
+
+	public void testRestartConversation()
+	{
+		final String CONVERSATION_NAME = "persistentConversation";
+
+		PersistentConversation conv = (PersistentConversation) applicationContext.getBean(CONVERSATION_NAME);
+
+		UserData user = conv.createUser();
+
+		conv.invalidateAndRestart();
+
+		/* here we access the new conversation */
+		UserData restartedUser = conv.getRestartedUser();
+
+		assertNotNull("should have got a user", restartedUser);
+		assertNotSame("should not be the same user", user, restartedUser);
+		assertEquals("has to be the same user id", user.getId(), restartedUser.getId());
+	}
+}
\ No newline at end of file

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/TestConversationPersistence.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/TestConversationPersistence.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/TestConversationPersistence.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/UserData.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/UserData.java?view=auto&rev=513315
==============================================================================
--- myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/UserData.java
(added)
+++ myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/UserData.java
Thu Mar  1 05:45:41 2007
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.myfaces.fusion.conversation.model;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Version;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+
+@Entity
+public class UserData
+{
+	@Id
+	@GeneratedValue(strategy= GenerationType.IDENTITY)
+	private Long id;
+
+	private String username;
+
+	@Version
+	private Long version;
+
+	public Long getId()
+	{
+		return id;
+	}
+
+	public void setId(Long id)
+	{
+		this.id = id;
+	}
+
+	public String getUsername()
+	{
+		return username;
+	}
+
+	public void setUsername(String username)
+	{
+		this.username = username;
+	}
+
+	public Long getVersion()
+	{
+		return version;
+	}
+
+	public void setVersion(Long version)
+	{
+		this.version = version;
+	}
+}

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/UserData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/UserData.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core15/src/test/java/org/apache/myfaces/fusion/conversation/model/UserData.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: myfaces/fusion/trunk/core15/src/test/java/testApplicationContext.xml (from r513248,
myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml)
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core15/src/test/java/testApplicationContext.xml?view=diff&rev=513315&p1=myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml&r1=513248&p2=myfaces/fusion/trunk/core15/src/test/java/testApplicationContext.xml&r2=513315
==============================================================================
--- myfaces/fusion/trunk/core/src/test/java/testApplicationContext.xml (original)
+++ myfaces/fusion/trunk/core15/src/test/java/testApplicationContext.xml Thu Mar  1 05:45:41
2007
@@ -32,19 +32,63 @@
 		<property name="scopes">
 			<map>
 				<entry key="conversation">
-					<bean class="org.apache.myfaces.fusion.conversation.spring.SpringConversationScope"
/>
+					<bean class="org.apache.myfaces.fusion.conversation.spring.SpringConversationScope">
+						<property name="advices">
+							<list>
+								<ref bean="persistentContextConversationInterceptor"/>
+							</list>
+						</property>
+					</bean>
 				</entry>
 			</map>
 		</property>
 	</bean>
 
+	<bean id="persistentContextConversationInterceptor"
+		  class="org.apache.myfaces.fusion.conversation.spring.PersistenceContextConversationInterceptor">
+		<property name="persistenceContextFactory" ref="persistentContextFactory"/>
+	</bean>
+
+	<bean id="persistentContextFactory"
+		  class="org.apache.myfaces.fusion.conversation.persistenceContexts.JpaPersistenceContextFactory">
+		<property name="entityManagerFactory" ref="entityManagerFactory"/>
+	</bean>
+
+	<!-- persistence -->
+	<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
+
+	<tx:annotation-driven />
+
+	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory" ref="entityManagerFactory"/>
+	</bean>
+
+	<bean id="entityManagerFactory"
+		  class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
+		<property name="jpaProperties">
+			<props>
+				<prop key="toplink.logging.level">FINE</prop>
+				<prop key="toplink.jdbc.driver">org.apache.derby.jdbc.EmbeddedDriver</prop>
+				<prop key="toplink.jdbc.url">jdbc:derby:myfacesFusionDB/TESTS;create=true</prop>
+				<prop key="toplink.jdbc.user">sa</prop>
+				<prop key="toplink.jdbc.password">foobar</prop>
+				<prop key="toplink.target-database">oracle.toplink.essentials.platform.database.DerbyPlatform</prop>
+				<prop key="toplink.ddl-generation">drop-and-create-tables</prop>
+			</props>
+		</property>
+		<property name="persistenceUnitName" value="default"/>
+	</bean>
+
+	<!-- our beans -->
+
 	<bean
-		name="dummyConversation"
-		class="org.apache.myfaces.fusion.conversation.DummyConversation"
+		name="persistentConversation"
+		class="org.apache.myfaces.fusion.conversation.PersistentConversation"
 		scope="conversation"
 		autowire="byName">
 
 		<aop:scoped-proxy/>
+
 	</bean>
 
 </beans>

Modified: myfaces/fusion/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/examples/pom.xml?view=diff&rev=513315&r1=513314&r2=513315
==============================================================================
--- myfaces/fusion/trunk/examples/pom.xml (original)
+++ myfaces/fusion/trunk/examples/pom.xml Thu Mar  1 05:45:41 2007
@@ -88,14 +88,7 @@
 			<artifactId>cglib</artifactId>
 			<version>2.1_3</version>
 		</dependency>
-<!--
-		<dependency>
-			<groupId>toplink.essentials</groupId>
-			<artifactId>toplink-essentials</artifactId>
-			<version>2.0-36</version>
-			<scope>provided</scope>
-		</dependency>
--->
+
 		<dependency>
 		  <groupId>javax.persistence</groupId>
 		  <artifactId>toplink-essentials</artifactId>

Modified: myfaces/fusion/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml?view=diff&rev=513315&r1=513314&r2=513315
==============================================================================
--- myfaces/fusion/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ myfaces/fusion/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml Thu Mar 
1 05:45:41 2007
@@ -69,7 +69,7 @@
 			<props>
 				<prop key="toplink.logging.level">FINE</prop>
 				<prop key="toplink.jdbc.driver">org.apache.derby.jdbc.EmbeddedDriver</prop>
-				<prop key="toplink.jdbc.url">jdbc:derby:myfacesFusionDB;create=true</prop>
+				<prop key="toplink.jdbc.url">jdbc:derby:myfacesFusionDB/V1;create=true</prop>
 				<prop key="toplink.jdbc.user">sa</prop>
 				<prop key="toplink.jdbc.password">foobar</prop>
 				<prop key="toplink.target-database">oracle.toplink.essentials.platform.database.DerbyPlatform</prop>
@@ -83,7 +83,7 @@
 	<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
 		<property name="sessionFactory" ref="sessionFactory" />
 	</bean>
-	
+
 	 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
 		 <property name="dataSource" ref="dataSource"/>
 		 <property name="annotatedClasses">



Mime
View raw message