You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2017/11/13 12:32:27 UTC
svn commit: r1815093 [1/6] - in /tomcat/tc7.0.x/trunk:
modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ test/javax/el/
test/javax/servlet/jsp/ test/org/apache/catalina/ant/
test/org/apache/catalina/authenticator/ test/org/apache/catalina/co...
Author: markt
Date: Mon Nov 13 12:32:26 2017
New Revision: 1815093
URL: http://svn.apache.org/viewvc?rev=1815093&view=rev
Log:
Remove use of all static Assert.* imports
- fixes Gump errors with latest Checkstyle
- doesn't introduce errors for older Checkstyle
- makes unit tests consistent with use of Assert
Modified:
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/BorrowWaitTest.java
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StarvationTest.java
tomcat/tc7.0.x/trunk/test/javax/el/TestCompositeELResolver.java
tomcat/tc7.0.x/trunk/test/javax/servlet/jsp/TestPageContext.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/ant/TestDeployTask.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestFormAuthenticator.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TesterDigestAuthenticatorPerformance.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/comet/TestCometProcessor.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestConnector.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestRequest.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponse.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestSendFile.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationSessionCookieConfig.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestDefaultInstanceManager.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestNamingContextListener.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextAliases.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextValve.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardWrapper.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/deploy/TestSecurityConstraint.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/deploy/TestWebXmlOrdering.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestAddCharSetFilter.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter2.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestRemoteIpFilter.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestRestCsrfPreventionFilter.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/filters/TestRestCsrfPreventionFilter2.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/ha/session/TestSerializablePrincipal.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/TestVirtualContext.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/TestWebappClassLoaderWeaving.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/mbeans/TestRegistration.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/servlets/TestDefaultServlet.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/servlets/TestWebdavServlet.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/session/Benchmarks.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/session/Threading.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/LoggingBaseTest.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestContextConfigAnnotation.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestListener.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestTomcat.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestTomcatClassLoader.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TestWebRuleSet.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/TestGroupChannelMemberArrival.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/TestGroupChannelOptionFlag.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/TestGroupChannelSenderConnections.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/TestGroupChannelStartStop.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/interceptors/TestDomainFilterInterceptor.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/interceptors/TestGzipInterceptor.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/interceptors/TestNonBlockingCoordinator.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/io/TestXByteBuffer.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/membership/TestMemberImplSerialization.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestMulticastPackages.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestRemoteProcessException.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/tribes/test/channel/TestUdpPackages.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/util/TestContextName.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/util/TestConversions.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/util/TestRequestUtil.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestRequestFilterValve.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TesterAccessLogValve.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java
tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/TestGzipOutputFilter.java
tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/TestInternalInputBuffer.java
tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/filters/TestFlushableGZIPOutputStream.java
tomcat/tc7.0.x/trunk/test/org/apache/el/TestELEvaluation.java
tomcat/tc7.0.x/trunk/test/org/apache/el/TestELInJsp.java
tomcat/tc7.0.x/trunk/test/org/apache/el/TestMethodExpressionImpl.java
tomcat/tc7.0.x/trunk/test/org/apache/el/TestValueExpressionImpl.java
tomcat/tc7.0.x/trunk/test/org/apache/el/lang/TestELArithmetic.java
tomcat/tc7.0.x/trunk/test/org/apache/el/lang/TestELSupport.java
tomcat/tc7.0.x/trunk/test/org/apache/el/parser/TestELParser.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/compiler/TestAttributeParser.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/compiler/TestCompiler.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/compiler/TestGenerator.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/compiler/TestJspConfig.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/compiler/TestParser.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/compiler/TestScriptingVariabler.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/compiler/TestValidator.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/util/TestFastRemovalDequeue.java
tomcat/tc7.0.x/trunk/test/org/apache/juli/TestFileHandler.java
tomcat/tc7.0.x/trunk/test/org/apache/juli/TestFileHandlerNonRotatable.java
tomcat/tc7.0.x/trunk/test/org/apache/naming/resources/TestDirContextURLStreamHandlerFactory.java
tomcat/tc7.0.x/trunk/test/org/apache/naming/resources/TestNamingContext.java
tomcat/tc7.0.x/trunk/test/org/apache/naming/resources/TestProxyDirContext.java
tomcat/tc7.0.x/trunk/test/org/apache/naming/resources/TestWarDirContext.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/buf/TestByteChunk.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/buf/TestHexUtils.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/buf/TestUEncoder.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowNameOnly.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/TestMimeHeaders.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/TestParameters.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/TesterParametersPerformance.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/mapper/TestMapper.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/threads/TestLimitLatch.java
Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/BorrowWaitTest.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/BorrowWaitTest.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/BorrowWaitTest.java (original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/BorrowWaitTest.java Mon Nov 13 12:32:26 2017
@@ -57,11 +57,11 @@ public class BorrowWaitTest extends Defa
long start = System.currentTimeMillis();
try {
Connection con2 = datasource.getConnection();
- assertFalse("This should not happen, connection should be unavailable.",true);
+ Assert.assertFalse("This should not happen, connection should be unavailable.",true);
}catch (SQLException x) {
long delta = System.currentTimeMillis();
boolean inrange = Math.abs(wait-delta) < 1000;
- assertTrue("Connection should have been acquired within +/- 1 second.",true);
+ Assert.assertTrue("Connection should have been acquired within +/- 1 second.",true);
}
con.close();
*/
Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StarvationTest.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StarvationTest.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StarvationTest.java (original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/StarvationTest.java Mon Nov 13 12:32:26 2017
@@ -54,11 +54,11 @@ public class StarvationTest extends Defa
// try {
// con2.setCatalog("mysql");//make sure connection is valid
// }catch (SQLException x) {
-// assertFalse("2nd Connection is not valid:"+x.getMessage(),true);
+// Assert.assertFalse("2nd Connection is not valid:"+x.getMessage(),true);
// }
-// assertTrue("Connection 1 should be closed.",con1.isClosed()); //first connection should be closed
+// Assert.assertTrue("Connection 1 should be closed.",con1.isClosed()); //first connection should be closed
// }catch (Exception x) {
-// assertFalse("Connection got starved:"+x.getMessage(),true);
+// Assert.assertFalse("Connection got starved:"+x.getMessage(),true);
// }finally {
// if (con2!=null) con2.close();
// }
Modified: tomcat/tc7.0.x/trunk/test/javax/el/TestCompositeELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/javax/el/TestCompositeELResolver.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/javax/el/TestCompositeELResolver.java (original)
+++ tomcat/tc7.0.x/trunk/test/javax/el/TestCompositeELResolver.java Mon Nov 13 12:32:26 2017
@@ -20,8 +20,7 @@ import java.io.File;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertEquals;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.core.StandardContext;
@@ -49,6 +48,6 @@ public class TestCompositeELResolver ext
int rc = getUrl("http://localhost:" + getPort() +
"/test/bug5nnnn/bug50408.jsp", new ByteChunk(), null);
- assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
}
}
Modified: tomcat/tc7.0.x/trunk/test/javax/servlet/jsp/TestPageContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/javax/servlet/jsp/TestPageContext.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/javax/servlet/jsp/TestPageContext.java (original)
+++ tomcat/tc7.0.x/trunk/test/javax/servlet/jsp/TestPageContext.java Mon Nov 13 12:32:26 2017
@@ -19,8 +19,7 @@ package javax.servlet.jsp;
import java.io.File;
-import static org.junit.Assert.assertTrue;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.startup.Tomcat;
@@ -43,6 +42,6 @@ public class TestPageContext extends Tom
"/test/bug49nnn/bug49196.jsp");
String result = res.toString();
- assertTrue(result.contains("OK"));
+ Assert.assertTrue(result.contains("OK"));
}
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/ant/TestDeployTask.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/ant/TestDeployTask.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/ant/TestDeployTask.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/ant/TestDeployTask.java Mon Nov 13 12:32:26 2017
@@ -20,8 +20,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import static org.junit.Assert.assertEquals;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.startup.Tomcat;
@@ -37,8 +36,8 @@ public class TestDeployTask extends Tomc
@Override
public void execute(String command, InputStream istream, String contentType, int contentLength)
throws BuildException {
- assertEquals("/deploy?path=somepath", command);
- assertEquals("application/octet-stream", contentType);
+ Assert.assertEquals("/deploy?path=somepath", command);
+ Assert.assertEquals("application/octet-stream", contentType);
try {
istream.close();
} catch (IOException e) {
@@ -89,8 +88,8 @@ public class TestDeployTask extends Tomc
@Override
public void execute(String command, InputStream istream, String contentType, int contentLength)
throws BuildException {
- assertEquals("/deploy?path=somepath", command);
- assertEquals("application/octet-stream", contentType);
+ Assert.assertEquals("/deploy?path=somepath", command);
+ Assert.assertEquals("application/octet-stream", contentType);
try {
istream.close();
} catch (IOException e) {
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java Mon Nov 13 12:32:26 2017
@@ -23,9 +23,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
import org.junit.Assert;
import org.junit.Test;
@@ -213,8 +210,8 @@ public class TestDigestAuthenticator ext
ByteChunk bc = new ByteChunk();
int rc = getUrl("http://localhost:" + getPort() + uri, bc, reqHeaders,
respHeaders);
- assertEquals(401, rc);
- assertTrue(bc.getLength() > 0);
+ Assert.assertEquals(401, rc);
+ Assert.assertTrue(bc.getLength() > 0);
bc.recycle();
// Second request should succeed (if we use the server nonce)
@@ -236,11 +233,11 @@ public class TestDigestAuthenticator ext
null);
if (req2expect200) {
- assertEquals(200, rc);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals(200, rc);
+ Assert.assertEquals("OK", bc.toString());
} else {
- assertEquals(401, rc);
- assertTrue(bc.getLength() > 0);
+ Assert.assertEquals(401, rc);
+ Assert.assertTrue(bc.getLength() > 0);
}
// Third request should succeed if we increment nc
@@ -254,11 +251,11 @@ public class TestDigestAuthenticator ext
null);
if (req3expect200) {
- assertEquals(200, rc);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals(200, rc);
+ Assert.assertEquals("OK", bc.toString());
} else {
- assertEquals(401, rc);
- assertTrue(bc.getLength() > 0);
+ Assert.assertEquals(401, rc);
+ Assert.assertTrue(bc.getLength() > 0);
}
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestFormAuthenticator.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestFormAuthenticator.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestFormAuthenticator.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestFormAuthenticator.java Mon Nov 13 12:32:26 2017
@@ -26,10 +26,7 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.Context;
@@ -256,28 +253,28 @@ public class TestFormAuthenticator exten
client.doResourceRequest("PUT", true, "/test?" +
SelectedMethodsServlet.PARAM + "=" +
SelectedMethodsServlet.VALUE, null);
- assertTrue(client.getResponseLine(), client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.getResponseLine(), client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
String originalSessionId = client.getSessionId();
client.reset();
// Second request replies to the login challenge
client.doResourceRequest("POST", true, "/test/j_security_check",
FormAuthClientBase.LOGIN_REPLY);
- assertTrue("login failed " + client.getResponseLine(),
+ Assert.assertTrue("login failed " + client.getResponseLine(),
client.isResponse302());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponseBodyOK());
String redirectUri = client.getRedirectUri();
client.reset();
// Third request - the login was successful so
// follow the redirect to the protected resource
client.doResourceRequest("GET", true, redirectUri, null);
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
String newSessionId = client.getSessionId();
- assertTrue(!originalSessionId.equals(newSessionId));
+ Assert.assertTrue(!originalSessionId.equals(newSessionId));
client.reset();
}
@@ -304,12 +301,12 @@ public class TestFormAuthenticator exten
client = new FormAuthClient(clientShouldUseCookies,
serverWillUseCookies, serverWillChangeSessid);
-
+
// First request for protected resource gets the login page
client.setUseContinue(useContinue);
client.doResourceRequest(resourceMethod, false, null, null);
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
String loginUri = client.extractBodyUri(
FormAuthClient.LOGIN_PARAM_TAG,
FormAuthClient.LOGIN_RESOURCE);
@@ -325,9 +322,9 @@ public class TestFormAuthenticator exten
// Second request replies to the login challenge
client.setUseContinue(useContinue);
client.doLoginRequest(loginUri);
- assertTrue("login failed " + client.getResponseLine(),
+ Assert.assertTrue("login failed " + client.getResponseLine(),
client.isResponse302());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponseBodyOK());
String redirectUri = client.getRedirectUri();
client.reset();
@@ -337,8 +334,8 @@ public class TestFormAuthenticator exten
if ("POST".equals(redirectMethod)) {
client.setUseContinue(useContinue);
}
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
String protectedUri = client.extractBodyUri(
FormAuthClient.RESOURCE_PARAM_TAG,
FormAuthClient.PROTECTED_RESOURCE);
@@ -350,7 +347,7 @@ public class TestFormAuthenticator exten
newSessionId = client.extractPathSessionId(protectedUri);
}
boolean sessionIdIsChanged = !(originalSessionId.equals(newSessionId));
- assertTrue(sessionIdIsChanged == serverWillChangeSessid);
+ Assert.assertTrue(sessionIdIsChanged == serverWillChangeSessid);
client.reset();
// Subsequent requests - keep accessing the protected resource
@@ -383,8 +380,8 @@ public class TestFormAuthenticator exten
for (int i = 0; i < repeatCount; i++) {
client.setUseContinue(useContinue);
client.doResourceRequest(resourceMethod, false, protectedUri, null);
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK(phase));
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK(phase));
client.reset();
}
}
@@ -591,7 +588,7 @@ public class TestFormAuthenticator exten
private void assertContains(String body, String expected) {
if (!body.contains(expected)) {
- fail("Response number " + requestCount
+ Assert.fail("Response number " + requestCount
+ ": body check failure.\n"
+ "Expected to contain substring: [" + expected
+ "]\nActual: [" + body + "]");
@@ -717,8 +714,8 @@ public class TestFormAuthenticator exten
if (isResponse302()) {
return true;
}
- assertTrue(getResponseBody(), getResponseBody().contains("OK"));
- assertFalse(getResponseBody().contains("FAIL"));
+ Assert.assertTrue(getResponseBody(), getResponseBody().contains("OK"));
+ Assert.assertFalse(getResponseBody().contains("FAIL"));
return true;
}
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java Mon Nov 13 12:32:26 2017
@@ -23,9 +23,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.Context;
@@ -356,7 +354,7 @@ public class TestNonLoginAndBasicAuthent
// slightly paranoid verification
boolean sameCookies = originalCookies.equals(cookies);
- assertTrue(!sameCookies);
+ Assert.assertTrue(!sameCookies);
}
/*
@@ -420,11 +418,11 @@ public class TestNonLoginAndBasicAuthent
respHeaders);
if (expectedRC != HttpServletResponse.SC_OK) {
- assertEquals(expectedRC, rc);
- assertTrue(bc.getLength() > 0);
+ Assert.assertEquals(expectedRC, rc);
+ Assert.assertTrue(bc.getLength() > 0);
}
else {
- assertEquals("OK", bc.toString());
+ Assert.assertEquals("OK", bc.toString());
}
}
@@ -452,8 +450,8 @@ public class TestNonLoginAndBasicAuthent
respHeaders);
if (expectedRC != HttpServletResponse.SC_OK) {
- assertEquals(expectedRC, rc);
- assertTrue(bc.getLength() > 0);
+ Assert.assertEquals(expectedRC, rc);
+ Assert.assertTrue(bc.getLength() > 0);
if (expectedRC == HttpServletResponse.SC_UNAUTHORIZED) {
// The server should identify the acceptable method(s)
boolean methodFound = false;
@@ -464,11 +462,11 @@ public class TestNonLoginAndBasicAuthent
break;
}
}
- assertTrue(methodFound);
+ Assert.assertTrue(methodFound);
}
}
else {
- assertEquals("OK", bc.toString());
+ Assert.assertEquals("OK", bc.toString());
List<String> newCookies = respHeaders.get(SERVER_COOKIE_HEADER);
if (newCookies != null) {
// harvest cookies whenever the server sends some new ones
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java Mon Nov 13 12:32:26 2017
@@ -23,11 +23,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.Context;
@@ -270,7 +266,7 @@ public class TestSSOnonLoginAndBasicAuth
// verify the sessionID was encoded in the absolute URL
String firstEncodedURL = encodedURL;
- assertTrue(firstEncodedURL.contains(ENCODE_SESSION_PARAM));
+ Assert.assertTrue(firstEncodedURL.contains(ENCODE_SESSION_PARAM));
// access the protected resource with the encoded url (with session id)
doTestBasic(firstEncodedURL + forwardParam,
@@ -280,8 +276,8 @@ public class TestSSOnonLoginAndBasicAuth
// verify the sessionID has not changed
// verify the SSO sessionID was not encoded
String secondEncodedURL = encodedURL;
- assertEquals(firstEncodedURL, secondEncodedURL);
- assertFalse(firstEncodedURL.contains(ENCODE_SSOSESSION_PARAM));
+ Assert.assertEquals(firstEncodedURL, secondEncodedURL);
+ Assert.assertFalse(firstEncodedURL.contains(ENCODE_SSOSESSION_PARAM));
// extract the first container's session ID
int ix = secondEncodedURL.indexOf(ENCODE_SESSION_PARAM);
@@ -366,11 +362,11 @@ public class TestSSOnonLoginAndBasicAuth
respHeaders);
if (expectedRC != HttpServletResponse.SC_OK) {
- assertEquals(expectedRC, rc);
- assertTrue(bc.getLength() > 0);
+ Assert.assertEquals(expectedRC, rc);
+ Assert.assertTrue(bc.getLength() > 0);
}
else {
- assertEquals("OK", bc.toString());
+ Assert.assertEquals("OK", bc.toString());
}
}
@@ -396,9 +392,9 @@ public class TestSSOnonLoginAndBasicAuth
int rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders,
respHeaders);
- assertEquals("Unexpected Return Code", expectedRC, rc);
+ Assert.assertEquals("Unexpected Return Code", expectedRC, rc);
if (expectedRC != HttpServletResponse.SC_OK) {
- assertTrue(bc.getLength() > 0);
+ Assert.assertTrue(bc.getLength() > 0);
if (expectedRC == HttpServletResponse.SC_UNAUTHORIZED) {
// The server should identify the acceptable method(s)
boolean methodFound = false;
@@ -409,13 +405,13 @@ public class TestSSOnonLoginAndBasicAuth
break;
}
}
- assertTrue(methodFound);
+ Assert.assertTrue(methodFound);
}
}
else {
String thePage = bc.toString();
- assertNotNull(thePage);
- assertTrue(thePage.startsWith("OK"));
+ Assert.assertNotNull(thePage);
+ Assert.assertTrue(thePage.startsWith("OK"));
if (useCookie) {
List<String> newCookies = respHeaders.get(SERVER_COOKIE_HEADER);
if (newCookies != null) {
@@ -609,7 +605,7 @@ public class TestSSOnonLoginAndBasicAuth
// paranoid verification that active sessions have now gone
sessions = manager.findSessions();
- assertTrue(sessions.length == 0);
+ Assert.assertTrue(sessions.length == 0);
}
/*
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java Mon Nov 13 12:32:26 2017
@@ -21,9 +21,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.Context;
@@ -217,12 +215,12 @@ public class TestSSOnonLoginAndDigestAut
respHeaders);
if (expectedReject) {
- assertEquals(expectedRC, rc);
- assertTrue(bc.getLength() > 0);
+ Assert.assertEquals(expectedRC, rc);
+ Assert.assertTrue(bc.getLength() > 0);
}
else {
- assertEquals(200, rc);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals(200, rc);
+ Assert.assertEquals("OK", bc.toString());
saveCookies(respHeaders);
}
}
@@ -252,12 +250,12 @@ public class TestSSOnonLoginAndDigestAut
respHeaders1);
if (expectedReject1) {
- assertEquals(expectedRC1, rc);
- assertTrue(bc.getLength() > 0);
+ Assert.assertEquals(expectedRC1, rc);
+ Assert.assertTrue(bc.getLength() > 0);
}
else {
- assertEquals(200, rc);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals(200, rc);
+ Assert.assertEquals("OK", bc.toString());
saveCookies(respHeaders1);
return;
}
@@ -295,12 +293,12 @@ public class TestSSOnonLoginAndDigestAut
respHeaders2);
if (req2expect200) {
- assertEquals(200, rc);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals(200, rc);
+ Assert.assertEquals("OK", bc.toString());
saveCookies(respHeaders2);
} else {
- assertEquals(401, rc);
- assertTrue((bc.getLength() > 0));
+ Assert.assertEquals(401, rc);
+ Assert.assertTrue((bc.getLength() > 0));
}
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TesterDigestAuthenticatorPerformance.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TesterDigestAuthenticatorPerformance.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TesterDigestAuthenticatorPerformance.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TesterDigestAuthenticatorPerformance.java Mon Nov 13 12:32:26 2017
@@ -21,8 +21,7 @@ import java.util.concurrent.atomic.Atomi
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertEquals;
-
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -99,7 +98,7 @@ public class TesterDigestAuthenticatorPe
System.out.println("Average time per request (wall): " +
wallTime/(threadCount * requestCount));
- assertEquals(requestCount * threadCount, totalSuccess);
+ Assert.assertEquals(requestCount * threadCount, totalSuccess);
}
@Before
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/comet/TestCometProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/comet/TestCometProcessor.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/comet/TestCometProcessor.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/comet/TestCometProcessor.java Mon Nov 13 12:32:26 2017
@@ -28,10 +28,6 @@ import javax.servlet.http.HttpServletReq
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
@@ -91,7 +87,7 @@ public class TestCometProcessor extends
}
if (count == 10) {
- fail("Comet request did not complete");
+ Assert.fail("Comet request did not complete");
}
// Send a standard HTTP request on the same connection
@@ -109,7 +105,7 @@ public class TestCometProcessor extends
}
if (count == 10) {
- fail("Non-comet request did not complete");
+ Assert.fail("Non-comet request did not complete");
}
readThread.join();
@@ -162,7 +158,7 @@ public class TestCometProcessor extends
Assert.assertTrue(readThread.getResponse().contains("2\r\nOK"));
if (count == 10) {
- fail("Comet request did not complete");
+ Assert.fail("Comet request did not complete");
}
// Send a standard HTTP request on the same connection
@@ -181,7 +177,7 @@ public class TestCometProcessor extends
}
if (count == 10) {
- fail("Non-comet request did not complete");
+ Assert.fail("Non-comet request did not complete");
}
readThread.join();
@@ -232,7 +228,7 @@ public class TestCometProcessor extends
}
if (count == 10) {
- fail("Comet request did not complete");
+ Assert.fail("Comet request did not complete");
}
// Read thread should have terminated cleanly when the server closed the
@@ -311,43 +307,43 @@ public class TestCometProcessor extends
if (initParam == null) {
// Normal response expected
// Validate response
- assertEquals("HTTP/1.1 200 OK", response[0]);
- assertEquals("Server: Apache-Coyote/1.1", response[1]);
- assertTrue(response[2].startsWith("Set-Cookie: JSESSIONID="));
- assertEquals("Content-Type: text/plain;charset=ISO-8859-1", response[3]);
- assertEquals("Transfer-Encoding: chunked", response[4]);
- assertTrue(response[5].startsWith("Date: "));
- assertEquals("", response[6]);
- assertEquals("7", response[7]);
- assertEquals("BEGIN", response[8]);
- assertEquals("", response[9]);
- assertEquals("17", response[10]);
- assertEquals("Client: READ: 4 bytes", response[11]);
- assertEquals("", response[12]);
- assertEquals("17", response[13]);
- assertEquals("Client: READ: 4 bytes", response[14]);
- assertEquals("", response[15]);
- assertEquals("17", response[16]);
- assertEquals("Client: READ: 4 bytes", response[17]);
- assertEquals("", response[18]);
- assertEquals("17", response[19]);
- assertEquals("Client: READ: 4 bytes", response[20]);
- assertEquals("", response[21]);
- assertEquals("d", response[22]);
- assertEquals("Client: END", response[23]);
- assertEquals("", response[24]);
- assertEquals("0", response[25]);
+ Assert.assertEquals("HTTP/1.1 200 OK", response[0]);
+ Assert.assertEquals("Server: Apache-Coyote/1.1", response[1]);
+ Assert.assertTrue(response[2].startsWith("Set-Cookie: JSESSIONID="));
+ Assert.assertEquals("Content-Type: text/plain;charset=ISO-8859-1", response[3]);
+ Assert.assertEquals("Transfer-Encoding: chunked", response[4]);
+ Assert.assertTrue(response[5].startsWith("Date: "));
+ Assert.assertEquals("", response[6]);
+ Assert.assertEquals("7", response[7]);
+ Assert.assertEquals("BEGIN", response[8]);
+ Assert.assertEquals("", response[9]);
+ Assert.assertEquals("17", response[10]);
+ Assert.assertEquals("Client: READ: 4 bytes", response[11]);
+ Assert.assertEquals("", response[12]);
+ Assert.assertEquals("17", response[13]);
+ Assert.assertEquals("Client: READ: 4 bytes", response[14]);
+ Assert.assertEquals("", response[15]);
+ Assert.assertEquals("17", response[16]);
+ Assert.assertEquals("Client: READ: 4 bytes", response[17]);
+ Assert.assertEquals("", response[18]);
+ Assert.assertEquals("17", response[19]);
+ Assert.assertEquals("Client: READ: 4 bytes", response[20]);
+ Assert.assertEquals("", response[21]);
+ Assert.assertEquals("d", response[22]);
+ Assert.assertEquals("Client: END", response[23]);
+ Assert.assertEquals("", response[24]);
+ Assert.assertEquals("0", response[25]);
// Expect 26 lines
- assertEquals(26, response.length);
+ Assert.assertEquals(26, response.length);
} else {
// Failure expected only expected for the fail on begin
// Failure at any later stage and the response headers (including
// the 200 response code will already have been sent to the client
if (SimpleCometServlet.FAIL_ON_BEGIN.equals(initParam)) {
- assertEquals("HTTP/1.1 500 Internal Server Error", response[0]);
+ Assert.assertEquals("HTTP/1.1 500 Internal Server Error", response[0]);
alv.validateAccessLog(1, 500, 0, 1000);
} else {
- assertEquals("HTTP/1.1 200 OK", response[0]);
+ Assert.assertEquals("HTTP/1.1 200 OK", response[0]);
alv.validateAccessLog(1, 200, 0, 5000);
}
@@ -441,8 +437,8 @@ public class TestCometProcessor extends
} else {
log.info(status);
}
- assertTrue("Comet END event not received", servlet.getEndEventOccurred());
- assertTrue("Comet END event not last event received",
+ Assert.assertTrue("Comet END event not received", servlet.getEndEventOccurred());
+ Assert.assertTrue("Comet END event not last event received",
EventType.END.equals(servlet.getLastEvent()));
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestConnector.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestConnector.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestConnector.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestConnector.java Mon Nov 13 12:32:26 2017
@@ -18,9 +18,7 @@ package org.apache.catalina.connector;
import java.net.SocketTimeoutException;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.Context;
@@ -53,8 +51,8 @@ public class TestConnector extends Tomca
ByteChunk bc = new ByteChunk();
int rc = getUrl("http://localhost:" + getPort() + "/", bc, null, null);
- assertEquals(200, rc);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals(200, rc);
+ Assert.assertEquals("OK", bc.toString());
rc = -1;
bc.recycle();
@@ -69,7 +67,7 @@ public class TestConnector extends Tomca
// Make sure the test passes if we do
rc = 503;
}
- assertEquals(503, rc);
+ Assert.assertEquals(503, rc);
}
@@ -90,7 +88,7 @@ public class TestConnector extends Tomca
int localPort1 = connector1.getLocalPort();
int localPort2 = connector2.getLocalPort();
- assertTrue(localPort1 > 0);
- assertTrue(localPort2 > 0);
+ Assert.assertTrue(localPort1 > 0);
+ Assert.assertTrue(localPort2 > 0);
}
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestKeepAliveCount.java Mon Nov 13 12:32:26 2017
@@ -23,8 +23,7 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertTrue;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.Context;
@@ -86,7 +85,7 @@ public class TestKeepAliveCount extends
disconnect();
reset();
tomcat.stop();
- assertTrue(passed);
+ Assert.assertTrue(passed);
}
private void doHttp11Request() throws Exception {
@@ -110,14 +109,14 @@ public class TestKeepAliveCount extends
for (int i=0; i<5; i++) {
processRequest(false); // blocks until response has been read
- assertTrue(getResponseLine()!=null && getResponseLine().startsWith("HTTP/1.1 200 "));
+ Assert.assertTrue(getResponseLine()!=null && getResponseLine().startsWith("HTTP/1.1 200 "));
}
boolean passed = (this.readLine()==null);
// Close the connection
disconnect();
reset();
tomcat.stop();
- assertTrue(passed);
+ Assert.assertTrue(passed);
}
@Override
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java Mon Nov 13 12:32:26 2017
@@ -25,7 +25,7 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertEquals;
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.Context;
@@ -55,16 +55,16 @@ public class TestOutputBuffer extends To
for (int i = 1; i <= WritingServlet.EXPECTED_CONTENT_LENGTH; i*=10) {
int rc = getUrl("http://localhost:" + getPort() +
"/servlet" + i, bc, null, null);
- assertEquals(HttpServletResponse.SC_OK, rc);
- assertEquals(
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals(
WritingServlet.EXPECTED_CONTENT_LENGTH, bc.getLength());
bc.recycle();
rc = getUrl("http://localhost:" + getPort() +
"/servlet" + i + "?useBuffer=y", bc, null, null);
- assertEquals(HttpServletResponse.SC_OK, rc);
- assertEquals(
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals(
WritingServlet.EXPECTED_CONTENT_LENGTH, bc.getLength());
bc.recycle();
@@ -87,8 +87,8 @@ public class TestOutputBuffer extends To
ByteChunk bc = new ByteChunk();
int rc = getUrl("http://localhost:" + getPort() + "/", bc, null, null);
- assertEquals(HttpServletResponse.SC_OK, rc);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals("OK", bc.toString());
}
private static class WritingServlet extends HttpServlet {
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestRequest.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestRequest.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestRequest.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestRequest.java Mon Nov 13 12:32:26 2017
@@ -36,11 +36,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -81,41 +76,41 @@ public class TestRequest extends TomcatB
// Edge cases around zero
client.doRequest(-1, false); // Unlimited
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
client.reset();
client.doRequest(0, false); // 0 bytes - too small should fail
- assertTrue(client.isResponse413());
+ Assert.assertTrue(client.isResponse413());
client.reset();
client.doRequest(1, false); // 1 byte - too small should fail
- assertTrue(client.isResponse413());
+ Assert.assertTrue(client.isResponse413());
client.reset();
// Edge cases around actual content length
client.reset();
client.doRequest(6, false); // Too small should fail
- assertTrue(client.isResponse413());
+ Assert.assertTrue(client.isResponse413());
client.reset();
client.doRequest(7, false); // Just enough should pass
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
client.reset();
client.doRequest(8, false); // 1 extra - should pass
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
// Much larger
client.reset();
client.doRequest(8096, false); // Plenty of space - should pass
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
// Check for case insensitivity
client.reset();
client.doRequest(8096, true); // Plenty of space - should pass
- assertTrue(client.isResponse200());
- assertTrue(client.isResponseBodyOK());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertTrue(client.isResponseBodyOK());
}
/**
@@ -130,8 +125,8 @@ public class TestRequest extends TomcatB
client.reset();
client.doRequest(6, false); // Too small should fail
// Response code will be OK, but parameters list will be empty
- assertTrue(client.isResponse200());
- assertEquals("", client.getResponseBody());
+ Assert.assertTrue(client.isResponse200());
+ Assert.assertEquals("", client.getResponseBody());
}
private static class Bug37794Servlet extends HttpServlet {
@@ -284,15 +279,15 @@ public class TestRequest extends TomcatB
// No query string
ByteChunk res = getUrl("http://localhost:" + getPort() + "/");
- assertEquals("QueryString=null", res.toString());
+ Assert.assertEquals("QueryString=null", res.toString());
// Query string
res = getUrl("http://localhost:" + getPort() + "/?a=b");
- assertEquals("QueryString=a=b", res.toString());
+ Assert.assertEquals("QueryString=a=b", res.toString());
// Empty string
res = getUrl("http://localhost:" + getPort() + "/?");
- assertEquals("QueryString=", res.toString());
+ Assert.assertEquals("QueryString=", res.toString());
}
private static final class EchoQueryStringServlet extends HttpServlet {
@@ -335,7 +330,7 @@ public class TestRequest extends TomcatB
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() + "/");
- assertEquals(LoginLogoutServlet.OK, res.toString());
+ Assert.assertEquals(LoginLogoutServlet.OK, res.toString());
}
private static final class LoginLogoutServlet extends HttpServlet {
@@ -378,7 +373,7 @@ public class TestRequest extends TomcatB
HttpURLConnection conn = getConnection("http://localhost:" + getPort() + "/");
InputStream is = conn.getInputStream();
- assertNotNull(is);
+ Assert.assertNotNull(is);
}
@Test
@@ -393,7 +388,7 @@ public class TestRequest extends TomcatB
HttpURLConnection conn = getConnection("http://localhost:" + getPort() + "/");
conn.setChunkedStreamingMode(8 * 1024);
InputStream is = conn.getInputStream();
- assertNotNull(is);
+ Assert.assertNotNull(is);
}
/**
@@ -409,9 +404,9 @@ public class TestRequest extends TomcatB
// Make sure GET works properly
client.doRequest("GET", "foo=bar", null, null, false);
- assertTrue("Non-200 response for GET request",
+ Assert.assertTrue("Non-200 response for GET request",
client.isResponse200());
- assertEquals("Incorrect response for GET request",
+ Assert.assertEquals("Incorrect response for GET request",
"foo=bar",
client.getResponseBody());
@@ -423,9 +418,9 @@ public class TestRequest extends TomcatB
// POST with separate GET and POST parameters
client.doRequest("POST", "foo=bar", "application/x-www-form-urlencoded", "bar=baz", true);
- assertTrue("Non-200 response for POST request",
+ Assert.assertTrue("Non-200 response for POST request",
client.isResponse200());
- assertEquals("Incorrect response for POST request",
+ Assert.assertEquals("Incorrect response for POST request",
"bar=baz,foo=bar",
client.getResponseBody());
@@ -434,9 +429,9 @@ public class TestRequest extends TomcatB
// POST with overlapping GET and POST parameters
client.doRequest("POST", "foo=bar&bar=foo", "application/x-www-form-urlencoded", "bar=baz&foo=baz", true);
- assertTrue("Non-200 response for POST request",
+ Assert.assertTrue("Non-200 response for POST request",
client.isResponse200());
- assertEquals("Incorrect response for POST request",
+ Assert.assertEquals("Incorrect response for POST request",
"bar=baz,bar=foo,foo=bar,foo=baz",
client.getResponseBody());
@@ -445,9 +440,9 @@ public class TestRequest extends TomcatB
// PUT without POST-style parsing
client.doRequest("PUT", "foo=bar&bar=foo", "application/x-www-form-urlencoded", "bar=baz&foo=baz", false);
- assertTrue("Non-200 response for PUT/noparse request",
+ Assert.assertTrue("Non-200 response for PUT/noparse request",
client.isResponse200());
- assertEquals("Incorrect response for PUT request",
+ Assert.assertEquals("Incorrect response for PUT request",
"bar=foo,foo=bar",
client.getResponseBody());
@@ -456,9 +451,9 @@ public class TestRequest extends TomcatB
// PUT with POST-style parsing
client.doRequest("PUT", "foo=bar&bar=foo", "application/x-www-form-urlencoded", "bar=baz&foo=baz", true);
- assertTrue("Non-200 response for PUT request",
+ Assert.assertTrue("Non-200 response for PUT request",
client.isResponse200());
- assertEquals("Incorrect response for PUT/parse request",
+ Assert.assertEquals("Incorrect response for PUT/parse request",
"bar=baz,bar=foo,foo=bar,foo=baz",
client.getResponseBody());
@@ -696,14 +691,14 @@ public class TestRequest extends TomcatB
while ((line = reader.readLine()) != null) {
response.add(line);
}
- assertTrue(response.contains("Part äö"));
+ Assert.assertTrue(response.contains("Part äö"));
} finally {
if (reader != null) {
reader.close();
}
}
} else {
- fail("OK status was expected: " + status);
+ Assert.fail("OK status was expected: " + status);
}
}
@@ -851,7 +846,7 @@ public class TestRequest extends TomcatB
if (resultPath == null) {
resultPath = "";
}
- assertEquals(expected, resultPath);
+ Assert.assertEquals(expected, resultPath);
}
private class Bug56501Servlet extends HttpServlet {
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponse.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponse.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponse.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponse.java Mon Nov 13 12:32:26 2017
@@ -29,9 +29,6 @@ import javax.servlet.http.HttpServletReq
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
import org.junit.Assert;
import org.junit.Test;
@@ -72,7 +69,7 @@ public class TestResponse extends Tomcat
values.get(0).startsWith("HTTP/1.1")) {
continue;
}
- fail("Null header name detected for value " + values);
+ Assert.fail("Null header name detected for value " + values);
}
}
@@ -83,7 +80,7 @@ public class TestResponse extends Tomcat
count ++;
}
}
- assertEquals(1, count);
+ Assert.assertEquals(1, count);
}
private static final class Bug49598Servlet extends HttpServlet {
@@ -118,7 +115,7 @@ public class TestResponse extends Tomcat
ByteChunk bc = getUrl("http://localhost:" + getPort() + "/");
- assertEquals("OK", bc.toString());
+ Assert.assertEquals("OK", bc.toString());
}
private static final class CharsetServlet extends HttpServlet {
@@ -157,7 +154,7 @@ public class TestResponse extends Tomcat
ByteChunk bc = getUrl("http://localhost:" + getPort() + "/");
- assertEquals("OK", bc.toString());
+ Assert.assertEquals("OK", bc.toString());
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java Mon Nov 13 12:32:26 2017
@@ -18,7 +18,7 @@ package org.apache.catalina.connector;
import java.net.URI;
-import static org.junit.Assert.assertTrue;
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.startup.LoggingBaseTest;
@@ -50,6 +50,6 @@ public class TestResponsePerformance ext
System.out.println("Current 'home-brew': " + homebrew +
"ms, Using URI: " + uri + "ms");
- assertTrue(homebrew < uri);
+ Assert.assertTrue(homebrew < uri);
}
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestSendFile.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestSendFile.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestSendFile.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestSendFile.java Mon Nov 13 12:32:26 2017
@@ -36,8 +36,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertEquals;
-
import org.junit.Assert;
import org.junit.Test;
@@ -79,10 +77,10 @@ public class TestSendFile extends Tomcat
long start = System.currentTimeMillis();
int rc = getUrl("http://localhost:" + getPort() + "/servlet" + i, bc, null,
respHeaders);
- assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
System.out.println("Client received " + bc.getLength() + " bytes in "
+ (System.currentTimeMillis() - start) + " ms.");
- assertEquals(EXPECTED_CONTENT_LENGTH * (i + 1), bc.getLength());
+ Assert.assertEquals(EXPECTED_CONTENT_LENGTH * (i + 1), bc.getLength());
bc.recycle();
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationSessionCookieConfig.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationSessionCookieConfig.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationSessionCookieConfig.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationSessionCookieConfig.java Mon Nov 13 12:32:26 2017
@@ -17,8 +17,7 @@
package org.apache.catalina.core;
-import static org.junit.Assert.assertTrue;
-
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -38,7 +37,7 @@ public class TestApplicationSessionCooki
public void testSetCommentInitPhase() {
context.setState(LifecycleState.STARTING_PREP);
applicationSessionCookieConfig.setComment("test");
- assertTrue(applicationSessionCookieConfig.getComment().equals("test"));
+ Assert.assertTrue(applicationSessionCookieConfig.getComment().equals("test"));
}
@Test(expected = IllegalStateException.class)
@@ -51,7 +50,7 @@ public class TestApplicationSessionCooki
public void testSetDomainInitPhase() {
context.setState(LifecycleState.STARTING_PREP);
applicationSessionCookieConfig.setDomain("test");
- assertTrue(applicationSessionCookieConfig.getDomain().equals("test"));
+ Assert.assertTrue(applicationSessionCookieConfig.getDomain().equals("test"));
}
@Test(expected = IllegalStateException.class)
@@ -64,7 +63,7 @@ public class TestApplicationSessionCooki
public void testSetHttpOnlyInitPhase() {
context.setState(LifecycleState.STARTING_PREP);
applicationSessionCookieConfig.setHttpOnly(true);
- assertTrue(applicationSessionCookieConfig.isHttpOnly());
+ Assert.assertTrue(applicationSessionCookieConfig.isHttpOnly());
}
@Test(expected = IllegalStateException.class)
@@ -77,7 +76,7 @@ public class TestApplicationSessionCooki
public void testSetMaxAgeInitPhase() {
context.setState(LifecycleState.STARTING_PREP);
applicationSessionCookieConfig.setMaxAge(1);
- assertTrue(applicationSessionCookieConfig.getMaxAge() == 1);
+ Assert.assertTrue(applicationSessionCookieConfig.getMaxAge() == 1);
}
@Test(expected = IllegalStateException.class)
@@ -90,7 +89,7 @@ public class TestApplicationSessionCooki
public void testSetNameInitPhase() {
context.setState(LifecycleState.STARTING_PREP);
applicationSessionCookieConfig.setName("test");
- assertTrue(applicationSessionCookieConfig.getName().equals("test"));
+ Assert.assertTrue(applicationSessionCookieConfig.getName().equals("test"));
}
@Test(expected = IllegalStateException.class)
@@ -103,7 +102,7 @@ public class TestApplicationSessionCooki
public void testSetPathInitPhase() {
context.setState(LifecycleState.STARTING_PREP);
applicationSessionCookieConfig.setPath("test");
- assertTrue(applicationSessionCookieConfig.getPath().equals("test"));
+ Assert.assertTrue(applicationSessionCookieConfig.getPath().equals("test"));
}
@Test(expected = IllegalStateException.class)
@@ -116,7 +115,7 @@ public class TestApplicationSessionCooki
public void testSetSecureInitPhase() {
context.setState(LifecycleState.STARTING_PREP);
applicationSessionCookieConfig.setSecure(true);
- assertTrue(applicationSessionCookieConfig.isSecure());
+ Assert.assertTrue(applicationSessionCookieConfig.isSecure());
}
@Test(expected = IllegalStateException.class)
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Mon Nov 13 12:32:26 2017
@@ -45,10 +45,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -109,7 +105,7 @@ public class TestAsyncContextImpl extend
// Call the servlet once
ByteChunk bc = getUrl("http://localhost:" + getPort() + "/");
- assertEquals("OK", bc.toString());
+ Assert.assertEquals("OK", bc.toString());
// Give the async thread a chance to finish (but not too long)
int counter = 0;
@@ -118,7 +114,7 @@ public class TestAsyncContextImpl extend
counter++;
}
- assertEquals("1false2true3true4true5false", servlet.getResult());
+ Assert.assertEquals("1false2true3true4true5false", servlet.getResult());
// Check the access log
alv.validateAccessLog(1, 200, Bug49528Servlet.THREAD_SLEEP_TIME,
@@ -146,7 +142,7 @@ public class TestAsyncContextImpl extend
// Call the servlet once
ByteChunk bc = getUrl("http://localhost:" + getPort() + "/");
- assertEquals("OK", bc.toString());
+ Assert.assertEquals("OK", bc.toString());
// Give the async thread a chance to finish (but not too long)
int counter = 0;
@@ -155,7 +151,7 @@ public class TestAsyncContextImpl extend
counter++;
}
- assertEquals("1false2true3true4true5false", servlet.getResult());
+ Assert.assertEquals("1false2true3true4true5false", servlet.getResult());
// Check the access log
alv.validateAccessLog(1, 200, Bug49567Servlet.THREAD_SLEEP_TIME,
@@ -231,7 +227,7 @@ public class TestAsyncContextImpl extend
Map<String,List<String>> headers = new HashMap<String,List<String>>();
getUrl("http://localhost:" + getPort() + "/", bc, headers);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals("OK", bc.toString());
List<String> contentLength = headers.get("Content-Length");
Assert.assertNotNull(contentLength);
Assert.assertEquals(1, contentLength.size());
@@ -533,7 +529,7 @@ public class TestAsyncContextImpl extend
Thread.sleep(50);
count ++;
}
- assertEquals(expectedTrack, getTrack());
+ Assert.assertEquals(expectedTrack, getTrack());
// Check the access log
if (completeOnTimeout == null ||
@@ -670,7 +666,7 @@ public class TestAsyncContextImpl extend
Thread.sleep(50);
count ++;
}
- assertEquals(expectedTrack, getTrack());
+ Assert.assertEquals(expectedTrack, getTrack());
// Check the access log
alv.validateAccessLog(1, 200, 0, REQUEST_TIME);
@@ -1013,7 +1009,7 @@ public class TestAsyncContextImpl extend
Thread.sleep(50);
count ++;
}
- assertEquals(expectedTrack, getTrack());
+ Assert.assertEquals(expectedTrack, getTrack());
// Check the access log
alv.validateAccessLog(1, 500, 0, REQUEST_TIME);
@@ -1067,7 +1063,7 @@ public class TestAsyncContextImpl extend
Thread.sleep(50);
count ++;
}
- assertEquals(expectedTrack, getTrack());
+ Assert.assertEquals(expectedTrack, getTrack());
// Check the access log
alv.validateAccessLog(1, 200, AsyncStartRunnable.THREAD_SLEEP_TIME,
@@ -1129,12 +1125,12 @@ public class TestAsyncContextImpl extend
Map<String,List<String>> headers = new LinkedHashMap<String,List<String>>();
ByteChunk bc = new ByteChunk();
int rc = getUrl("http://localhost:" + getPort() + "/", bc, headers);
- assertEquals(200, rc);
- assertEquals("OK", bc.toString());
+ Assert.assertEquals(200, rc);
+ Assert.assertEquals("OK", bc.toString());
List<String> testHeader = headers.get("A");
- assertNotNull(testHeader);
- assertEquals(1, testHeader.size());
- assertEquals("xyz",testHeader.get(0));
+ Assert.assertNotNull(testHeader);
+ Assert.assertEquals(1, testHeader.size());
+ Assert.assertEquals("xyz",testHeader.get(0));
// Check the access log
alv.validateAccessLog(1, 200, Bug50753Servlet.THREAD_SLEEP_TIME,
@@ -1195,7 +1191,7 @@ public class TestAsyncContextImpl extend
int rc = getUrl(url.toString(), new ByteChunk(), null);
- assertEquals(500, rc);
+ Assert.assertEquals(500, rc);
// Without this test may complete before access log has a chance to log
// the request
@@ -1232,7 +1228,7 @@ public class TestAsyncContextImpl extend
int rc = getUrl(url.toString(), new ByteChunk(), null);
- assertEquals(HttpServletResponse.SC_BAD_REQUEST, rc);
+ Assert.assertEquals(HttpServletResponse.SC_BAD_REQUEST, rc);
// Without this test may complete before access log has a chance to log
// the request
@@ -1322,7 +1318,7 @@ public class TestAsyncContextImpl extend
ByteChunk res = new ByteChunk();
int rc = getUrl(url.toString(), res, null);
- assertEquals(HttpServletResponse.SC_BAD_REQUEST, rc);
+ Assert.assertEquals(HttpServletResponse.SC_BAD_REQUEST, rc);
// SRV 10.9.2 - Handling an error is entirely the application's
// responsibility when an error occurs on an application thread.
@@ -1330,11 +1326,11 @@ public class TestAsyncContextImpl extend
// error page mechanism to kick in could be viewed as handling the error
String responseBody = res.toString();
Assert.assertNotNull(responseBody);
- assertTrue(responseBody.length() > 0);
+ Assert.assertTrue(responseBody.length() > 0);
if (customError) {
- assertTrue(responseBody, responseBody.contains(CustomErrorServlet.ERROR_MESSAGE));
+ Assert.assertTrue(responseBody, responseBody.contains(CustomErrorServlet.ERROR_MESSAGE));
} else {
- assertTrue(responseBody, responseBody.contains(AsyncErrorServlet.ERROR_MESSAGE));
+ Assert.assertTrue(responseBody, responseBody.contains(AsyncErrorServlet.ERROR_MESSAGE));
}
// Without this test may complete before access log has a chance to log
@@ -1426,8 +1422,8 @@ public class TestAsyncContextImpl extend
ByteChunk body = new ByteChunk();
int rc = getUrl(url.toString(), body, null);
- assertEquals(HttpServletResponse.SC_OK, rc);
- assertEquals("OK", body.toString());
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals("OK", body.toString());
}
private static class Bug53337ServletA extends HttpServlet {
@@ -1504,9 +1500,9 @@ public class TestAsyncContextImpl extend
ByteChunk body = new ByteChunk();
int rc = getUrl(url.toString(), body, null);
- assertEquals(HttpServletResponse.SC_OK, rc);
- assertEquals("OK", body.toString());
- assertTrue(servletA.isAsyncWhenExpected());
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals("OK", body.toString());
+ Assert.assertTrue(servletA.isAsyncWhenExpected());
}
private static class Bug53843ServletA extends HttpServlet {
@@ -1753,15 +1749,15 @@ public class TestAsyncContextImpl extend
ioe.printStackTrace();
}
- assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
body.recycle();
rc = getUrl("http://localhost:" + getPort() + "/bug54178ServletB",
body, null);
- assertEquals(HttpServletResponse.SC_OK, rc);
- assertEquals("OK", body.toString());
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals("OK", body.toString());
}
private static class Bug54178ServletA extends HttpServlet {
@@ -2191,7 +2187,7 @@ public class TestAsyncContextImpl extend
getUrl("http://localhost:" + getPort()+ "/stage1");
- assertEquals("doGet-startAsync-doGet-startAsync-onStartAsync-NonAsyncServletGet-onComplete-", getTrack());
+ Assert.assertEquals("doGet-startAsync-doGet-startAsync-onStartAsync-NonAsyncServletGet-onComplete-", getTrack());
// Check the access log
alv.validateAccessLog(1, 200, 0, REQUEST_TIME);
@@ -2371,8 +2367,8 @@ public class TestAsyncContextImpl extend
}
private void checkRequestResponse(AsyncEvent event) {
- assertEquals(servletRequest, event.getSuppliedRequest());
- assertEquals(servletResponse, event.getSuppliedResponse());
+ Assert.assertEquals(servletRequest, event.getSuppliedRequest());
+ Assert.assertEquals(servletResponse, event.getSuppliedResponse());
}
};
final Context context = EasyMock.createMock(Context.class);
@@ -2537,8 +2533,8 @@ public class TestAsyncContextImpl extend
ByteChunk body = new ByteChunk();
int rc = getUrl("http://localhost:" + getPort() + EncodedDispatchServlet.ENCODED_URI, body, null);
- assertEquals(HttpServletResponse.SC_OK, rc);
- assertEquals("OK", body.toString());
+ Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+ Assert.assertEquals("OK", body.toString());
}
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestDefaultInstanceManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestDefaultInstanceManager.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestDefaultInstanceManager.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestDefaultInstanceManager.java Mon Nov 13 12:32:26 2017
@@ -18,8 +18,7 @@ package org.apache.catalina.core;
import java.io.File;
-import static org.junit.Assert.assertEquals;
-
+import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
@@ -67,7 +66,7 @@ public class TestDefaultInstanceManager
// First JSP should be unloaded and replaced by third (second left
// alone) so no change in overall count
- assertEquals(count, instanceManager.getAnnotationCacheSize());
+ Assert.assertEquals(count, instanceManager.getAnnotationCacheSize());
}
private DefaultInstanceManager doClassUnloadingPrep() throws Exception {
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestNamingContextListener.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestNamingContextListener.java?rev=1815093&r1=1815092&r2=1815093&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestNamingContextListener.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestNamingContextListener.java Mon Nov 13 12:32:26 2017
@@ -22,8 +22,7 @@ import javax.naming.NamingException;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
-import static org.junit.Assert.assertEquals;
-
+import org.junit.Assert;
import org.junit.Test;
import org.apache.catalina.LifecycleState;
@@ -64,7 +63,7 @@ public class TestNamingContextListener e
tomcat.start();
- assertEquals(LifecycleState.STARTED, ctx.getState());
+ Assert.assertEquals(LifecycleState.STARTED, ctx.getState());
}
public static final class Bug49132Listener implements ServletContextListener {
@@ -117,7 +116,7 @@ public class TestNamingContextListener e
tomcat.start();
- assertEquals(LifecycleState.STARTED, ctx.getState());
+ Assert.assertEquals(LifecycleState.STARTED, ctx.getState());
}
public static class Bug54096EnvA {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org