You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2012/11/29 15:08:19 UTC
svn commit: r1415170 - in
/openejb/trunk/openejb/examples/multi-jpa-provider-testing: ./
src/test/java/org/superbiz/enricher/jpa/
src/test/java/org/superbiz/enricher/maven/
Author: andygumbrecht
Date: Thu Nov 29 14:08:18 2012
New Revision: 1415170
URL: http://svn.apache.org/viewvc?rev=1415170&view=rev
Log:
Attempt to fix for http://ci.apache.org/builders/openejb-trunk-win-sunjdk.
Modified:
openejb/trunk/openejb/examples/multi-jpa-provider-testing/pom.xml
openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java
openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java
openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java
Modified: openejb/trunk/openejb/examples/multi-jpa-provider-testing/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/multi-jpa-provider-testing/pom.xml?rev=1415170&r1=1415169&r2=1415170&view=diff
==============================================================================
--- openejb/trunk/openejb/examples/multi-jpa-provider-testing/pom.xml (original)
+++ openejb/trunk/openejb/examples/multi-jpa-provider-testing/pom.xml Thu Nov 29 14:08:18 2012
@@ -17,137 +17,145 @@
limitations under the License.
-->
-<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">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.superbiz</groupId>
- <artifactId>multi-jpa-provider-testing</artifactId>
- <packaging>jar</packaging>
- <version>1.1.0-SNAPSHOT</version>
- <name>OpenEJB :: Examples :: Multiple JPA providers</name>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <build>
- <defaultGoal>install</defaultGoal>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
-
- <plugin> <!-- run tests twice, once with openjpa and once with hibernate -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.12.4</version>
- <executions>
- <execution>
- <id>test-hibernate</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- <systemPropertyVariables>
- <javax.persistence.provider>org.hibernate.ejb.HibernatePersistence</javax.persistence.provider>
- </systemPropertyVariables>
- </configuration>
- </execution>
- <execution>
- <id>test-openjpa</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- <systemPropertyVariables>
- <javax.persistence.provider>org.apache.openjpa.persistence.PersistenceProviderImpl</javax.persistence.provider>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>apache-m2-snapshot</id>
- <name>Apache Snapshot Repository</name>
- <url>http://repository.apache.org/snapshots</url>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>javaee-api</artifactId>
- <version>6.0-4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.10</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>arquillian-openejb-embedded-4</artifactId>
- <version>4.5.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.shrinkwrap.resolver</groupId>
- <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
- <version>1.1.0-alpha-3</version>
- <scope>test</scope>
- </dependency>
-
- <!--
- don't be shy and put all JPA provider in the classpath
- otherwise arquillian has some difficulties in embedded mode to find your classes
- -->
- <dependency>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa</artifactId>
- <version>2.2.0</version>
- <scope>test</scope>
- </dependency>
- <dependency> <!-- just a facade pom which will bring hibernate for us -->
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-core-hibernate</artifactId>
- <version>4.5.1-SNAPSHOT</version>
- <scope>test</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
-
- <!-- This section allows you to configure where to publish libraries for
- sharing. It is not required and may be deleted. For more information see:
- http://maven.apache.org/plugins/maven-deploy-plugin/ -->
- <distributionManagement>
- <repository>
- <id>localhost</id>
- <url>file://${basedir}/target/repo/</url>
- </repository>
- <snapshotRepository>
- <id>localhost</id>
- <url>file://${basedir}/target/snapshot-repo/</url>
- </snapshotRepository>
- </distributionManagement>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.superbiz</groupId>
+ <artifactId>multi-jpa-provider-testing</artifactId>
+ <packaging>jar</packaging>
+ <version>1.1.0-SNAPSHOT</version>
+ <name>OpenEJB :: Examples :: Multiple JPA providers</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+
+ <plugin> <!-- run tests twice, once with openjpa and once with hibernate -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.12.4</version>
+ <executions>
+ <execution>
+ <id>test-hibernate</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <systemPropertyVariables>
+ <javax.persistence.provider>org.hibernate.ejb.HibernatePersistence</javax.persistence.provider>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ <execution>
+ <id>test-openjpa</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <systemPropertyVariables>
+ <javax.persistence.provider>org.apache.openjpa.persistence.PersistenceProviderImpl</javax.persistence.provider>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <repositories>
+ <repository>
+ <id>apache-m2-snapshot</id>
+ <name>Apache Snapshot Repository</name>
+ <url>http://repository.apache.org/snapshots</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>javaee-api</artifactId>
+ <version>6.0-4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.10</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>arquillian-openejb-embedded-4</artifactId>
+ <version>4.5.1-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
+ <version>2.0.0-alpha-5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-spi</artifactId>
+ <version>1.1.1-alpha-2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!--
+ don't be shy and put all JPA provider in the classpath
+ otherwise arquillian has some difficulties in embedded mode to find your classes
+ -->
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <version>2.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency> <!-- just a facade pom which will bring hibernate for us -->
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-core-hibernate</artifactId>
+ <version>4.5.1-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+
+ <!-- This section allows you to configure where to publish libraries for
+ sharing. It is not required and may be deleted. For more information see:
+ http://maven.apache.org/plugins/maven-deploy-plugin/ -->
+ <distributionManagement>
+ <repository>
+ <id>localhost</id>
+ <url>file://${basedir}/target/repo/</url>
+ </repository>
+ <snapshotRepository>
+ <id>localhost</id>
+ <url>file://${basedir}/target/snapshot-repo/</url>
+ </snapshotRepository>
+ </distributionManagement>
</project>
Modified: openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java?rev=1415170&r1=1415169&r2=1415170&view=diff
==============================================================================
--- openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java (original)
+++ openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java Thu Nov 29 14:08:18 2012
@@ -23,7 +23,6 @@ import org.superbiz.enricher.maven.Enric
public class HibernateEnricher implements AuxiliaryArchiveProcessor {
@Override
public void process(final Archive<?> auxiliaryArchive) {
- Enrichers.wrap(auxiliaryArchive)
- .addAsLibraries(Enrichers.resolve("src/test/resources/hibernate-pom.xml"));
+ Enrichers.wrap(auxiliaryArchive).addAsLibraries(Enrichers.resolve("src/test/resources/hibernate-pom.xml"));
}
}
Modified: openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java?rev=1415170&r1=1415169&r2=1415170&view=diff
==============================================================================
--- openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java (original)
+++ openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java Thu Nov 29 14:08:18 2012
@@ -23,7 +23,6 @@ import org.superbiz.enricher.maven.Enric
public class OpenJPAEnricher implements AuxiliaryArchiveProcessor {
@Override
public void process(final Archive<?> auxiliaryArchive) {
- Enrichers.wrap(auxiliaryArchive)
- .addAsLibraries(Enrichers.resolve("src/test/resources/openjpa-pom.xml"));
+ Enrichers.wrap(auxiliaryArchive).addAsLibraries(Enrichers.resolve("src/test/resources/openjpa-pom.xml"));
}
}
Modified: openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java?rev=1415170&r1=1415169&r2=1415170&view=diff
==============================================================================
--- openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java (original)
+++ openejb/trunk/openejb/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java Thu Nov 29 14:08:18 2012
@@ -17,8 +17,11 @@
*/
package org.superbiz.enricher.maven;
-import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
-import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
+import org.jboss.shrinkwrap.api.container.LibraryContainer;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+import org.jboss.shrinkwrap.resolver.api.maven.ScopeType;
+import org.jboss.shrinkwrap.resolver.api.maven.strategy.AcceptScopesStrategy;
+import org.jboss.shrinkwrap.resolver.api.maven.strategy.TransitiveStrategy;
import javax.enterprise.inject.ResolutionException;
import java.io.File;
@@ -34,26 +37,28 @@ public final class Enrichers {
public static File[] resolve(final String pom) {
if (!CACHE.containsKey(pom)) {
- try { // try offline first since it is generally faster
- CACHE.put(pom, DependencyResolvers.use(MavenDependencyResolver.class)
- .goOffline()
- .loadMetadataFromPom(pom)
- .scope("compile")
- .resolveAsFiles());
+ try {
+
+ // try offline first since it is generally faster
+ CACHE.put(pom, Maven.resolver()
+ .offline(true)
+ .loadPomFromFile(pom)
+ .importRuntimeAndTestDependencies(new AcceptScopesStrategy(ScopeType.COMPILE))
+ .asFile());
} catch (ResolutionException re) { // try on central
- CACHE.put(pom, DependencyResolvers.use(MavenDependencyResolver.class)
- .loadMetadataFromPom(pom)
- .scope("compile")
- .resolveAsFiles());
+ CACHE.put(pom, Maven.resolver()
+ .loadPomFromFile(pom)
+ .importRuntimeAndTestDependencies(new AcceptScopesStrategy(ScopeType.COMPILE))
+ .asFile());
}
}
return CACHE.get(pom);
}
- public static org.jboss.shrinkwrap.api.spec.WebArchive wrap(final org.jboss.shrinkwrap.api.Archive<?> archive) {
- if (!(org.jboss.shrinkwrap.api.spec.WebArchive.class.isInstance(archive))) {
+ public static LibraryContainer wrap(final org.jboss.shrinkwrap.api.Archive<?> archive) {
+ if (!(LibraryContainer.class.isInstance(archive))) {
throw new IllegalArgumentException("Unsupported archive type: " + archive.getClass().getName());
}
- return (org.jboss.shrinkwrap.api.spec.WebArchive) archive.shallowCopy();
+ return (LibraryContainer) archive;
}
}