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 2018/10/02 21:39:58 UTC

svn commit: r1842657 - in /tomcat/trunk/test/org/apache: catalina/startup/TomcatBaseTest.java catalina/webresources/TestAbstractArchiveResource.java catalina/webresources/TestFileResource.java coyote/http2/Http2TestBase.java

Author: isapir
Date: Tue Oct  2 21:39:57 2018
New Revision: 1842657

URL: http://svn.apache.org/viewvc?rev=1842657&view=rev
Log:
Fixed test cases that errored due to path case sentsitivity on Windows

e.g. Testcase: testNestedJarGetURL took 2.628 sec
 FAILED
expected:<jar:war:file:/[e]:/Workspace/git/tomc...> but was:<jar:war:file:/[E]:/Workspace/git/tomc...>
junit.framework.AssertionFailedError: expected:<jar:war:file:/[e]:/Workspace/git/tomc...> but was:<jar:war:file:/[E]:/Workspace/git/tomc...>
 at org.apache.catalina.webresources.TestAbstractArchiveResource.testNestedJarGetURL(TestAbstractArchiveResource.java:51)

Modified:
    tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
    tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
    tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java
    tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java

Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=1842657&r1=1842656&r2=1842657&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Tue Oct  2 21:39:57 2018
@@ -88,6 +88,7 @@ public abstract class TomcatBaseTest ext
     protected static final int DEFAULT_CLIENT_TIMEOUT_MS = 300_000;
 
     public static final String TEMP_DIR = System.getProperty("java.io.tmpdir");
+    public static final String OS_NAME = System.getProperty("os.name");
 
     /**
      * Make the Tomcat instance available to sub-classes.
@@ -148,6 +149,13 @@ public abstract class TomcatBaseTest ext
         return accessLogEnabled;
     }
 
+    /*
+     * Sub-classes may need to test differently on Windows, e.g. case-insensitive file paths
+     */
+    public boolean isWindows() {
+        return OS_NAME.startsWith("Windows");
+    }
+
     @Before
     @Override
     public void setUp() throws Exception {

Modified: tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java?rev=1842657&r1=1842656&r2=1842657&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java (original)
+++ tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java Tue Oct  2 21:39:57 2018
@@ -48,7 +48,15 @@ public class TestAbstractArchiveResource
         expectedURL.append(docBase.getAbsoluteFile().toURI().toURL().toString());
         expectedURL.append("*/WEB-INF/lib/test.jar!/META-INF/resources/index.html");
 
-        Assert.assertEquals(expectedURL.toString(), webResource.getURL().toString());
+        String expected = expectedURL.toString();
+        String actual = webResource.getURL().toString();
+
+        if (isWindows()){
+            expected = expected.toLowerCase();
+            actual = actual.toLowerCase();
+        }
+
+        Assert.assertEquals(expected, actual);
     }
 
 
@@ -71,7 +79,15 @@ public class TestAbstractArchiveResource
         expectedURL.append(docBase.getAbsoluteFile().toURI().toURL().toString());
         expectedURL.append("WEB-INF/lib/test-lib.jar!/META-INF/tags/echo.tag");
 
-        Assert.assertEquals(expectedURL.toString(), webResource.getURL().toString());
+        String expected = expectedURL.toString();
+        String actual = webResource.getURL().toString();
+
+        if (isWindows()){
+            expected = expected.toLowerCase();
+            actual = actual.toLowerCase();
+        }
+
+        Assert.assertEquals(expected, actual);
     }
 
 }

Modified: tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java?rev=1842657&r1=1842656&r2=1842657&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java (original)
+++ tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java Tue Oct  2 21:39:57 2018
@@ -40,6 +40,15 @@ public class TestFileResource extends To
 
         // 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.toURI().toURL().toString(), out.toString().trim());
+
+        String expected = f.toURI().toURL().toString();
+        String actual = out.toString().trim();
+
+        if (isWindows()){
+            expected = expected.toLowerCase();
+            actual = actual.toLowerCase();
+        }
+
+        Assert.assertEquals(expected, actual);
     }
 }

