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 7be2e6157c2e45c78f2e98e9b8e43cf71f441710
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Oct 17 15:07:54 2023 +0100

    Use file extensions for test files to aid build reproducibility
    
    Text files (identified by the extension .txt) are already handled
    correctly by the build script. Add the file extension so these files are
    included in that handling.
---
 .../core/TestPropertiesRoleMappingListener.java        | 10 +++++-----
 test/webapp-role-mapping/admin                         |  1 -
 test/webapp-role-mapping/admin.txt                     | 18 ++++++++++++++++++
 test/webapp-role-mapping/unmapped                      |  1 -
 test/webapp-role-mapping/unmapped.txt                  | 18 ++++++++++++++++++
 test/webapp-role-mapping/user                          |  1 -
 test/webapp-role-mapping/user.txt                      | 18 ++++++++++++++++++
 7 files changed, 59 insertions(+), 8 deletions(-)

diff --git 
a/test/org/apache/catalina/core/TestPropertiesRoleMappingListener.java 
b/test/org/apache/catalina/core/TestPropertiesRoleMappingListener.java
index 292483a6fd..4a9c6f3d7d 100644
--- a/test/org/apache/catalina/core/TestPropertiesRoleMappingListener.java
+++ b/test/org/apache/catalina/core/TestPropertiesRoleMappingListener.java
@@ -139,7 +139,7 @@ public class TestPropertiesRoleMappingListener extends 
TomcatBaseTest {
 
         for (String role : Arrays.asList("admin", "user", "unmapped")) {
             SecurityCollection securityCollection = new SecurityCollection();
-            securityCollection.addPattern("/" + role);
+            securityCollection.addPattern("/" + role + ".txt");
             SecurityConstraint constraint = new SecurityConstraint();
             constraint.addAuthRole(role);
             constraint.addCollection(securityCollection);
@@ -149,10 +149,10 @@ public class TestPropertiesRoleMappingListener extends 
TomcatBaseTest {
 
         tomcat.start();
 
-        testRequest("foo:bar", "/admin", 200);
-        testRequest("waldo:fred", "/user", 200);
-        testRequest("waldo:fred", "/unmapped", 403);
-        testRequest("bar:baz", "/user", 401);
+        testRequest("foo:bar", "/admin.txt", 200);
+        testRequest("waldo:fred", "/user.txt", 200);
+        testRequest("waldo:fred", "/unmapped.txt", 403);
+        testRequest("bar:baz", "/user.txt", 401);
     }
 
     private void testRequest(String credentials, String path, int statusCode) 
throws IOException {
diff --git a/test/webapp-role-mapping/admin b/test/webapp-role-mapping/admin
deleted file mode 100644
index 7fbe952b76..0000000000
--- a/test/webapp-role-mapping/admin
+++ /dev/null
@@ -1 +0,0 @@
-admin
diff --git a/test/webapp-role-mapping/admin.txt 
b/test/webapp-role-mapping/admin.txt
new file mode 100644
index 0000000000..1c188dc6b5
--- /dev/null
+++ b/test/webapp-role-mapping/admin.txt
@@ -0,0 +1,18 @@
+================================================================================
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+================================================================================
+
+admin
diff --git a/test/webapp-role-mapping/unmapped 
b/test/webapp-role-mapping/unmapped
deleted file mode 100644
index 80a617a00e..0000000000
--- a/test/webapp-role-mapping/unmapped
+++ /dev/null
@@ -1 +0,0 @@
-unmapped
diff --git a/test/webapp-role-mapping/unmapped.txt 
b/test/webapp-role-mapping/unmapped.txt
new file mode 100644
index 0000000000..292952af74
--- /dev/null
+++ b/test/webapp-role-mapping/unmapped.txt
@@ -0,0 +1,18 @@
+================================================================================
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+================================================================================
+
+unmapped
diff --git a/test/webapp-role-mapping/user b/test/webapp-role-mapping/user
deleted file mode 100644
index 4eb8387fed..0000000000
--- a/test/webapp-role-mapping/user
+++ /dev/null
@@ -1 +0,0 @@
-user
diff --git a/test/webapp-role-mapping/user.txt 
b/test/webapp-role-mapping/user.txt
new file mode 100644
index 0000000000..0fed8a48b9
--- /dev/null
+++ b/test/webapp-role-mapping/user.txt
@@ -0,0 +1,18 @@
+================================================================================
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+================================================================================
+
+user


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

Reply via email to