You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by is...@apache.org on 2019/04/11 18:28:41 UTC

[tomcat] branch master updated: Fixed false positives in unit tests on Windows

This is an automated email from the ASF dual-hosted git repository.

isapir pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 985d008  Fixed false positives in unit tests on Windows
985d008 is described below

commit 985d0086329c012a994c842f0a88a9b33989827c
Author: Igal Sapir <is...@apache.org>
AuthorDate: Thu Apr 11 08:45:22 2019 -0700

    Fixed false positives in unit tests on Windows
    
    When the drive letter is lower cased in a Windows command prompt the test cases were failing with
    expected:<jar:war:file:/[E]:/Workspace/Test/apa...> but was:<jar:war:file:/[e]:/Workspace/Test/apa...>
---
 .../org/apache/catalina/webresources/TestAbstractArchiveResource.java | 4 ++--
 test/org/apache/catalina/webresources/TestFileResource.java           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java b/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
index 9c59fd8..e573d91 100644
--- a/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
+++ b/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
@@ -48,7 +48,7 @@ public class TestAbstractArchiveResource extends TomcatBaseTest {
         expectedURL.append(docBase.getCanonicalFile().toURI().toURL().toString());
         expectedURL.append("*/WEB-INF/lib/test.jar!/META-INF/resources/index.html");
 
-        Assert.assertEquals(expectedURL.toString(), webResource.getURL().toString());
+        Assert.assertTrue(expectedURL.toString().equalsIgnoreCase(webResource.getURL().toString()));
     }
 
 
@@ -71,7 +71,7 @@ public class TestAbstractArchiveResource extends TomcatBaseTest {
         expectedURL.append(docBase.getCanonicalFile().toURI().toURL().toString());
         expectedURL.append("WEB-INF/lib/test-lib.jar!/META-INF/tags/echo.tag");
 
-        Assert.assertEquals(expectedURL.toString(), webResource.getURL().toString());
+        Assert.assertTrue(expectedURL.toString().equalsIgnoreCase(webResource.getURL().toString()));
     }
 
 }
diff --git a/test/org/apache/catalina/webresources/TestFileResource.java b/test/org/apache/catalina/webresources/TestFileResource.java
index 315212a..2bd7ef3 100644
--- a/test/org/apache/catalina/webresources/TestFileResource.java
+++ b/test/org/apache/catalina/webresources/TestFileResource.java
@@ -40,6 +40,6 @@ public class TestFileResource extends TomcatBaseTest {
 
         // Build the expected location the same way the webapp base dir is built
         File f = new File("test/webapp/WEB-INF/classes");
-        Assert.assertEquals(f.getCanonicalFile().toURI().toURL().toString(), out.toString().trim());
+        Assert.assertTrue(f.getCanonicalFile().toURI().toURL().toString().equalsIgnoreCase(out.toString().trim()));
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org