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

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


The following commit(s) were added to refs/heads/main by this push:
     new 9a42b4abfe Use file extensions for test files to aid build 
reproducibility
9a42b4abfe is described below

commit 9a42b4abfe13f749212db6fcd98eb28243a3c659
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 04d0ed18c4..2d6ea7468f 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