deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject git commit: DELTASPIKE-649 WLS fixes, removing EAR packaging with embedded DS.
Date Mon, 27 Oct 2014 16:19:22 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master c30c6bd06 -> 11a1b1365


DELTASPIKE-649 WLS fixes, removing EAR packaging with embedded DS.


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/11a1b136
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/11a1b136
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/11a1b136

Branch: refs/heads/master
Commit: 11a1b1365b52a9ce8120575eb43afa6840bd8304
Parents: c30c6bd
Author: Thomas Hug <Thomas.Hug@ctp.com>
Authored: Mon Oct 27 17:18:08 2014 +0100
Committer: Thomas Hug <Thomas.Hug@ctp.com>
Committed: Mon Oct 27 17:18:18 2014 +0100

----------------------------------------------------------------------
 .../data/impl/meta/unit/DescriptorReader.java   | 35 +++-----
 .../impl/meta/unit/EntityDescriptorReader.java  |  2 +-
 .../impl/util/cl/AggregatedClassLoader.java     | 93 ++++++++++++++++++++
 .../deltaspike/data/impl/QueryResultTest.java   |  8 +-
 .../data/impl/RepositoryExtensionTest.java      | 12 ++-
 .../impl/audit/AuditEntityListenerTest.java     | 10 +--
 .../data/impl/criteria/CriteriaTest.java        |  8 +-
 .../EntityManagerDelegateHandlerTest.java       |  8 +-
 .../data/impl/handler/EntityManagerTest.java    | 14 ++-
 .../handler/EntityRepositoryHandlerTest.java    | 10 +--
 .../data/impl/handler/QueryHandlerTest.java     |  8 +-
 .../data/impl/mapping/MappedRepositoryTest.java | 22 +++--
 .../meta/unit/OrmXmlBasedRepositoryTest.java    |  5 +-
 .../data/impl/spi/CdiQuerySpiTest.java          | 12 ++-
 .../impl/tx/TransactionalQueryRunnerTest.java   |  8 +-
 .../jpa/QueryStringExtractorFactoryTest.java    |  3 +-
 .../data/test/util/TestDeployments.java         | 18 ----
 .../src/test/resources-weblogic/TestDS-jdbc.xml | 49 -----------
 .../test-mapped-persistence.xml                 |  2 +-
 .../resources-weblogic/test-persistence.xml     |  2 +-
 .../resources-weblogic/weblogic-application.xml | 26 ------
 21 files changed, 162 insertions(+), 193 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/DescriptorReader.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/DescriptorReader.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/DescriptorReader.java
index e2b6285..300b904 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/DescriptorReader.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/DescriptorReader.java
@@ -18,8 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.meta.unit;
 
-import static java.lang.Thread.currentThread;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -27,16 +25,20 @@ import java.util.Collections;
 import java.util.Enumeration;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.apache.deltaspike.data.impl.util.cl.AggregatedClassLoader;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
 abstract class DescriptorReader
 {
+    private static final Logger log = Logger.getLogger(DescriptorReader.class.getName());
 
     private final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
 
@@ -47,7 +49,14 @@ abstract class DescriptorReader
         while (urls.hasMoreElements())
         {
             URL u = urls.nextElement();
-            result.add(readFromUrl(u));
+            try
+            {
+                result.add(readFromUrl(u));
+            }
+            catch (Exception e)
+            {
+                log.log(Level.WARNING, "Could not load " + resource + " from " + u, e);
+            }
         }
         return Collections.unmodifiableList(result);
     }
