(tomcat) branch 8.5.x updated: Fix failing test.

2023-12-06 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 97ca59504d Fix failing test.
97ca59504d is described below

commit 97ca59504dc6747fbfbc7619c55069a9441308fa
Author: Mark Thomas 
AuthorDate: Wed Dec 6 08:55:03 2023 +

Fix failing test.

NIO2 + Windows behaves slightly differently to NIO2 + Linux.
---
 test/org/apache/catalina/connector/TestClientReadTimeout.java | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/connector/TestClientReadTimeout.java 
b/test/org/apache/catalina/connector/TestClientReadTimeout.java
index 66a3334487..9342249ab0 100644
--- a/test/org/apache/catalina/connector/TestClientReadTimeout.java
+++ b/test/org/apache/catalina/connector/TestClientReadTimeout.java
@@ -22,6 +22,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.net.Socket;
+import java.net.SocketException;
 import java.nio.charset.StandardCharsets;
 
 import javax.servlet.ServletException;
@@ -65,7 +66,12 @@ public class TestClientReadTimeout extends TomcatBaseTest {
 os.write(request.getBytes(StandardCharsets.UTF_8));
 InputStream is = socket.getInputStream();
 BufferedReader reader = new BufferedReader(new 
InputStreamReader(is, StandardCharsets.UTF_8));
-String opening = reader.readLine();
+String opening = null;
+try {
+opening = reader.readLine();
+} catch (SocketException e) {
+// Handled below. An exception here means opening will be null
+}
 if 
(tomcat.getConnector().getProtocolHandlerClassName().contains("Nio2")) {
 Assert.assertNull("NIO2 unexpectedly returned a response", 
opening);
 } else {


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



[tomcat] branch 8.5.x updated: Fix failing test

2023-06-02 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new dfa633aa4b Fix failing test
dfa633aa4b is described below

commit dfa633aa4b31ba3cca27f5e1d1880e202a04eaee
Author: Mark Thomas 
AuthorDate: Fri Jun 2 08:08:22 2023 +0100

Fix failing test
---
 test/org/apache/catalina/valves/TestPersistentValve.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/org/apache/catalina/valves/TestPersistentValve.java 
b/test/org/apache/catalina/valves/TestPersistentValve.java
index 847f31454d..9cbd3cbd60 100644
--- a/test/org/apache/catalina/valves/TestPersistentValve.java
+++ b/test/org/apache/catalina/valves/TestPersistentValve.java
@@ -45,6 +45,9 @@ public class TestPersistentValve {
 pv.setContainer(request.getContext());
 pv.setNext(testerValve);
 
+// Call the necessary lifecycle methods
+pv.init();
+
 // Run the test
 Thread[] threads = new Thread[5];
 


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



[tomcat] branch 8.5.x updated: Fix failing test. RequestFacade has been updated to throw ISE not NPE

2023-02-17 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new fbcae901cf Fix failing test. RequestFacade has been updated to throw 
ISE not NPE
fbcae901cf is described below

commit fbcae901cf9ebc6f79fc0ae5bdf6bd72224f1e36
Author: Mark Thomas 
AuthorDate: Fri Feb 17 14:58:36 2023 +

Fix failing test. RequestFacade has been updated to throw ISE not NPE
---
 test/org/apache/catalina/core/TestAsyncContextImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 1af3847812..14a10525ab 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -377,7 +377,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
 // really checking here is that it does not
 // return true.
 result.append(req.isAsyncStarted());
-} catch (NullPointerException npe) {
+} catch (IllegalStateException ise) {
 result.append("false");
 }
 done = true;


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



[tomcat] branch 8.5.x updated: Fix failing test

2020-07-08 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 4183aba  Fix failing test
4183aba is described below

commit 4183aba52d95d3303c4724adb26444cb322897d8
Author: Mark Thomas 
AuthorDate: Wed Jul 8 15:56:06 2020 +0100

Fix failing test
---
 test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java 
b/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
index 91b9034..f5c5e03 100644
--- a/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
+++ b/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
@@ -254,7 +254,7 @@ public class TestEncodingDecoding extends TomcatBaseTest {
 // Should not take very long
 int i = 0;
 while (i < WAIT_LOOPS) {
-if (server.received.size() > 0 && client.received.size() > 0) {
+if (server.received.size() > 0 && client.received.size() > 1) {
 break;
 }
 i++;


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



[tomcat] branch 8.5.x updated: Fix failing test

2020-02-04 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new bd70066  Fix failing test
bd70066 is described below

commit bd7006679a864b195c0870852b9c9dba2c09c4a3
Author: Mark Thomas 
AuthorDate: Tue Feb 4 19:28:11 2020 +

Fix failing test
---
 test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java | 13 +
 1 file changed, 13 insertions(+)

diff --git a/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java 
b/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
index 7f98001..a93da60 100644
--- a/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
+++ b/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
@@ -33,14 +33,27 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
 
 import org.apache.catalina.Context;
+import org.apache.catalina.connector.Connector;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 
 public class TestAbstractAjpProcessor extends TomcatBaseTest {
 
+@Before
+@Override
+public void setUp() throws Exception {
+super.setUp();
+
+Connector c = getTomcatInstance().getConnector();
+c.setProperty("secretRequired", "false");
+c.setProperty("allowedArbitraryRequestAttributes", "MYATTRIBUTE.*");
+}
+
+
 @Override
 protected String getProtocol() {
 /*


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



[tomcat] branch 8.5.x updated: Fix failing test

2019-04-10 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 7b961c2  Fix failing test
7b961c2 is described below

commit 7b961c26af8b3057e4d100e74814e6e04dfb946e
Author: Mark Thomas 
AuthorDate: Wed Apr 10 13:28:47 2019 +0100

Fix failing test
---
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index 16398c2..c2bbae3 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -53,7 +53,8 @@ public class TestCGIServletCmdLineArguments {
 } catch (IllegalAccessException | NoSuchFieldException | 
SecurityException e) {
 }
 
-Assert.assertEquals(defaultDecodedPatternWindows, p);
+Assert.assertNotNull(p);
+Assert.assertEquals(defaultDecodedPatternWindows.toString(), 
p.toString());
 }
 }
 


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