incubator-deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject git commit: DELTASPIKE-35 fix Arquillian bug under Windows
Date Wed, 28 Dec 2011 20:27:51 GMT
Updated Branches:
  refs/heads/master b16cb0f91 -> d5b218ce9


DELTASPIKE-35 fix Arquillian bug under Windows


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

Branch: refs/heads/master
Commit: d5b218ce9c407d105863f6992f3d2f12be95f29e
Parents: b16cb0f
Author: Mark Struberg <struberg@apache.org>
Authored: Wed Dec 28 21:26:20 2011 +0100
Committer: Mark Struberg <struberg@apache.org>
Committed: Wed Dec 28 21:26:20 2011 +0100

----------------------------------------------------------------------
 .../test/api/provider/BeanManagerProviderTest.java |    3 +-
 .../api/temptestutil/ShrinkWrapArchiveUtil.java    |   16 ++++++++++----
 2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/d5b218ce/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/provider/BeanManagerProviderTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/provider/BeanManagerProviderTest.java
b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/provider/BeanManagerProviderTest.java
index ee1a1a7..8dc8d59 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/provider/BeanManagerProviderTest.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/provider/BeanManagerProviderTest.java
@@ -52,7 +52,8 @@ public class BeanManagerProviderTest
     }
     
     @Test
-    public void testBeanManagerProvider() throws Exception {
+    public void testBeanManagerProvider() throws Exception
+    {
             BeanManagerProvider bmp = BeanManagerProvider.getInstance();
             Assert.assertNotNull(bmp);
 

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/d5b218ce/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/temptestutil/ShrinkWrapArchiveUtil.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/temptestutil/ShrinkWrapArchiveUtil.java
b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/temptestutil/ShrinkWrapArchiveUtil.java
index 24eb054..dd6da85 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/temptestutil/ShrinkWrapArchiveUtil.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/core/test/api/temptestutil/ShrinkWrapArchiveUtil.java
@@ -150,7 +150,7 @@ public class ShrinkWrapArchiveUtil
                 }
 
                 if (entryName.endsWith(".class")) {
-                    String className = entryName.substring(0, entryName.length()-(".class".length())).replace('/',
'.');
+                    String className = pathToClassName(entryName.substring(0, entryName.length()-(".class".length())));
                     javaArchive.addClass(className);
                 }
                 else {
@@ -202,11 +202,12 @@ public class ShrinkWrapArchiveUtil
             }
 
             if (entryName.endsWith(".class")) {
-                String className = entryName.substring(0, entryName.length()-(".class".length())).replace('/',
'.');
+                String className = pathToClassName(entryName.substring(0, entryName.length()-(".class".length())));
+
                 javaArchive.addClass(className);
             }
             else {
-                javaArchive.addAsResource(entryName);
+                javaArchive.addAsResource(entryName.replace('\\', '/'));
             }
         }
 
@@ -237,7 +238,7 @@ public class ShrinkWrapArchiveUtil
 
     private static boolean excludeIfPackageExists(String jarEntryName, String[] excludeOnPackages)
{
         if (excludeOnPackages != null) {
-            String packageName = jarEntryName.replace('/' ,'.');
+            String packageName = pathToClassName(jarEntryName);
 
             for (String excludeOnPackage : excludeOnPackages) {
                 if (packageName.startsWith(excludeOnPackage)) {
@@ -254,7 +255,7 @@ public class ShrinkWrapArchiveUtil
             return true;
         }
 
-        String packageName = jarEntryName.replace('/' ,'.');
+        String packageName = pathToClassName(jarEntryName);
 
         for (String includeOnPackage : includeOnPackages) {
             if (packageName.startsWith(includeOnPackage)) {
@@ -289,4 +290,9 @@ public class ShrinkWrapArchiveUtil
         return url;
     }
 
+    private static String pathToClassName(String pathName) {
+        return pathName.replace('/', '.').replace('\\', '.');   // replace unix and windows
separators
+    }
+
+
 }


Mime
View raw message