[jira] Commented: (TAP5-1473) Running integration tests with Tomcat6Runner it should be possible to configure the application under test by providing a local context.xml file
[ https://issues.apache.org/jira/browse/TAP5-1473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006693#comment-13006693 ] Hudson commented on TAP5-1473: -- Integrated in tapestry-5.2-freestyle #289 (See [https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/289/]) TAP5-1473: Running integration tests with Tomcat6Runner it should be possible to configure the application under test by providing a local context.xml file > Running integration tests with Tomcat6Runner it should be possible to > configure the application under test by providing a local context.xml file > > > Key: TAP5-1473 > URL: https://issues.apache.org/jira/browse/TAP5-1473 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-test >Reporter: Igor Drobiazko >Assignee: Igor Drobiazko >Priority: Minor > Fix For: 5.3.0 > > > If META-INF/context.xml exists inside the web app folder, it should be used > to configure the context -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (TAP5-1472) Provide basic integration with JPA 2
[ https://issues.apache.org/jira/browse/TAP5-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006694#comment-13006694 ] Hudson commented on TAP5-1472: -- Integrated in tapestry-5.2-freestyle #289 (See [https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/289/]) TAP5-1472: Configuring persistence unit using non-jta DataSource. > Provide basic integration with JPA 2 > > > Key: TAP5-1472 > URL: https://issues.apache.org/jira/browse/TAP5-1472 > Project: Tapestry 5 > Issue Type: New Feature > Components: tapestry-jpa >Reporter: Igor Drobiazko >Assignee: Igor Drobiazko > > Provide basic integration with JPA 2. The goals are: > - Support for multiple EntityManagers > - Injection of EntityManager into both: components and services > - Provide a way to configure EntityManagers programmatically, not only via > persistence.xml > - Create ValueEncoder for entities on-the-fly > - Provide "entity" PersistentFieldStrategy > - Provide "entity" ApplicationStatePersistenceStrategy > - Provide @CommitAfter annotations > We also should consider if a tapestry-orm or similar project is needed in > order to reuse common source code. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
svn commit: r1081575 - in /tapestry/tapestry5/trunk/tapestry-jpa/src: main/java/org/apache/tapestry5/internal/jpa/ test/app3/ test/app3/META-INF/ test/app3/WEB-INF/ test/conf/ test/java/org/apache/tap
Author: drobiazko Date: Mon Mar 14 21:46:29 2011 New Revision: 1081575 URL: http://svn.apache.org/viewvc?rev=1081575&view=rev Log: TAP5-1472: Configuring persistence unit using non-jta DataSource. Added: tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/ tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/META-INF/ tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/META-INF/context.xml (with props) tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/PersistThing.tml tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/WEB-INF/ tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/WEB-INF/web.xml (with props) tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/apache/tapestry5/jpa/integration/app3/ tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/apache/tapestry5/jpa/integration/app3/JndiDataSourceTest.java (with props) tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/example/app3/ tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/example/app3/entities/ tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/example/app3/entities/Thing.java (with props) tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/example/app3/pages/ tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/example/app3/pages/PersistThing.java (with props) tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/example/app3/services/ tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/example/app3/services/AppModule.java (with props) tapestry/tapestry5/trunk/tapestry-jpa/src/test/resources/jndi-datasource-persistence-unit.xml (with props) Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContentHandler.java tapestry/tapestry5/trunk/tapestry-jpa/src/test/conf/testng.xml Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContentHandler.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContentHandler.java?rev=1081575&r1=1081574&r2=1081575&view=diff == --- tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContentHandler.java (original) +++ tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContentHandler.java Mon Mar 14 21:46:29 2011 @@ -16,9 +16,13 @@ package org.apache.tapestry5.internal.jp import java.util.List; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; import javax.persistence.SharedCacheMode; import javax.persistence.ValidationMode; import javax.persistence.spi.PersistenceUnitTransactionType; +import javax.sql.DataSource; import org.apache.tapestry5.ioc.internal.util.CollectionFactory; import org.apache.tapestry5.jpa.TapestryPersistenceUnitInfo; @@ -129,6 +133,10 @@ public class PersistenceContentHandler i { persistenceUnitInfo.setValidationMode(toEnum(ValidationMode.class, string)); } +else if (ELEMENT_NON_JTA_DATA_SOURCE.equals(localName)) +{ + persistenceUnitInfo.setNonJtaDataSource(lookupDataSource(string)); +} else if (ELEMENT_PERSISTENCE_UNIT.equals(localName)) { if (persistenceUnitInfo != null) @@ -172,4 +180,22 @@ public class PersistenceContentHandler i { return Enum.valueOf(enumType, value); } + +private DataSource lookupDataSource(final String name) +{ +try +{ +//TODO: Create InitialContext with environment properties? +final Context initContext = new InitialContext(); + +final Context envContext = (Context) initContext.lookup("java:comp/env"); + +return (DataSource) envContext.lookup(name); +} +catch (final NamingException e) +{ +throw new RuntimeException(e); +} + +} } Added: tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/META-INF/context.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/META-INF/context.xml?rev=1081575&view=auto == --- tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/META-INF/context.xml (added) +++ tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/META-INF/context.xml Mon Mar 14 21:46:29 2011 @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file Propchange: tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/META-INF/context.xml -- svn:eol-style = native Propchange: tapestry/tapestry5/trunk/tapestry-jpa/src/test/app3/META-INF/contex
[jira] Resolved: (TAP5-1473) Running integration tests with Tomcat6Runner it should be possible to configure the application under test by providing a local context.xml file
[ https://issues.apache.org/jira/browse/TAP5-1473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Drobiazko resolved TAP5-1473. -- Resolution: Fixed Fix Version/s: 5.3.0 Done > Running integration tests with Tomcat6Runner it should be possible to > configure the application under test by providing a local context.xml file > > > Key: TAP5-1473 > URL: https://issues.apache.org/jira/browse/TAP5-1473 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-test >Reporter: Igor Drobiazko >Priority: Minor > Fix For: 5.3.0 > > > If META-INF/context.xml exists inside the web app folder, it should be used > to configure the context -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (TAP5-1473) Running integration tests with Tomcat6Runner it should be possible to configure the application under test by providing a local context.xml file
[ https://issues.apache.org/jira/browse/TAP5-1473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Drobiazko closed TAP5-1473. Assignee: Igor Drobiazko > Running integration tests with Tomcat6Runner it should be possible to > configure the application under test by providing a local context.xml file > > > Key: TAP5-1473 > URL: https://issues.apache.org/jira/browse/TAP5-1473 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-test >Reporter: Igor Drobiazko >Assignee: Igor Drobiazko >Priority: Minor > Fix For: 5.3.0 > > > If META-INF/context.xml exists inside the web app folder, it should be used > to configure the context -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
svn commit: r1081573 - in /tapestry/tapestry5/trunk/tapestry-test: pom.xml src/main/java/org/apache/tapestry5/test/Tomcat6Runner.java
Author: drobiazko Date: Mon Mar 14 21:35:38 2011 New Revision: 1081573 URL: http://svn.apache.org/viewvc?rev=1081573&view=rev Log: TAP5-1473: Running integration tests with Tomcat6Runner it should be possible to configure the application under test by providing a local context.xml file Modified: tapestry/tapestry5/trunk/tapestry-test/pom.xml tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/Tomcat6Runner.java Modified: tapestry/tapestry5/trunk/tapestry-test/pom.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-test/pom.xml?rev=1081573&r1=1081572&r2=1081573&view=diff == --- tapestry/tapestry5/trunk/tapestry-test/pom.xml (original) +++ tapestry/tapestry5/trunk/tapestry-test/pom.xml Mon Mar 14 21:35:38 2011 @@ -69,7 +69,12 @@ 6.0.30 compile - + +org.apache.tomcat +dbcp +6.0.30 +compile + Modified: tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/Tomcat6Runner.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/Tomcat6Runner.java?rev=1081573&r1=1081572&r2=1081573&view=diff == --- tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/Tomcat6Runner.java (original) +++ tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/Tomcat6Runner.java Mon Mar 14 21:35:38 2011 @@ -69,6 +69,11 @@ public class Tomcat6Runner implements Se wrapper.setServletClass(DefaultServlet.class.getName()); context.addChild(wrapper); context.addServletMapping("/", name); + +File contextConfigFile = new File(webappFolder, "META-INF/context.xml"); + +if(contextConfigFile.exists()) +context.setConfigFile(contextConfigFile.getAbsolutePath()); context.setLoader(new WebappLoader(this.getClass().getClassLoader()));
[jira] Created: (TAP5-1473) Running integration tests with Tomcat6Runner it should be possible to configure the application under test by providing a local context.xml file
Running integration tests with Tomcat6Runner it should be possible to configure the application under test by providing a local context.xml file Key: TAP5-1473 URL: https://issues.apache.org/jira/browse/TAP5-1473 Project: Tapestry 5 Issue Type: Improvement Components: tapestry-test Reporter: Igor Drobiazko Priority: Minor If META-INF/context.xml exists inside the web app folder, it should be used to configure the context -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira