aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyjw...@apache.org
Subject svn commit: r1737988 - in /aries/trunk/tx-control/tx-control-jpa-itests: ./ src/test/java/org/apache/aries/tx/control/itests/
Date Wed, 06 Apr 2016 14:31:12 GMT
Author: timothyjward
Date: Wed Apr  6 14:31:12 2016
New Revision: 1737988

URL: http://svn.apache.org/viewvc?rev=1737988&view=rev
Log:
[tx-control] Add JPA integration tests for Hibernate 5.0.9

Added:
    aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractSimpleTransactionTest.java
      - copied, changed from r1737958, aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleTransactionTest.java
    aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleEclipseLink_2_6_0_Test.java
    aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleHibernate_5_0_9_Test.java
Removed:
    aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleTransactionTest.java
Modified:
    aries/trunk/tx-control/tx-control-jpa-itests/pom.xml
    aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractJPATransactionTest.java

Modified: aries/trunk/tx-control/tx-control-jpa-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/tx-control/tx-control-jpa-itests/pom.xml?rev=1737988&r1=1737987&r2=1737988&view=diff
==============================================================================
--- aries/trunk/tx-control/tx-control-jpa-itests/pom.xml (original)
+++ aries/trunk/tx-control/tx-control-jpa-itests/pom.xml Wed Apr  6 14:31:12 2016
@@ -29,7 +29,7 @@
 
 
 	<properties>
-		<exam.version>3.4.0</exam.version>
+		<exam.version>4.8.0</exam.version>
 		<url.version>1.6.0</url.version>
 	</properties>
 

Modified: aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractJPATransactionTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractJPATransactionTest.java?rev=1737988&r1=1737987&r2=1737988&view=diff
==============================================================================
--- aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractJPATransactionTest.java
(original)
+++ aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractJPATransactionTest.java
Wed Apr  6 14:31:12 2016
@@ -18,11 +18,9 @@
  */
 package org.apache.aries.tx.control.itests;
 
-import static org.ops4j.pax.exam.CoreOptions.bootClasspathLibrary;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.systemPackage;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 import static org.ops4j.pax.exam.CoreOptions.when;
 
@@ -57,6 +55,8 @@ import org.osgi.service.transaction.cont
 @ExamReactorStrategy(PerClass.class)
 public abstract class AbstractJPATransactionTest extends AbstractIntegrationTest {
 
+	protected static final String ARIES_EMF_BUILDER_TARGET_FILTER = "aries.emf.builder.target.filter";
+
 	protected TransactionControl txControl;
 
 	protected EntityManager em;
@@ -95,6 +95,12 @@ public abstract class AbstractJPATransac
 		props.put(DataSourceFactory.JDBC_URL, jdbcUrl);
 		props.put(EntityManagerFactoryBuilder.JPA_UNIT_NAME, "test-unit");
 		
+		String filter = System.getProperty(ARIES_EMF_BUILDER_TARGET_FILTER);
+		
+		if(filter != null) {
+			props.put(ARIES_EMF_BUILDER_TARGET_FILTER, filter);
+		}
+		
 		ConfigurationAdmin cm = context().getService(ConfigurationAdmin.class, 5000);
 		
 		String pid = "org.apache.aries.tx.control.jpa.local"; 
@@ -175,7 +181,7 @@ public abstract class AbstractJPATransac
 				mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
 				localTxControlService(),
 				localJpaResourceProviderWithH2(),
-				eclipseLink2_3_0(),
+				jpaProvider(),
 				ariesJPA(),
 				mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject(),
 				mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
@@ -197,20 +203,13 @@ public abstract class AbstractJPATransac
 				mavenBundle("org.apache.aries.tx-control", "tx-control-provider-jpa-local").versionAsInProject());
 	}
 	
