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

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 6e3a29d190baaf605347f8ce46fa62b11787c247
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Mar 27 09:37:51 2020 +0000

    Fix deprecation warnings with newer JUnit 4 in 2020.03 Eclipse IDE
---
 test/org/apache/catalina/core/TestStandardContext.java               | 3 ++-
 .../catalina/tribes/group/interceptors/TestEncryptInterceptor.java   | 3 ++-
 test/org/apache/coyote/http2/TestHttp2Limits.java                    | 5 +++--
 test/org/apache/tomcat/util/net/openssl/TestOpenSSLConf.java         | 5 +++--
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/core/TestStandardContext.java 
b/test/org/apache/catalina/core/TestStandardContext.java
index c964909..490abd6 100644
--- a/test/org/apache/catalina/core/TestStandardContext.java
+++ b/test/org/apache/catalina/core/TestStandardContext.java
@@ -47,6 +47,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -985,7 +986,7 @@ public class TestStandardContext extends TomcatBaseTest {
         Context context = new StandardContext();
 
         context.setResourceOnlyServlets("a,b,c");
-        
Assert.assertThat(Arrays.asList(context.getResourceOnlyServlets().split(",")),
+        
MatcherAssert.assertThat(Arrays.asList(context.getResourceOnlyServlets().split(",")),
                 CoreMatchers.hasItems("a", "b", "c"));
     }
 
diff --git 
a/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java
 
b/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java
index 5b76df7..172ca20 100644
--- 
a/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java
+++ 
b/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java
@@ -26,6 +26,7 @@ import java.util.Collection;
 
 import javax.crypto.Cipher;
 
+import org.hamcrest.MatcherAssert;
 import org.hamcrest.core.IsEqual;
 import org.hamcrest.core.IsNot;
 
@@ -371,7 +372,7 @@ public class TestEncryptInterceptor {
 
         byte[] cipherText2 = 
((ValueCaptureInterceptor)src.getNext()).getValue();
 
-        Assert.assertThat("Two identical cleartexts encrypt to the same 
ciphertext",
+        MatcherAssert.assertThat("Two identical cleartexts encrypt to the same 
ciphertext",
                 cipherText1, IsNot.not(IsEqual.equalTo(cipherText2)));
     }
 
diff --git a/test/org/apache/coyote/http2/TestHttp2Limits.java 
b/test/org/apache/coyote/http2/TestHttp2Limits.java
index d5f109f..a8f4458 100644
--- a/test/org/apache/coyote/http2/TestHttp2Limits.java
+++ b/test/org/apache/coyote/http2/TestHttp2Limits.java
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.Random;
 
 import org.hamcrest.Description;
+import org.hamcrest.MatcherAssert;
 import org.hamcrest.TypeSafeMatcher;
 
 import org.junit.Assert;
@@ -265,7 +266,7 @@ public class TestHttp2Limits extends Http2TestBase {
             //       above.
             try {
                 parser.readFrame(true);
-                Assert.assertThat(output.getTrace(), RegexMatcher.matchesRegex(
+                MatcherAssert.assertThat(output.getTrace(), 
RegexMatcher.matchesRegex(
                         "0-Goaway-\\[1\\]-\\[11\\]-\\[" + limitMessage + 
"\\]"));
             } catch (IOException se) {
                 // Expected on some platforms
@@ -505,7 +506,7 @@ public class TestHttp2Limits extends Http2TestBase {
             // the escaped values.
             String limitMessage = sm.getString("http2Parser.headerLimitSize", 
"\\d++", "3");
             limitMessage = limitMessage.replace("[", "\\[").replace("]", 
"\\]");
-            Assert.assertThat(output.getTrace(), RegexMatcher.matchesRegex(
+            MatcherAssert.assertThat(output.getTrace(), 
RegexMatcher.matchesRegex(
                     "0-Goaway-\\[3\\]-\\[11\\]-\\[" + limitMessage + "\\]"));
             break;
         }
diff --git a/test/org/apache/tomcat/util/net/openssl/TestOpenSSLConf.java 
b/test/org/apache/tomcat/util/net/openssl/TestOpenSSLConf.java
index 031d115..089bd3f 100644
--- a/test/org/apache/tomcat/util/net/openssl/TestOpenSSLConf.java
+++ b/test/org/apache/tomcat/util/net/openssl/TestOpenSSLConf.java
@@ -21,6 +21,7 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 
 import org.junit.Assert;
 import org.junit.Assume;
@@ -97,10 +98,10 @@ public class TestOpenSSLConf extends TomcatBaseTest {
             sslHostConfig = initOpenSSLConfCmd("CipherString", ENABLED_CIPHER);
         }
         String[] ciphers = sslHostConfig.getEnabledCiphers();
-        Assert.assertThat("Wrong HostConfig ciphers", ciphers,
+        MatcherAssert.assertThat("Wrong HostConfig ciphers", ciphers,
                 CoreMatchers.is(EXPECTED_CIPHERS));
         ciphers = 
SSLContext.getCiphers(sslHostConfig.getOpenSslContext().longValue());
-        Assert.assertThat("Wrong native SSL context ciphers", ciphers,
+        MatcherAssert.assertThat("Wrong native SSL context ciphers", ciphers,
                 CoreMatchers.is(EXPECTED_CIPHERS));
     }
 


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

Reply via email to