tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From isa...@apache.org
Subject svn commit: r1842664 - in /tomcat/trunk/test/org/apache: catalina/startup/TomcatBaseTest.java catalina/webresources/TestAbstractArchiveResource.java catalina/webresources/TestFileResource.java coyote/http2/Http2TestBase.java
Date Tue, 02 Oct 2018 22:25:37 GMT
Author: isapir
Date: Tue Oct  2 22:25:37 2018
New Revision: 1842664

URL: http://svn.apache.org/viewvc?rev=1842664&view=rev
Log:
Refactored r1842657 to use o.a.t.util.compat.JrePlatform per feedback

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=1842664&r1=1842663&r2=1842664&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Tue Oct  2 22:25:37
2018
@@ -88,7 +88,6 @@ 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.
@@ -149,13 +148,6 @@ 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=1842664&r1=1842663&r2=1842664&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java (original)
+++ tomcat/trunk/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java Tue
Oct  2 22:25:37 2018
@@ -18,6 +18,7 @@ package org.apache.catalina.webresources
 
 import java.io.File;
 
+import org.apache.tomcat.util.compat.JrePlatform;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -51,7 +52,7 @@ public class TestAbstractArchiveResource
         String expected = expectedURL.toString();
         String actual = webResource.getURL().toString();
 
-        if (isWindows()){
+        if (JrePlatform.IS_WINDOWS){
             expected = expected.toLowerCase();
             actual = actual.toLowerCase();
         }
@@ -82,7 +83,7 @@ public class TestAbstractArchiveResource
         String expected = expectedURL.toString();
         String actual = webResource.getURL().toString();
 
-        if (isWindows()){
+        if (JrePlatform.IS_WINDOWS){
             expected = expected.toLowerCase();
             actual = actual.toLowerCase();
         }

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=1842664&r1=1842663&r2=1842664&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java (original)
+++ tomcat/trunk/test/org/apache/catalina/webresources/TestFileResource.java Tue Oct  2 22:25:37
2018
@@ -20,6 +20,7 @@ import java.io.File;
 
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.tomcat.util.compat.JrePlatform;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -44,7 +45,7 @@ public class TestFileResource extends To
         String expected = f.toURI().toURL().toString();
         String actual = out.toString().trim();
 
-        if (isWindows()){
+        if (JrePlatform.IS_WINDOWS){
             expected = expected.toLowerCase();
             actual = actual.toLowerCase();
         }

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=1842664&r1=1842663&r2=1842664&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java Tue Oct  2 22:25:37 2018
@@ -49,6 +49,7 @@ import org.apache.coyote.http2.HpackDeco
 import org.apache.coyote.http2.Http2Parser.Input;
 import org.apache.coyote.http2.Http2Parser.Output;
 import org.apache.tomcat.util.codec.binary.Base64;
+import org.apache.tomcat.util.compat.JrePlatform;
 import org.apache.tomcat.util.http.MimeHeaders;
 
 /**
@@ -838,7 +839,7 @@ public abstract class Http2TestBase exte
                     connector.getProtocolHandlerClassName().contains("Nio2"));
 
             Assume.assumeTrue("This test is only expected to trigger an exception on Windows",
-                    isWindows());
+                    JrePlatform.IS_WINDOWS);
         }
     }
 



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


Mime
View raw message