Modified: tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java?rev=1842657&r1=1842656&r2=1842657&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java Tue Oct  2 21:39:57 2018
@@ -838,7 +838,7 @@ public abstract class Http2TestBase exte
                     connector.getProtocolHandlerClassName().contains("Nio2"));
 
             Assume.assumeTrue("This test is only expected to trigger an exception on Windo9ws",
-                    System.getProperty("os.name").startsWith("Windows"));
+                    isWindows());
         }
     }
 



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


Re: svn commit: r1842657 - in /tomcat/trunk/test/org/apache: catalina/startup/TomcatBaseTest.java catalina/webresources/TestAbstractArchiveResource.java catalina/webresources/TestFileResource.java coyote/http2/Http2TestBase.java

Posted by Mark Thomas <ma...@apache.org>.
On 03/10/18 11:17, Mark Thomas wrote:
> On 02/10/18 22:39, isapir@apache.org wrote:
>> Author: isapir
>> Date: Tue Oct  2 21:39:57 2018
>> New Revision: 1842657
>>
>> URL: http://svn.apache.org/viewvc?rev=1842657&view=rev
>> Log:
>> Fixed test cases that errored due to path case sentsitivity on Windows
> 
> This looks to be addressing the symptom rather than the root cause.
> 
> URLs should be case sensitive so converting them to lower case before
> comparing them may hide future regressions.
> 
> I suspect an issue with getAbsolutePath() vs getCanonicalPath() but that
> is only a guess as to what the root cause might be.
> 
> I'm looking to see if I can recreate the original problem.