@@ -59,10 +68,6 @@ abstract class DescriptorReader
 
     Descriptor readFromUrl(URL url) throws IOException
     {
-        if (!exists(url))
-        {
-            throw new IllegalArgumentException("URL does not exist: " + url);
-        }
         InputStream stream = url.openStream();
         try
         {
@@ -90,7 +95,7 @@ abstract class DescriptorReader
             URL url = new URL(baseUrl + resource);
             return readFromUrl(url);
         }
-        catch (IllegalArgumentException e)
+        catch (Exception e)
         {
             return readFromClassPath(resource);
         }
@@ -104,19 +109,7 @@ abstract class DescriptorReader
 
     ClassLoader classLoader()
     {
-        return currentThread().getContextClassLoader();
-    }
-
-    boolean exists(URL url)
-    {
-        try
-        {
-            return url != null && url.openConnection() != null && url.openConnection().getContentLength()
> 0;
-        }
-        catch (IOException e)
-        {
-            return false;
-        }
+        return AggregatedClassLoader.newInstance();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/EntityDescriptorReader.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/EntityDescriptorReader.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/EntityDescriptorReader.java
index f61928f..5f9418c 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/EntityDescriptorReader.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/unit/EntityDescriptorReader.java
@@ -43,7 +43,7 @@ public class EntityDescriptorReader extends DescriptorReader
             Descriptor desc = read(baseUrl, PersistenceUnit.DEFAULT_ORM_PATH);
             return readFromDocument(desc.getDocument());
         }
-        catch (IllegalArgumentException e)
+        catch (Exception e)
         {
             return new MappingFile(Collections.<EntityDescriptor> emptyList(),
                     Collections.<MappedSuperclassDescriptor> emptyList());

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/cl/AggregatedClassLoader.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/cl/AggregatedClassLoader.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/cl/AggregatedClassLoader.java
new file mode 100644
index 0000000..65864c9
--- /dev/null
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/cl/AggregatedClassLoader.java
@@ -0,0 +1,93 @@
+/*
+ * 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.apache.deltaspike.data.impl.util.cl;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+public class AggregatedClassLoader extends ClassLoader
+{
+
+    private final List<ClassLoader> classLoaders;
+
+    public AggregatedClassLoader(List<ClassLoader> classLoaders)
+    {
+        super();
+        this.classLoaders = classLoaders;
+    }
+
+    public static AggregatedClassLoader newInstance()
+    {
+        return new AggregatedClassLoader(Arrays.asList(
+                AggregatedClassLoader.class.getClassLoader(),
+                Thread.currentThread().getContextClassLoader(),
+                ClassLoader.getSystemClassLoader()));
+    }
+
+    @Override
+    public URL getResource(String name)
+    {
+        for (ClassLoader loader : classLoaders)
+        {
+            URL url = loader.getResource(name);
+            if (url != null)
+            {
+                return url;
+            }
+        }
+        return super.getResource(name);
+    }
+
+    @Override
+    public Enumeration<URL> getResources(String name) throws IOException
+    {
+        final Set<URL> result = new LinkedHashSet<URL>();
+        for (ClassLoader loader : classLoaders)
+        {
+            Enumeration<URL> urls = loader.getResources(name);
+            while (urls.hasMoreElements())
+            {
+                result.add(urls.nextElement());
+            }
+        }
+        return new Enumeration<URL>()
+        {
+            private final Iterator<URL> iterator = result.iterator();
+
+            @Override
+            public URL nextElement()
+            {
+                return iterator.next();
+            }
+
+            @Override
+            public boolean hasMoreElements()
+            {
+                return iterator.hasNext();
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/QueryResultTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/QueryResultTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/QueryResultTest.java
index 5efec2d..860763e 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/QueryResultTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/QueryResultTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -57,10 +56,9 @@ public class QueryResultTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(QueryResultTest.class,
-                initDeployment()
-                    .addClasses(SimpleRepository.class)
-                    .addPackage(Simple.class.getPackage()));
+        return initDeployment()
+                .addClasses(SimpleRepository.class)
+                .addPackage(Simple.class.getPackage());
     }
 
     @Inject

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/RepositoryExtensionTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/RepositoryExtensionTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/RepositoryExtensionTest.java
index ffa48bb..6b22985 100755
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/RepositoryExtensionTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/RepositoryExtensionTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertNotNull;
 
@@ -45,12 +44,11 @@ public class RepositoryExtensionTest
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(RepositoryExtensionTest.class,
-                initDeployment()
-                    .addClasses(RepositoryInterface.class,
-                                ExtendedRepositoryInterface.class,
-                                SimpleRepository.class)
-                    .addPackages(true, Simple.class.getPackage()));
+        return initDeployment()
+                .addClasses(RepositoryInterface.class,
+                            ExtendedRepositoryInterface.class,
+                            SimpleRepository.class)
+                .addPackages(true, Simple.class.getPackage());
     }
 
     @Inject

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/audit/AuditEntityListenerTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/audit/AuditEntityListenerTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/audit/AuditEntityListenerTest.java
index fa84a77..3b9efe2 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/audit/AuditEntityListenerTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/audit/AuditEntityListenerTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.audit;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -45,11 +44,10 @@ public class AuditEntityListenerTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(AuditEntityListenerTest.class,
-                initDeployment()
-                    .addPackage(AuditEntityListener.class.getPackage())
-                    .addAsWebInfResource("test-orm.xml", ArchivePaths.create("classes/META-INF/orm.xml"))
-                    .addPackage(AuditedEntity.class.getPackage()));
+        return initDeployment()
+                .addPackage(AuditEntityListener.class.getPackage())
+                .addAsWebInfResource("test-orm.xml", ArchivePaths.create("classes/META-INF/orm.xml"))
+                .addPackage(AuditedEntity.class.getPackage());
     }
 
     @PersistenceContext

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/criteria/CriteriaTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/criteria/CriteriaTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/criteria/CriteriaTest.java
index 63fef58..49c7e79 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/criteria/CriteriaTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/criteria/CriteriaTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.criteria;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -56,10 +55,9 @@ public class CriteriaTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(CriteriaTest.class,
-                initDeployment()
-                    .addClasses(SimpleCriteriaRepository.class, ParentRepository.class, Statistics.class)
-                    .addPackage(Simple.class.getPackage()));
+        return initDeployment()
+                .addClasses(SimpleCriteriaRepository.class, ParentRepository.class, Statistics.class)
+                .addPackage(Simple.class.getPackage());
     }
 
     @Inject

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerDelegateHandlerTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerDelegateHandlerTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerDelegateHandlerTest.java
index b2648f6..ab6a56a 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerDelegateHandlerTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerDelegateHandlerTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.handler;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -43,10 +42,9 @@ public class EntityManagerDelegateHandlerTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(EntityRepositoryHandlerTest.class,
-                initDeployment()
-                    .addClasses(ExtendedRepositoryInterface.class)
-                    .addPackage(Simple.class.getPackage()));
+        return initDeployment()
+                .addClasses(ExtendedRepositoryInterface.class)
+                .addPackage(Simple.class.getPackage());
     }
 
     @Inject

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerTest.java
index fb29f46..d995314 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityManagerTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.handler;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -50,13 +49,12 @@ public class EntityManagerTest
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(EntityManagerTest.class,
-                initDeployment()
-                    .addClasses(SimpleRepositoryWithEntityManager.class,
-                            SimpleRepositoryWithEntityManagerResolver.class,
-                            QualifiedEntityManagerTestProducer.class,
-                            NonQualifiedEntityManagerTestProducer.class,
-                            Simplistic.class, SimplisticEntityManagerResolver.class));
+        return initDeployment()
+                .addClasses(SimpleRepositoryWithEntityManager.class,
+                        SimpleRepositoryWithEntityManagerResolver.class,
+                        QualifiedEntityManagerTestProducer.class,
+                        NonQualifiedEntityManagerTestProducer.class,
+                        Simplistic.class, SimplisticEntityManagerResolver.class);
     }
 
     @Inject

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
index e0944b8..c0cb69c 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.handler;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -50,10 +49,9 @@ public class EntityRepositoryHandlerTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(EntityRepositoryHandlerTest.class,
-                initDeployment()
-                    .addClasses(ExtendedRepositoryInterface.class)
-                    .addPackage(Simple.class.getPackage()));
+        return initDeployment()
+                .addClasses(ExtendedRepositoryInterface.class)
+                .addPackage(Simple.class.getPackage());
     }
 
     @Inject
@@ -102,7 +100,7 @@ public class EntityRepositoryHandlerTest extends TransactionalTestCase
         // when
         simple = repo.saveAndFlush(simple);
         Simple fetch = (Simple) entityManager
-                .createNativeQuery("select * from simple_table where id = ?", Simple.class)
+                .createNativeQuery("select * from SIMPLE_TABLE where id = ?", Simple.class)
                 .setParameter(1, simple.getId())
                 .getSingleResult();
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
index 9be3d02..6b31157 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.handler;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -54,10 +53,9 @@ public class QueryHandlerTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(QueryHandlerTest.class,
-                initDeployment()
-                    .addClasses(SimpleRepository.class, Simple2Repository.class)
-                    .addPackage(Simple.class.getPackage()));
+        return initDeployment()
+                .addClasses(SimpleRepository.class, Simple2Repository.class)
+                .addPackage(Simple.class.getPackage());
     }
 
     @Inject

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/mapping/MappedRepositoryTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/mapping/MappedRepositoryTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/mapping/MappedRepositoryTest.java
index e539446..afea777 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/mapping/MappedRepositoryTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/mapping/MappedRepositoryTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.mapping;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -55,17 +54,16 @@ public class MappedRepositoryTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(MappedRepositoryTest.class,
-                initDeployment()
-                    .addClasses(
-                            SimpleMappedRepository.class,
-                            SimpleMappedDtoRepository.class,
-                            SimpleMapper.class,
-                            WrappedMapper.class,
-                            SimpleQueryInOutMapper.class)
-                    .addPackages(false,
-                            Simple.class.getPackage(),
-                            SimpleDto.class.getPackage()));
+        return initDeployment()
+                .addClasses(
+                        SimpleMappedRepository.class,
+                        SimpleMappedDtoRepository.class,
+                        SimpleMapper.class,
+                        WrappedMapper.class,
+                        SimpleQueryInOutMapper.class)
+                .addPackages(false,
+                        Simple.class.getPackage(),
+                        SimpleDto.class.getPackage());
     }
 
     @Inject

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/OrmXmlBasedRepositoryTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/OrmXmlBasedRepositoryTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/OrmXmlBasedRepositoryTest.java
index 959764a..04a0187 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/OrmXmlBasedRepositoryTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/OrmXmlBasedRepositoryTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.meta.unit;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 
@@ -46,7 +45,7 @@ public class OrmXmlBasedRepositoryTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(OrmXmlBasedRepositoryTest.class, initDeployment("(.*mapped.*)|(.*test.*)")
+        return initDeployment("(.*mapped.*)|(.*test.*)")
                 .addClasses(MappedOneRepository.class)
                 .addAsLibraries(
                         ShrinkWrap.create(JavaArchive.class, "domain.jar")
@@ -55,7 +54,7 @@ public class OrmXmlBasedRepositoryTest extends TransactionalTestCase
                 )
                 .addAsWebInfResource("test-mapped-persistence.xml",
                         ArchivePaths.create("classes/META-INF/persistence.xml"))
-                .addAsWebInfResource("test-default-orm.xml", ArchivePaths.create("classes/META-INF/orm.xml")));
+                .addAsWebInfResource("test-default-orm.xml", ArchivePaths.create("classes/META-INF/orm.xml"));
     }
 
     @Produces

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/spi/CdiQuerySpiTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/spi/CdiQuerySpiTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/spi/CdiQuerySpiTest.java
index f551bf4..df057f4 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/spi/CdiQuerySpiTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/spi/CdiQuerySpiTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.spi;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertNotNull;
 
@@ -45,12 +44,11 @@ public class CdiQuerySpiTest extends TransactionalTestCase
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(CdiQuerySpiTest.class,
-                initDeployment()
-                    .addClasses(MySimpleRepository.class,
-                            MyEntityRepository.class,
-                            MyEntityRepositoryDelegate.class)
-                    .addPackage(Simple.class.getPackage()));
+        return initDeployment()
+                .addClasses(MySimpleRepository.class,
+                        MyEntityRepository.class,
+                        MyEntityRepositoryDelegate.class)
+                .addPackage(Simple.class.getPackage());
     }
 
     @Produces

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java
index 0504cfa..eaf6c17 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.deltaspike.data.impl.tx;
 
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -50,10 +49,9 @@ public class TransactionalQueryRunnerTest
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(TransactionalQueryRunnerTest.class,
-                initDeployment()
-                    .addClasses(ExtendedRepositoryInterface.class)
-                    .addPackage(Simple.class.getPackage()));
+        return initDeployment()
+                .addClasses(ExtendedRepositoryInterface.class)
+                .addPackage(Simple.class.getPackage());
     }
 
     @Inject

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactoryTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactoryTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactoryTest.java
index 26379a7..0c2e4f3 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactoryTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactoryTest.java
@@ -20,7 +20,6 @@ package org.apache.deltaspike.data.impl.util.jpa;
 
 import static java.lang.Thread.currentThread;
 import static java.lang.reflect.Proxy.newProxyInstance;
-import static org.apache.deltaspike.data.test.util.TestDeployments.finalizeDeployment;
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
 import static org.junit.Assert.assertEquals;
 
@@ -53,7 +52,7 @@ public class QueryStringExtractorFactoryTest
     @Deployment
     public static Archive<?> deployment()
     {
-        return finalizeDeployment(QueryStringExtractorFactoryTest.class, initDeployment());
+        return initDeployment();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java
index a9dc8f1..f01dba3 100755
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java
@@ -118,24 +118,6 @@ public abstract class TestDeployments
         return addDependencies(archive);
     }
 
-    public static Archive<?> finalizeDeployment(Class<?> testClass, WebArchive
archive)
-    {
-        if (CdiContainerUnderTest.is("wls-.*"))
-        {
-            archive.addClass(testClass); // see https://issues.jboss.org/browse/ARQ-659
-            EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
-                    .addAsModule(archive);
-            ear.addAsLibraries(Maven.resolver()
-                    .resolve("hsqldb:hsqldb:1.8.0.10")
-                    .withTransitivity()
-                    .asFile());
-            addToEarManifestIfExists(ear, "weblogic-application.xml");
-            addToEarManifestIfExists(ear, "TestDS-jdbc.xml");
-            return ear;
-        }
-        return archive;
-    }
-
     public static Package[] createImplPackages()
     {
         return new Package[] {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/resources-weblogic/TestDS-jdbc.xml
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/resources-weblogic/TestDS-jdbc.xml b/deltaspike/modules/data/impl/src/test/resources-weblogic/TestDS-jdbc.xml
deleted file mode 100644
index 9cfb3e6..0000000
--- a/deltaspike/modules/data/impl/src/test/resources-weblogic/TestDS-jdbc.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<jdbc-data-source xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-jdbc.xsd"
-    xmlns="http://www.bea.com/ns/weblogic/jdbc-data-source">
-    <name>TestDS</name>
-    <jdbc-driver-params>
-        <url>jdbc:hsqldb:.</url>
-        <driver-name>org.hsqldb.jdbcDriver</driver-name>
-        <properties>
-            <property>
-                <name>user</name>
-                <value>sa</value>
-            </property>
-            <property>
-                <name>password</name>
-                <value></value>
-            </property>
-        </properties>
-    </jdbc-driver-params>
-
-    <jdbc-connection-pool-params>
-        <initial-capacity>2</initial-capacity>
-        <max-capacity>10</max-capacity>
-        <test-connections-on-reserve>false</test-connections-on-reserve>
-    </jdbc-connection-pool-params>
-
-    <jdbc-data-source-params>
-        <jndi-name>TestDS</jndi-name>
-        <scope>Application</scope>
-        <global-transactions-protocol>TwoPhaseCommit</global-transactions-protocol>
-    </jdbc-data-source-params>
-</jdbc-data-source>

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/resources-weblogic/test-mapped-persistence.xml
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/resources-weblogic/test-mapped-persistence.xml
b/deltaspike/modules/data/impl/src/test/resources-weblogic/test-mapped-persistence.xml
index 78bc349..56224df 100644
--- a/deltaspike/modules/data/impl/src/test/resources-weblogic/test-mapped-persistence.xml
+++ b/deltaspike/modules/data/impl/src/test/resources-weblogic/test-mapped-persistence.xml
@@ -20,7 +20,7 @@
 <persistence version="2.0" 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">
     <persistence-unit name="test"> 
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-        <jta-data-source>java:/app/jdbc/TestDS</jta-data-source>
+        <jta-data-source>TestDS</jta-data-source>
         <mapping-file>META-INF/orm.xml</mapping-file>
         <mapping-file>META-INF/custom-orm.xml</mapping-file>
         <properties>

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/resources-weblogic/test-persistence.xml
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/resources-weblogic/test-persistence.xml
b/deltaspike/modules/data/impl/src/test/resources-weblogic/test-persistence.xml
index beef4f2..4e66f89 100644
--- a/deltaspike/modules/data/impl/src/test/resources-weblogic/test-persistence.xml
+++ b/deltaspike/modules/data/impl/src/test/resources-weblogic/test-persistence.xml
@@ -20,7 +20,7 @@
 <persistence version="2.0" 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">
     <persistence-unit name="test"> 
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-        <jta-data-source>java:/app/jdbc/TestDS</jta-data-source>
+        <jta-data-source>TestDS</jta-data-source>
         <properties>
             <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
             <property name="eclipselink.logging.level" value="FINE"/>

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/11a1b136/deltaspike/modules/data/impl/src/test/resources-weblogic/weblogic-application.xml
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/resources-weblogic/weblogic-application.xml
b/deltaspike/modules/data/impl/src/test/resources-weblogic/weblogic-application.xml
deleted file mode 100644
index 9c9328b..0000000
--- a/deltaspike/modules/data/impl/src/test/resources-weblogic/weblogic-application.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<wls:weblogic-application xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application"
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/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application
http://xmlns.oracle.com/weblogic/weblogic-application/1.4/weblogic-application.xsd">
-    <wls:module>
-        <wls:name>TestDS</wls:name>
-        <wls:type>JDBC</wls:type>
-        <wls:path>META-INF/TestDS-jdbc.xml</wls:path>
-    </wls:module>
-</wls:weblogic-application>


Mime
View raw message