-	public Option eclipseLink2_3_0() {
-		return CoreOptions.composite(
-				systemPackage("javax.transaction;version=1.1"),
-				systemPackage("javax.transaction.xa;version=1.1"),
-				bootClasspathLibrary(mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec",
"1.1.1")),
-				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa", "2.6.0"),
-				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.core", "2.6.0"),
-				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.asm", "2.6.0"),
-				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.antlr", "2.6.0"),
-				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa.jpql", "2.6.0"),
-				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.eclipselink.adapter", "2.3.0"));
+	public Option ariesJPA() {
+		return mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container", ariesJPAVersion());
 	}
 
-	public Option ariesJPA() {
-		return mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container", "2.3.0");
+	protected String ariesJPAVersion() {
+		return "2.3.0";
 	}
+	
+	protected abstract Option jpaProvider();
 }

Copied: aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractSimpleTransactionTest.java
(from r1737958, aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleTransactionTest.java)
URL: http://svn.apache.org/viewvc/aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractSimpleTransactionTest.java?p2=aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractSimpleTransactionTest.java&p1=aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleTransactionTest.java&r1=1737958&r2=1737988&rev=1737988&view=diff
==============================================================================
--- aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleTransactionTest.java
(original)
+++ aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/AbstractSimpleTransactionTest.java
Wed Apr  6 14:31:12 2016
@@ -27,14 +27,8 @@ import javax.persistence.criteria.Criter
 
 import org.apache.aries.tx.control.itests.entity.Message;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerClass;
 
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerClass.class)
-public class SimpleTransactionTest extends AbstractJPATransactionTest {
+public abstract class AbstractSimpleTransactionTest extends AbstractJPATransactionTest {
 
 	@Test
 	public void testTx() {

Added: aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleEclipseLink_2_6_0_Test.java
URL: http://svn.apache.org/viewvc/aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleEclipseLink_2_6_0_Test.java?rev=1737988&view=auto
==============================================================================
--- aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleEclipseLink_2_6_0_Test.java
(added)
+++ aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleEclipseLink_2_6_0_Test.java
Wed Apr  6 14:31:12 2016
@@ -0,0 +1,32 @@
+package org.apache.aries.tx.control.itests;
+
+import static org.ops4j.pax.exam.CoreOptions.bootClasspathLibrary;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemPackage;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Option;
+
+public class SimpleEclipseLink_2_6_0_Test extends AbstractSimpleTransactionTest {
+
+	@Override
+	protected Option jpaProvider() {
+		return CoreOptions.composite(
+				// Add JTA 1.1 as a system package because of the link to javax.sql
+				systemProperty(ARIES_EMF_BUILDER_TARGET_FILTER)
+					.value("(osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider)"),
+				systemPackage("javax.transaction;version=1.1"),
+				systemPackage("javax.transaction.xa;version=1.1"),
+				bootClasspathLibrary(mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec",
"1.1.1")),
+				
+				// EclipseLink bundles and their dependencies (JPA API is available from the tx-control)
+				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa", "2.6.0"),
+				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.core", "2.6.0"),
+				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.asm", "2.6.0"),
+				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.antlr", "2.6.0"),
+				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa.jpql", "2.6.0"),
+				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.eclipselink.adapter", "2.3.0"));
+	}
+
+}

Added: aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleHibernate_5_0_9_Test.java
URL: http://svn.apache.org/viewvc/aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleHibernate_5_0_9_Test.java?rev=1737988&view=auto
==============================================================================
--- aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleHibernate_5_0_9_Test.java
(added)
+++ aries/trunk/tx-control/tx-control-jpa-itests/src/test/java/org/apache/aries/tx/control/itests/SimpleHibernate_5_0_9_Test.java
Wed Apr  6 14:31:12 2016
@@ -0,0 +1,44 @@
+package org.apache.aries.tx.control.itests;
+
+import static org.ops4j.pax.exam.CoreOptions.bootClasspathLibrary;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemPackage;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Option;
+
+public class SimpleHibernate_5_0_9_Test extends AbstractSimpleTransactionTest {
+
+	protected String ariesJPAVersion() {
+		return "2.4.0-SNAPSHOT";
+	}
+	
+	@Override
+	protected Option jpaProvider() {
+		return CoreOptions.composite(
+			// Add JTA 1.1 as a system package because of the link to javax.sql
+			// Also set javax.xml.stream to 1.0 due to hibernate's funny packaging
+			
+			systemProperty(ARIES_EMF_BUILDER_TARGET_FILTER)
+				.value("(osgi.unit.provider=org.hibernate.jpa.HibernatePersistenceProvider)"),
+			systemPackage("javax.xml.stream;version=1.0"),
+			systemPackage("javax.xml.stream.events;version=1.0"),
+			systemPackage("javax.xml.stream.util;version=1.0"),
+			systemPackage("javax.transaction;version=1.1"),
+			systemPackage("javax.transaction.xa;version=1.1"),
+			bootClasspathLibrary(mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec",
"1.1.1")).beforeFramework(),
+			
+			// Hibernate bundles and their dependencies (JPA API is available from the tx-control)
+			mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.antlr", "2.7.7_5"),
+			mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.dom4j", "1.6.1_5"),
+			mavenBundle("org.javassist", "javassist", "3.18.1-GA"),
+			mavenBundle("org.jboss.logging", "jboss-logging", "3.3.0.Final"),
+			mavenBundle("org.jboss", "jandex", "2.0.0.Final"),
+			mavenBundle("org.hibernate.common", "hibernate-commons-annotations", "5.0.1.Final"),
+			mavenBundle("org.hibernate", "hibernate-core", "5.0.9.Final"),
+			mavenBundle("org.hibernate", "hibernate-osgi", "5.0.9.Final"),
+			mavenBundle("org.hibernate", "hibernate-entitymanager", "5.0.9.Final"));
+	}
+
+}



Mime
View raw message