Found it. The basis of all the resource URLs is the Context's docBase.
It is using getCanonicalPath() (actually there is a case where it
doesn't - that is a separate bug).

The unit test therefore needs to use getCanonicalPath() as well.

Fixed in svn.

Mark

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


Re: svn commit: r1842657 - in /tomcat/trunk/test/org/apache: catalina/startup/TomcatBaseTest.java catalina/webresources/TestAbstractArchiveResource.java catalina/webresources/TestFileResource.java coyote/http2/Http2TestBase.java

Posted by Mark Thomas <ma...@apache.org>.
On 02/10/18 22:39, isapir@apache.org wrote:
> Author: isapir
> Date: Tue Oct  2 21:39:57 2018
> New Revision: 1842657
> 
> URL: http://svn.apache.org/viewvc?rev=1842657&view=rev
> Log:
> Fixed test cases that errored due to path case sentsitivity on Windows

This looks to be addressing the symptom rather than the root cause.

URLs should be case sensitive so converting them to lower case before
comparing them may hide future regressions.

I suspect an issue with getAbsolutePath() vs getCanonicalPath() but that
is only a guess as to what the root cause might be.

I'm looking to see if I can recreate the original problem.

Mark


> 
> e.g. Testcase: testNestedJarGetURL took 2.628 sec
>  FAILED
> expected:<jar:war:file:/[e]:/Workspace/git/tomc...> but was:<jar:war:file:/[E]:/Workspace/git/tomc...>
> junit.framework.AssertionFailedError: expected:<jar:war:file:/[e]:/Workspace/git/tomc...> but was:<jar:war:file:/[E]:/Workspace/git/tomc...>
>  at org.apache.catalina.webresources.TestAbstractArchiveResource.testNestedJarGetURL(TestAbstractArchiveResource.java:51)
> 
> Modified:
>     tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
>     tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
>     tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java
>     tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
> 
> Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=1842657&r1=1842656&r2=1842657&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
> +++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Tue Oct  2 21:39:57 2018
> @@ -88,6 +88,7 @@ public abstract class TomcatBaseTest ext
>      protected static final int DEFAULT_CLIENT_TIMEOUT_MS = 300_000;
>  
>      public static final String TEMP_DIR = System.getProperty("java.io.tmpdir");
> +    public static final String OS_NAME = System.getProperty("os.name");
>  
>      /**
>       * Make the Tomcat instance available to sub-classes.
> @@ -148,6 +149,13 @@ public abstract class TomcatBaseTest ext
>          return accessLogEnabled;
>      }
>  
> +    /*
> +     * Sub-classes may need to test differently on Windows, e.g. case-insensitive file paths
> +     */
> +    public boolean isWindows() {
> +        return OS_NAME.startsWith("Windows");
> +    }
> +
>      @Before
>      @Override
>      public void setUp() throws Exception {
> 
> Modified: tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java?rev=1842657&r1=1842656&r2=1842657&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java (original)
> +++ tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java Tue Oct  2 21:39:57 2018
> @@ -48,7 +48,15 @@ public class TestAbstractArchiveResource
>          expectedURL.append(docBase.getAbsoluteFile().toURI().toURL().toString());
>          expectedURL.append("*/WEB-INF/lib/test.jar!/META-INF/resources/index.html");
>  
> -        Assert.assertEquals(expectedURL.toString(), webResource.getURL().toString());
> +        String expected = expectedURL.toString();
> +        String actual = webResource.getURL().toString();
> +
> +        if (isWindows()){
> +            expected = expected.toLowerCase();
> +            actual = actual.toLowerCase();
> +        }
> +
> +        Assert.assertEquals(expected, actual);
>      }
>  
>  
> @@ -71,7 +79,15 @@ public class TestAbstractArchiveResource
>          expectedURL.append(docBase.getAbsoluteFile().toURI().toURL().toString());
>          expectedURL.append("WEB-INF/lib/test-lib.jar!/META-INF/tags/echo.tag");
>  
> -        Assert.assertEquals(expectedURL.toString(), webResource.getURL().toString());
> +        String expected = expectedURL.toString();
> +        String actual = webResource.getURL().toString();
> +
> +        if (isWindows()){
> +            expected = expected.toLowerCase();
> +            actual = actual.toLowerCase();
> +        }
> +
> +        Assert.assertEquals(expected, actual);
>      }
>  
>  }
> 
> Modified: tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java?rev=1842657&r1=1842656&r2=1842657&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java (original)
> +++ tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java Tue Oct  2 21:39:57 2018
> @@ -40,6 +40,15 @@ public class TestFileResource extends To
>  
>          // 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.toURI().toURL().toString(), out.toString().trim());
> +
> +        String expected = f.toURI().toURL().toString();
> +        String actual = out.toString().trim();
> +
> +        if (isWindows()){
> +            expected = expected.toLowerCase();
> +            actual = actual.toLowerCase();
> +        }
> +
> +        Assert.assertEquals(expected, actual);
>      }
>  }
> 
> Modified: tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java?rev=1842657&r1=1842656&r2=1842657&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java (original)
> +++ tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java Tue Oct  2 21:39:57 2018
> @@ -838,7 +838,7 @@ public abstract class Http2TestBase exte
>                      connector.getProtocolHandlerClassName().contains("Nio2"));
>  
>              Assume.assumeTrue("This test is only expected to trigger an exception on Windo9ws",
> -                    System.getProperty("os.name").startsWith("Windows"));
> +                    isWindows());
>          }
>      }
>  
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


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


Re: svn commit: r1842657 - in /tomcat/trunk/test/org/apache: catalina/startup/TomcatBaseTest.java catalina/webresources/TestAbstractArchiveResource.java catalina/webresources/TestFileResource.java coyote/http2/Http2TestBase.java

Posted by Igal Sapir <is...@apache.org>.
Rainer,

On 10/2/2018 3:03 PM, Igal Sapir wrote:
> Hi Rainer,
>
> On 10/2/2018 2:54 PM, Rainer Jung wrote:
>> Hi Igal,
>>
>> Am 02.10.2018 um 23:39 schrieb isapir@apache.org:
>>> Author: isapir
>>> Date: Tue Oct  2 21:39:57 2018
>>> New Revision: 1842657
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1842657&view=rev
>>> Log:
>>> Fixed test cases that errored due to path case sentsitivity on Windows
>>
>> I looked at our compat classes an hour ago for totally different 
>> reasons, but I noticed something you might want to use:
>>
>> import org.apache.tomcat.util.compat.JrePlatform;
>>
>>         if (JrePlatform.IS_WINDOWS) ...
>>
>
> Thanks for pointing that out.  I was trying to find out how it was 
> done elsewhere in the code and saw
>
>     System.getProperty("os.name").startsWith("Windows"));
>
> at 
> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java?r1=1842657&r2=1842656&pathrev=1842657
>
> So I based my patch on that.  I will update my patch according to your 
> feedback, which is a much cleaner solution.

