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

kusal pushed a commit to branch WW-5339-node-constr
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 9089ede4fa1e3dcde0d2c3a051c938494c575867
Author: Kusal Kithul-Godage <g...@kusal.io>
AuthorDate: Wed Aug 30 13:57:01 2023 +1000

    WW-5339 Add unit test for CompoundRootAccessor exclusion list
---
 .../xwork2/ognl/OgnlValueStackTest.java            |  8 +++++++
 core/src/test/resources/test-exclusion.xml         | 27 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git 
a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java 
b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
index 5f0ac5b26..90f855508 100644
--- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
@@ -980,6 +980,14 @@ public class OgnlValueStackTest extends XWorkTestCase {
         assertNull(vs.findValue("@com.nothing.here.Nothing@BLAH"));
     }
 
+    public void testExclusionList() {
+        loadConfigurationProviders(new 
StrutsXmlConfigurationProvider("test-exclusion.xml"));
+
+        vs = createValueStack(true);
+
+        assertNull(vs.findValue("@java.math.RoundingMode@HALF_DOWN"));
+    }
+
     /**
      * Fails on 2.5.20 and earlier - tested on 2.5 (5/5/2016) and failed
      *
diff --git a/core/src/test/resources/test-exclusion.xml 
b/core/src/test/resources/test-exclusion.xml
new file mode 100644
index 000000000..b35e96073
--- /dev/null
+++ b/core/src/test/resources/test-exclusion.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * 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.
+ */
+-->
+<!DOCTYPE struts PUBLIC
+        "-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
+        "https://struts.apache.org/dtds/struts-6.0.dtd";>
+<struts>
+    <constant name="struts.excludedClasses" value="java.math.RoundingMode"/>
+</struts>

Reply via email to