This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 8d1d4b60fe Minor optimisation
8d1d4b60fe is described below
commit 8d1d4b60fec9cb5b45e9acd3ad537d094d63806b
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Dec 12 18:17:35 2024 +0000
Minor optimisation
Doesn't make much difference on my local machine. Might help on CI
systems where file access is often slower.
---
...efaultServletRfc9110Section13Parameterized.java | 41 ++++++++++++----------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git
a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
index 43c94ead71..a71e3e743c 100644
---
a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
+++
b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
@@ -471,30 +471,33 @@ public class
TestDefaultServletRfc9110Section13Parameterized extends TomcatBaseT
StandardOpenOption.CREATE);
Path.of(tempDocBase.getAbsolutePath(),
"index.html").toFile().setLastModified(lastModified);
- Files.write(Path.of(tempDocBase.getAbsolutePath(), "put_exist.txt"),
"put_exist_v0".getBytes(),
- StandardOpenOption.CREATE);
- Path.of(tempDocBase.getAbsolutePath(),
"put_exist.txt").toFile().setLastModified(lastModified);
+ if (task.m.equals(HTTP_METHOD.PUT)) {
+ Files.write(Path.of(tempDocBase.getAbsolutePath(),
"put_exist.txt"), "put_exist_v0".getBytes(),
+ StandardOpenOption.CREATE);
+ Path.of(tempDocBase.getAbsolutePath(),
"put_exist.txt").toFile().setLastModified(lastModified);
+ }
- Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist.txt"), "delete_exist_v0".getBytes(),
- StandardOpenOption.CREATE);
- Path.of(tempDocBase.getAbsolutePath(),
"delete_exist.txt").toFile().setLastModified(lastModified);
+ if (task.m.equals(HTTP_METHOD.DELETE)) {
+ Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist.txt"), "delete_exist_v0".getBytes(),
+ StandardOpenOption.CREATE);
+ Path.of(tempDocBase.getAbsolutePath(),
"delete_exist.txt").toFile().setLastModified(lastModified);
- Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist1.txt"), "delete_exist1_v0".getBytes(),
- StandardOpenOption.CREATE);
- Path.of(tempDocBase.getAbsolutePath(),
"delete_exist1.txt").toFile().setLastModified(lastModified);
+ Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist1.txt"), "delete_exist1_v0".getBytes(),
+ StandardOpenOption.CREATE);
+ Path.of(tempDocBase.getAbsolutePath(),
"delete_exist1.txt").toFile().setLastModified(lastModified);
- Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist2.txt"), "delete_exist2_v0".getBytes(),
- StandardOpenOption.CREATE);
- Path.of(tempDocBase.getAbsolutePath(),
"delete_exist2.txt").toFile().setLastModified(lastModified);
+ Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist2.txt"), "delete_exist2_v0".getBytes(),
+ StandardOpenOption.CREATE);
+ Path.of(tempDocBase.getAbsolutePath(),
"delete_exist2.txt").toFile().setLastModified(lastModified);
- Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist3.txt"), "delete_exist3_v0".getBytes(),
- StandardOpenOption.CREATE);
- Path.of(tempDocBase.getAbsolutePath(),
"delete_exist3.txt").toFile().setLastModified(lastModified);
-
- Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist4.txt"), "delete_exist4_v0".getBytes(),
- StandardOpenOption.CREATE);
- Path.of(tempDocBase.getAbsolutePath(),
"delete_exist4.txt").toFile().setLastModified(lastModified);
+ Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist3.txt"), "delete_exist3_v0".getBytes(),
+ StandardOpenOption.CREATE);
+ Path.of(tempDocBase.getAbsolutePath(),
"delete_exist3.txt").toFile().setLastModified(lastModified);
+ Files.write(Path.of(tempDocBase.getAbsolutePath(),
"delete_exist4.txt"), "delete_exist4_v0".getBytes(),
+ StandardOpenOption.CREATE);
+ Path.of(tempDocBase.getAbsolutePath(),
"delete_exist4.txt").toFile().setLastModified(lastModified);
+ }
}
@Test
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]