Corrected in r1842664.

Thanks,

Igal



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


Re: svn commit: r1842657 - in /tomcat/trunk/test/org/apache: catalina/startup/TomcatBaseTest.java catalina/webresources/TestAbstractArchiveResource.java catalina/webresources/TestFileResource.java coyote/http2/Http2TestBase.java

Posted by Igal Sapir <is...@apache.org>.
Hi Rainer,

On 10/2/2018 2:54 PM, Rainer Jung wrote:
> Hi Igal,
>
> Am 02.10.2018 um 23:39 schrieb isapir@apache.org:
>> Author: isapir
>> Date: Tue Oct  2 21:39:57 2018
>> New Revision: 1842657
>>
>> URL: http://svn.apache.org/viewvc?rev=1842657&view=rev
>> Log:
>> Fixed test cases that errored due to path case sentsitivity on Windows
>
> I looked at our compat classes an hour ago for totally different 
> reasons, but I noticed something you might want to use:
>
> import org.apache.tomcat.util.compat.JrePlatform;
>
>         if (JrePlatform.IS_WINDOWS) ...
>

Thanks for pointing that out.  I was trying to find out how it was done 
elsewhere in the code and saw

     System.getProperty("os.name").startsWith("Windows"));

at 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java?r1=1842657&r2=1842656&pathrev=1842657

So I based my patch on that.  I will update my patch according to your 
feedback, which is a much cleaner solution.

Thanks,

Igal






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


Re: svn commit: r1842657 - in /tomcat/trunk/test/org/apache: catalina/startup/TomcatBaseTest.java catalina/webresources/TestAbstractArchiveResource.java catalina/webresources/TestFileResource.java coyote/http2/Http2TestBase.java

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Igal,

Am 02.10.2018 um 23:39 schrieb isapir@apache.org:
> Author: isapir
> Date: Tue Oct  2 21:39:57 2018
> New Revision: 1842657
> 
> URL: http://svn.apache.org/viewvc?rev=1842657&view=rev
> Log:
> Fixed test cases that errored due to path case sentsitivity on Windows

...

> Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=1842657&r1=1842656&r2=1842657&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
> +++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Tue Oct  2 21:39:57 2018
> @@ -88,6 +88,7 @@ public abstract class TomcatBaseTest ext
>       protected static final int DEFAULT_CLIENT_TIMEOUT_MS = 300_000;
>   
>       public static final String TEMP_DIR = System.getProperty("java.io.tmpdir");
> +    public static final String OS_NAME = System.getProperty("os.name");
>   
>       /**
>        * Make the Tomcat instance available to sub-classes.
> @@ -148,6 +149,13 @@ public abstract class TomcatBaseTest ext
>           return accessLogEnabled;
>       }
>   
> +    /*
> +     * Sub-classes may need to test differently on Windows, e.g. case-insensitive file paths
> +     */
> +    public boolean isWindows() {
> +        return OS_NAME.startsWith("Windows");
> +    }
> +
>       @Before
>       @Override
>       public void setUp() throws Exception {

I looked at our compat classes an hour ago for totally different 
reasons, but I noticed something you might want to use:

import org.apache.tomcat.util.compat.JrePlatform;

         if (JrePlatform.IS_WINDOWS) ...

Regards,

Rainer

> Modified: tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java?rev=1842657&r1=1842656&r2=1842657&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java (original)
> +++ tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java Tue Oct  2 21:39:57 2018
> @@ -48,7 +48,15 @@ public class TestAbstractArchiveResource
>           expectedURL.append(docBase.getAbsoluteFile().toURI().toURL().toString());
>           expectedURL.append("*/WEB-INF/lib/test.jar!/META-INF/resources/index.html");
>   
> -        Assert.assertEquals(expectedURL.toString(), webResource.getURL().toString());
> +        String expected = expectedURL.toString();
> +        String actual = webResource.getURL().toString();
> +
> +        if (isWindows()){
> +            expected = expected.toLowerCase();
> +            actual = actual.toLowerCase();
> +        }
> +
> +        Assert.assertEquals(expected, actual);
>       }
>   
>   
> @@ -71,7 +79,15 @@ public class TestAbstractArchiveResource
>           expectedURL.append(docBase.getAbsoluteFile().toURI().toURL().toString());
>           expectedURL.append("WEB-INF/lib/test-lib.jar!/META-INF/tags/echo.tag");
>   
> -        Assert.assertEquals(expectedURL.toString(), webResource.getURL().toString());
> +        String expected = expectedURL.toString();
> +        String actual = webResource.getURL().toString();
> +
> +        if (isWindows()){
> +            expected = expected.toLowerCase();
> +            actual = actual.toLowerCase();
> +        }
> +
> +        Assert.assertEquals(expected, actual);
>       }
>   
>   }
> 
> Modified: tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java?rev=1842657&r1=1842656&r2=1842657&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java (original)
> +++ tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java Tue Oct  2 21:39:57 2018
> @@ -40,6 +40,15 @@ public class TestFileResource extends To
>   
>           // 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.toURI().toURL().toString(), out.toString().trim());
> +
> +        String expected = f.toURI().toURL().toString();
> +        String actual = out.toString().trim();
> +
> +        if (isWindows()){
> +            expected = expected.toLowerCase();
> +            actual = actual.toLowerCase();
> +        }
> +
> +        Assert.assertEquals(expected, actual);
>       }
>   }
> 
> Modified: tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java?rev=1842657&r1=1842656&r2=1842657&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java (original)
> +++ tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java Tue Oct  2 21:39:57 2018
> @@ -838,7 +838,7 @@ public abstract class Http2TestBase exte
>                       connector.getProtocolHandlerClassName().contains("Nio2"));
>   
>               Assume.assumeTrue("This test is only expected to trigger an exception on Windo9ws",
> -                    System.getProperty("os.name").startsWith("Windows"));
> +                    isWindows());
>           }
>       }

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


Re: svn commit: r1842657 - in /tomcat/trunk/test/org/apache: catalina/startup/TomcatBaseTest.java catalina/webresources/TestAbstractArchiveResource.java catalina/webresources/TestFileResource.java coyote/http2/Http2TestBase.java

Posted by Igal Sapir <is...@apache.org>.
Chris,

Thank you for the feedback:

On 10/3/2018 10:01 AM, Christopher Schultz wrote:
> On 10/2/18 17:39, isapir@apache.org wrote:
>> Author: isapir
>> Date: Tue Oct  2 21:39:57 2018
>> New Revision: 1842657
>>
>> URL: http://svn.apache.org/viewvc?rev=1842657&view=rev
>> Log:
>> Fixed test cases that errored due to path case sentsitivity on Windows
> Perhaps the isWindows() call should be changed to
> isCaseInsensitiveFilesystem() instead? Windows isn't the only OS with
> case-insensitive filesystems.

The isWindows() method was replaced in r1842664 with

     if (JrePlatform.IS_WINDOWS) ...

I'd be happy to add isCaseInsensitiveFilesystem() to JrePlatform, but 
while on Windows I know that it is always the case, I don't think that 
we can go just by the OS Name for other systems.

We can write a temp file with name "a" and then check if "A" exists or 
only "a" does to determine that value.

I can add that to JrePlatform if that makes sense.

>
>> Assume.assumeTrue("This test is only expected to trigger an exception on Windo9ws",
>>
>> Nit: Trivial typo.

That typo was already there but I missed it. Rainer caught it (probably 
while reviewing my patch) and corrected it in r1842659.

Thanks,

Igal


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