You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2012/08/24 01:33:31 UTC
svn commit: r829967 - in /websites/staging/openejb/trunk: cgi-bin/ content/
content/examples-trunk/ content/examples-trunk/multi-jpa-provider-testing/
content/examples-trunk/multi-jpa-provider-testing/src/
content/examples-trunk/multi-jpa-provider-test...
Author: buildbot
Date: Thu Aug 23 23:33:30 2012
New Revision: 829967
Log:
Staging update by buildbot for openejb
Added:
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/pom.xml (with props)
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/java/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/java/org/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/java/org/superbiz/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/java/org/superbiz/model/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/resources/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/resources/META-INF/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/resources/META-INF/persistence.xml (with props)
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/arquillian.xml (with props)
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/hibernate-pom.xml (with props)
websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/openjpa-pom.xml (with props)
Modified:
websites/staging/openejb/trunk/cgi-bin/ (props changed)
websites/staging/openejb/trunk/content/ (props changed)
websites/staging/openejb/trunk/content/examples-trunk/pom.xml
Propchange: websites/staging/openejb/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Aug 23 23:33:30 2012
@@ -1 +1 @@
-1376763
+1376776
Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Aug 23 23:33:30 2012
@@ -1 +1 @@
-1376763
+1376776
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/pom.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/pom.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java Thu Aug 23 23:33:30 2012
@@ -0,0 +1,42 @@
+/**
+ * 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.superbiz.model;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Person {
+ @Id
+ @GeneratedValue
+ private long id;
+
+ private String name;
+
+ public long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/resources/META-INF/persistence.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/main/resources/META-INF/persistence.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java Thu Aug 23 23:33:30 2012
@@ -0,0 +1,58 @@
+/**
+ * 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.superbiz;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
+import org.jboss.arquillian.transaction.api.annotation.Transactional;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.superbiz.model.Person;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class JPATest {
+ @Deployment
+ public static WebArchive war() {
+ return ShrinkWrap.create(WebArchive.class)
+ .addClass(Person.class)
+ .addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml"), ArchivePaths.create("persistence.xml"));
+ }
+
+ @PersistenceContext
+ private EntityManager em;
+
+ @Test
+ @Transactional(TransactionMode.ROLLBACK)
+ public void persist() {
+ assertNotNull(em);
+
+ // do something with the em
+ final Person p = new Person();
+ p.setName("Apache OpenEJB");
+ em.persist(p);
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java Thu Aug 23 23:33:30 2012
@@ -0,0 +1,29 @@
+/**
+ * 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.superbiz.enricher.jpa;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveProcessor;
+import org.jboss.shrinkwrap.api.Archive;
+import org.superbiz.enricher.maven.Enrichers;
+
+public class HibernateEnricher implements AuxiliaryArchiveProcessor {
+ @Override
+ public void process(final Archive<?> auxiliaryArchive) {
+ Enrichers.wrap(auxiliaryArchive)
+ .addAsLibraries(Enrichers.resolve("src/test/resources/hibernate-pom.xml"));
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java Thu Aug 23 23:33:30 2012
@@ -0,0 +1,38 @@
+/**
+ * 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.superbiz.enricher.jpa;
+
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+// use it with tomee remote adapter
+// in embedded mode simply put all provider in appclassloader
+// otherwise arquillian will be fooled by src/main/java
+public final class JPAEnrichers {
+ private JPAEnrichers() {
+ // no-op
+ }
+
+ public static WebArchive addJPAProvider(final WebArchive war) {
+ final String provider = System.getProperty("javax.persistence.provider");
+ if (provider != null && provider.contains("hibernate")) {
+ new HibernateEnricher().process(war);
+ } else { // default
+ new OpenJPAEnricher().process(war);
+ }
+ return war;
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java Thu Aug 23 23:33:30 2012
@@ -0,0 +1,29 @@
+/**
+ * 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.superbiz.enricher.jpa;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveProcessor;
+import org.jboss.shrinkwrap.api.Archive;
+import org.superbiz.enricher.maven.Enrichers;
+
+public class OpenJPAEnricher implements AuxiliaryArchiveProcessor {
+ @Override
+ public void process(final Archive<?> auxiliaryArchive) {
+ Enrichers.wrap(auxiliaryArchive)
+ .addAsLibraries(Enrichers.resolve("src/test/resources/openjpa-pom.xml"));
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java Thu Aug 23 23:33:30 2012
@@ -0,0 +1,46 @@
+package org.superbiz.enricher.maven;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveProcessor;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
+import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
+import org.jboss.shrinkwrap.resolver.api.maven.filter.ScopeFilter;
+
+import javax.enterprise.inject.ResolutionException;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+public final class Enrichers {
+ private static final Map<String, File[]> CACHE = new HashMap<String, File[]>();
+
+ private Enrichers() {
+ // no-op
+ }
+
+ 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()
+ .loadEffectivePom(pom)
+ .importAnyDependencies(new ScopeFilter("compile"))
+ .resolveAsFiles());
+ } catch (ResolutionException re) { // try on central
+ CACHE.put(pom, DependencyResolvers.use(MavenDependencyResolver.class)
+ .loadEffectivePom(pom)
+ .importAnyDependencies(new ScopeFilter("compile"))
+ .resolveAsFiles());
+ }
+ }
+ return CACHE.get(pom);
+ }
+
+ public static WebArchive wrap(final Archive<?> archive) {
+ if (!(archive instanceof WebArchive)) {
+ throw new IllegalArgumentException("not supported kind of archive: " + archive.getClass().getName());
+ }
+ return (WebArchive) archive;
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/arquillian.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/arquillian.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/hibernate-pom.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/hibernate-pom.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/openjpa-pom.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/multi-jpa-provider-testing/src/test/resources/openjpa-pom.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
Modified: websites/staging/openejb/trunk/content/examples-trunk/pom.xml
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/pom.xml (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/pom.xml Thu Aug 23 23:33:30 2012
@@ -17,7 +17,7 @@
limitations under the License.
-->
<!--test 2-->
-<!-- $Rev: 1376573 $ $Date: 2012-08-23 16:15:30 +0000 (Thu, 23 Aug 2012) $ -->
+<!-- $Rev: 1376776 $ $Date: 2012-08-23 23:33:21 +0000 (Thu, 23 Aug 2012) $ -->
<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>
@@ -79,13 +79,14 @@
<module>jpa-hibernate</module>
<module>jpa-enumerated</module>
<module>jsf-managedBean-and-ejb</module>
- <module>jsf-cdi-and-ejb</module>
+ <module>jsf-cdi-and-ejb</module>
<module>lookup-of-ejbs</module>
<module>lookup-of-ejbs-with-descriptor</module>
<module>mbean-auto-registration</module>
<module>movies-complete-meta</module>
<module>movies-complete</module>
<module>moviefun</module>
+ <module>multi-jpa-provider-testing</module>
<module>multiple-arquillian-adapters</module>
<module>multiple-tomee-arquillian</module>
<module>persistence-fragment</module>