[seam-commits] Seam SVN: r13793 - in modules/persistence/trunk: impl/src/main/java/org/jboss/seam/persistence/transaction and 19 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Oct 5 05:45:51 EDT 2010
Author: swd847
Date: 2010-10-05 05:45:50 -0400 (Tue, 05 Oct 2010)
New Revision: 13793
Added:
modules/persistence/trunk/tests-jetty/
modules/persistence/trunk/tests-jetty/pom.xml
modules/persistence/trunk/tests-jetty/src/
modules/persistence/trunk/tests-jetty/src/main/
modules/persistence/trunk/tests-jetty/src/main/java/
modules/persistence/trunk/tests-jetty/src/main/resources/
modules/persistence/trunk/tests-jetty/src/test/
modules/persistence/trunk/tests-jetty/src/test/java/
modules/persistence/trunk/tests-jetty/src/test/java/org/
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/HibernateSearchTest.java
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextCreatedEventTest.java
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextELTest.java
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextFlushModeTest.java
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextTest.java
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/util/
modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/util/JettyTestUtils.java
modules/persistence/trunk/tests-jetty/src/test/resources/
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/orm.xml
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-orm.xml
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-search.xml
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-std.xml
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/seam-beans.xml
modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/
modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/beans-transaction-interceptor.xml
modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/beans.xml
modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/jetty-env.xml
modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/web.xml
modules/persistence/trunk/tests-jetty/src/test/resources/arquillian.xml
Modified:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/SeSynchronizations.java
modules/persistence/trunk/pom.xml
modules/persistence/trunk/tests-base/
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java
modules/persistence/trunk/tests-jboss/
Log:
add jetty based tests for a weld-se environment
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/SeSynchronizations.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/SeSynchronizations.java 2010-10-05 07:46:41 UTC (rev 13792)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/SeSynchronizations.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -24,11 +24,12 @@
import java.util.Stack;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Alternative;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
import javax.transaction.Synchronization;
+import org.jboss.weld.extensions.core.Veto;
+
/**
* This implementation does not have access to the JTA TransactionManager, so it
* is not fully aware of container managed transaction lifecycle, and is not
@@ -40,7 +41,7 @@
* @author Stuart Douglas
*/
@RequestScoped
- at Alternative
+ at Veto
public class SeSynchronizations implements Synchronizations
{
protected Stack<SynchronizationRegistry> synchronizations = new Stack<SynchronizationRegistry>();
Modified: modules/persistence/trunk/pom.xml
===================================================================
--- modules/persistence/trunk/pom.xml 2010-10-05 07:46:41 UTC (rev 13792)
+++ modules/persistence/trunk/pom.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -29,7 +29,7 @@
<module>api</module>
<module>impl</module>
<module>tests-base</module>
- <!-- <module>tests-weld-se</module> -->
+ <module>tests-jetty</module>
</modules>
<properties>
@@ -40,6 +40,12 @@
<arquillian.version>1.0.0.Alpha4</arquillian.version>
<jboss.server.manager.version>1.0.3.GA</jboss.server.manager.version>
<jboss-as-client.version>6.0.0.20100721-M4</jboss-as-client.version>
+ <jboss.logging.version>3.0.0.Beta4</jboss.logging.version>
+ <jetty.version>7.0.2.v20100331</jetty.version>
+ <el.version>2.2</el.version>
+ <jsp.version>2.2</jsp.version>
+ <weld.version>1.1.0.Beta1</weld.version>
+ <hsqldb.version>1.8.0.10</hsqldb.version>
</properties>
<dependencyManagement>
@@ -74,6 +80,18 @@
<artifactId>seam-persistence-tests-base</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${hsqldb.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
@@ -98,6 +116,13 @@
</dependency>
<dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <version>${jboss.logging.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.seam.persistence</groupId>
<artifactId>seam-persistence</artifactId>
<version>${project.version}</version>
@@ -135,8 +160,77 @@
<version>${jboss-as-client.version}</version>
<type>pom</type>
</dependency>
- </dependencies>
+
+ <!-- Jetty Dependencies -->
+
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-jetty-embedded-7</artifactId>
+ <version>${arquillian.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <!-- plus and naming requires for using JNDI -->
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <!-- Weld servlet, EL and JSP required for testing CDI injections -->
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>${el.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>${jsp.version}</version>
+ </dependency>
+
+ <!-- Temp weld deps -->
+
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <version>${weld.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <version>${weld.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core-api</artifactId>
+ <version>${weld.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core-spi</artifactId>
+ <version>${weld.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <version>1.0-SP2</version>
+ </dependency>
+
+ </dependencies>
+
</dependencyManagement>
<profiles>
Property changes on: modules/persistence/trunk/tests-base
___________________________________________________________________
Name: svn:ignore
- .classpath
.settings
.project
+ .classpath
.settings
.project
target
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTestBase.java 2010-10-05 07:46:41 UTC (rev 13792)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTestBase.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -56,7 +56,7 @@
EntityManager em;
@Test
- public void testManagedPsersistenceContext() throws NotSupportedException, SystemException, SecurityException, IllegalStateException, RollbackException, HeuristicMixedException, HeuristicRollbackException
+ public void testManagedPersistenceContext() throws NotSupportedException, SystemException, SecurityException, IllegalStateException, RollbackException, HeuristicMixedException, HeuristicRollbackException
{
transaction.begin();
Hotel h = new Hotel("test", "Fake St", "Wollongong", "NSW", "2518", "Australia");
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java 2010-10-05 07:46:41 UTC (rev 13792)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -27,7 +27,7 @@
public class EntityManagerProvider
{
- @PersistenceContext
+ @PersistenceContext(unitName = "seamPersistencePu")
@Produces
EntityManager em;
}
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java 2010-10-05 07:46:41 UTC (rev 13792)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -30,7 +30,7 @@
public class ManagedPersistenceContextProvider
{
- @PersistenceUnit
+ @PersistenceUnit(unitName = "seamPersistencePu")
@RequestScoped
@Produces
@SeamManaged
Property changes on: modules/persistence/trunk/tests-jboss
___________________________________________________________________
Name: svn:ignore
- .project
.settings
.classpath
+ .project
.settings
.classpath
target
Property changes on: modules/persistence/trunk/tests-jetty
___________________________________________________________________
Name: svn:ignore
+ target
.project
.settings
.classpath
Added: modules/persistence/trunk/tests-jetty/pom.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/pom.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/pom.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,221 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>seam-persistence-parent</artifactId>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-tests-jetty</artifactId>
+ <packaging>jar</packaging>
+ <version>3.0.0-SNAPSHOT</version>
+ <name>Seam Persistence Weld SE Tests</name>
+
+ <prerequisites>
+ <maven>3.0</maven>
+ </prerequisites>
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.interceptor</groupId>
+ <artifactId>jboss-interceptors-api_1.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-extensions</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-tests-base</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-jetty-embedded-7</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- plus and naming requires for using JNDI -->
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Weld servlet, EL and JSP required for testing CDI injections -->
+
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/persistence/trunk/tests-weld-se</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/persistence/trunk/tests-weld-se</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Seam/modules/persistence/trunk/tests-weld-se</url>
+ </scm>
+
+</project>
+
Added: modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/HibernateSearchTest.java
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/HibernateSearchTest.java (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/HibernateSearchTest.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.jetty;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.HibernateSearchTestBase;
+import org.jboss.seam.persistence.test.jetty.util.JettyTestUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class HibernateSearchTest extends HibernateSearchTestBase
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ WebArchive war = JettyTestUtils.createTestArchive();
+ war.addWebResource("WEB-INF/beans.xml", "beans.xml");
+ war.addClasses(getTestClasses());
+ war.addWebResource("META-INF/persistence-search.xml", "classes/META-INF/persistence.xml");
+ return war;
+ }
+
+}
Added: modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextCreatedEventTest.java
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextCreatedEventTest.java (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextCreatedEventTest.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.jetty;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.ManagedPersistenceContextCreatedEventTestBase;
+import org.jboss.seam.persistence.test.jetty.util.JettyTestUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class ManagedPersistenceContextCreatedEventTest extends ManagedPersistenceContextCreatedEventTestBase
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ WebArchive war = JettyTestUtils.createTestArchive();
+ war.addWebResource("WEB-INF/beans.xml", "beans.xml");
+ war.addWebResource("META-INF/persistence-std.xml", "classes/META-INF/persistence.xml");
+ war.addClasses(getTestClasses());
+ return war;
+ }
+
+}
Added: modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextELTest.java
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextELTest.java (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextELTest.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.jetty;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.ManagedPersistenceContextELTestBase;
+import org.jboss.seam.persistence.test.jetty.util.JettyTestUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class ManagedPersistenceContextELTest extends ManagedPersistenceContextELTestBase
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ WebArchive war = JettyTestUtils.createTestArchive();
+ war.addWebResource("WEB-INF/beans.xml", "beans.xml");
+ war.addWebResource("META-INF/persistence-std.xml", "classes/META-INF/persistence.xml");
+ war.addClasses(getTestClasses());
+ return war;
+ }
+
+}
Added: modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextFlushModeTest.java
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextFlushModeTest.java (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextFlushModeTest.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.jetty;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.ManagedPersistenceContextFlushModeTestBase;
+import org.jboss.seam.persistence.test.jetty.util.JettyTestUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class ManagedPersistenceContextFlushModeTest extends ManagedPersistenceContextFlushModeTestBase
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ WebArchive war = JettyTestUtils.createTestArchive();
+ war.addWebResource("WEB-INF/beans.xml", "beans.xml");
+ war.addWebResource("META-INF/persistence-std.xml", "classes/META-INF/persistence.xml");
+ war.addClasses(getTestClasses());
+ return war;
+ }
+}
Added: modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextTest.java
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextTest.java (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/ManagedPersistenceContextTest.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.jetty;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.ManagedPersistenceContextTestBase;
+import org.jboss.seam.persistence.test.jetty.util.JettyTestUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class ManagedPersistenceContextTest extends ManagedPersistenceContextTestBase
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ WebArchive war = JettyTestUtils.createTestArchive();
+ war.addWebResource("WEB-INF/beans.xml", "beans.xml");
+ war.addWebResource("META-INF/persistence-std.xml", "classes/META-INF/persistence.xml");
+ war.addClasses(getTestClasses());
+ return war;
+ }
+
+}
Added: modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/util/JettyTestUtils.java
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/util/JettyTestUtils.java (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/java/org/jboss/seam/persistence/test/jetty/util/JettyTestUtils.java 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.jetty.util;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+/**
+ *
+ * @author Stuart Douglas
+ *
+ */
+public class JettyTestUtils
+{
+ public static WebArchive createTestArchive()
+ {
+ WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
+ war.addResource("META-INF/seam-beans.xml", "seam-beans.xml");
+ war.addWebResource("WEB-INF/jetty-env.xml", "jetty-env.xml");
+ war.addWebResource("WEB-INF/web.xml", "web.xml");
+ return war;
+ }
+}
Added: modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/orm.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/orm.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/orm.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0"
+ >
+ <persistence-unit-metadata >
+ <persistence-unit-defaults >
+ <entity-listeners>
+ <entity-listener class="org.jboss.seam.persistence.InjectionEventListener" >
+ <post-load method-name="load" />
+ </entity-listener>
+ </entity-listeners>
+ </persistence-unit-defaults>
+ </persistence-unit-metadata>
+
+</entity-mappings>
\ No newline at end of file
Added: modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-orm.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-orm.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-orm.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence 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_2_0.xsd"
+ version="2.0">
+ <persistence-unit name="seamPersistencePu" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <mapping-file>META-INF/orm.xml</mapping-file>
+ <class>org.jboss.seam.transactions.test.util.Hotel</class>
+ <exclude-unlisted-classes />
+ <properties>
+ <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
+ <property name="javax.persistence.jdbc.user" value="sa" />
+ <property name="javax.persistence.jdbc.password" value="" />
+ <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:." />
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
+ <property name="hibernate.hbm2ddl.auto" value="create-drop" />
+ </properties>
+ </persistence-unit>
+</persistence>
Added: modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-search.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-search.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-search.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence 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_2_0.xsd"
+ version="2.0">
+ <persistence-unit name="seamPersistencePu" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <class>org.jboss.seam.transactions.test.util.IndexedHotel</class>
+ <exclude-unlisted-classes />
+ <properties>
+ <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
+ <property name="javax.persistence.jdbc.user" value="sa" />
+ <property name="javax.persistence.jdbc.password" value="" />
+ <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:." />
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
+ <property name="hibernate.hbm2ddl.auto" value="create-drop" />
+
+ </properties>
+ </persistence-unit>
+</persistence>
Added: modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-std.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-std.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-std.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence 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_2_0.xsd"
+ version="2.0">
+ <persistence-unit name="seamPersistencePu"
+ transaction-type="RESOURCE_LOCAL">
+ <!--
+ <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+ -->
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+
+ <class>org.jboss.seam.transactions.test.util.Hotel</class>
+ <exclude-unlisted-classes />
+ <properties>
+ <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
+ <property name="javax.persistence.jdbc.user" value="sa" />
+ <property name="javax.persistence.jdbc.password" value="" />
+ <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:." />
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
+
+ <property name="hibernate.hbm2ddl.auto" value="create-drop" />
+
+ </properties>
+ </persistence-unit>
+</persistence>
Added: modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/seam-beans.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/seam-beans.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/seam-beans.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:ee"
+ xmlns:t="urn:java:org.jboss.seam.persistence.transaction"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://docs.jboss.org/cdi/beans_1_0.xsd">
+
+ <t:EntityTransaction>
+ <s:modifies />
+ </t:EntityTransaction>
+
+ <t:SeSynchronizations>
+ <s:modifies/>
+ </t:SeSynchronizations>
+</beans>
\ No newline at end of file
Added: modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/beans-transaction-interceptor.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/beans-transaction-interceptor.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/beans-transaction-interceptor.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:ee"
+ xmlns:t="urn:java:org.jboss.seam.persistence.transaction"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://docs.jboss.org/cdi/beans_1_0.xsd">
+ <interceptors>
+ <class>org.jboss.seam.persistence.transaction.TransactionInterceptor</class>
+ </interceptors>
+</beans>
\ No newline at end of file
Added: modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/beans.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/beans.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/beans.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:ee"
+ xmlns:t="urn:java:org.jboss.seam.persistence.transaction"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://docs.jboss.org/cdi/beans_1_0.xsd">
+
+</beans>
\ No newline at end of file
Added: modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/jetty-env.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/jetty-env.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/jetty-env.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,15 @@
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
+ "http://jetty.mortbay.org/configure.dtd">
+<Configure id="webAppCtx" class="org.eclipse.jetty.webapp.WebAppContext">
+ <New id="BeanManager" class="org.eclipse.jetty.plus.jndi.Resource">
+ <Arg><Ref id="webAppCtx"/></Arg>
+ <Arg>BeanManager</Arg>
+ <Arg>
+ <New class="javax.naming.Reference">
+ <Arg>javax.enterprise.inject.spi.BeanManager</Arg>
+ <Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
+ <Arg/>
+ </New>
+ </Arg>
+ </New>
+</Configure>
Added: modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/web.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/web.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/WEB-INF/web.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <env-entry>
+ <env-entry-name>name</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>Jetty</env-entry-value>
+ </env-entry>
+
+ <!-- Should be overridden by jetty-env.xml -->
+ <env-entry>
+ <env-entry-name>type</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>Remote</env-entry-value>
+ </env-entry>
+
+ <listener>
+ <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
+ </listener>
+
+ <resource-env-ref>
+ <resource-env-ref-name>BeanManager</resource-env-ref-name>
+ <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
+ </resource-env-ref>
+
+</web-app>
Added: modules/persistence/trunk/tests-jetty/src/test/resources/arquillian.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/arquillian.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/arquillian.xml 2010-10-05 09:45:50 UTC (rev 13793)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns="http://jboss.com/arquillian"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <engine>
+ <deploymentExportPath>/tmp/</deploymentExportPath>
+ </engine>
+
+</arquillian>
More information about the seam-commits
mailing list