tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: supporting @descriptors with file path
Date Tue, 30 Dec 2014 09:34:25 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x b0e4daa5d -> c5ecd884c


supporting @descriptors with file path


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

Branch: refs/heads/tomee-1.7.x
Commit: c5ecd884ccdc1593807529778bb71e6ab358e73d
Parents: b0e4daa
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Tue Dec 30 10:34:19 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Tue Dec 30 10:34:19 2014 +0100

----------------------------------------------------------------------
 .../apache/openejb/testing/ApplicationComposers.java  | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/c5ecd884/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
b/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
index 8ceb48c..5e1863f 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
@@ -1074,12 +1074,22 @@ public final class ApplicationComposers {
             final ClassLoader loader = Thread.currentThread().getContextClassLoader();
             if (descriptors instanceof Descriptors) {
                 for (final Descriptor descriptor : ((Descriptors) descriptors).value()) {
-                    dds.put(descriptor.name(), loader.getResource(descriptor.path()));
+                    URL resource = loader.getResource(descriptor.path());
+                    try {
+                        dds.put(descriptor.name(), resource == null ? new File(descriptor.path()).toURI().toURL()
: null);
+                    } catch (final MalformedURLException e) {
+                        throw new IllegalArgumentException(e);
+                    }
                 }
             } else {
                 if (descriptors instanceof org.apache.openejb.junit.Descriptors) {
                     for (final org.apache.openejb.junit.Descriptor descriptor : ((org.apache.openejb.junit.Descriptors)
descriptors).value()) {
-                        dds.put(descriptor.name(), loader.getResource(descriptor.path()));
+                        URL resource = loader.getResource(descriptor.path());
+                        try {
+                            dds.put(descriptor.name(), resource == null ? new File(descriptor.path()).toURI().toURL()
: null);
+                        } catch (final MalformedURLException e) {
+                            throw new IllegalArgumentException(e);
+                        }
                     }
                 }
             }


Mime
View raw message