(struts) branch WW-5352-parameter-annotation-3 updated (56d8361b4 -> 49b9c0c78)

2024-01-13 Thread kusal
This is an automated email from the ASF dual-hosted git repository.

kusal pushed a change to branch WW-5352-parameter-annotation-3
in repository https://gitbox.apache.org/repos/asf/struts.git


from 56d8361b4 WW-5352 Implement transition mode
 add 49b9c0c78 WW-5352 Ensure superclasses and interfaces allowlisted

No new revisions were added by this update.

Summary of changes:
 .../parameter/ParametersInterceptor.java   | 13 +--
 .../parameter/StrutsParameterAnnotationTest.java   | 40 ++
 2 files changed, 36 insertions(+), 17 deletions(-)



(struts) 01/02: WW-5352 Clean up OgnlValueStackTest

2024-01-13 Thread kusal
This is an automated email from the ASF dual-hosted git repository.

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

commit 3c8fff46d4a6e9cdd5460b527b25f847d5f524d3
Author: Kusal Kithul-Godage 
AuthorDate: Sun Jan 14 16:37:14 2024 +1100

WW-5352 Clean up OgnlValueStackTest
---
 .../xwork2/ognl/OgnlValueStackTest.java| 123 +
 1 file changed, 51 insertions(+), 72 deletions(-)

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 ebd809674..ad5a301ad 100644
--- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
@@ -90,43 +90,37 @@ public class OgnlValueStackTest extends XWorkTestCase {
 @Override
 public void setUp() throws Exception {
 super.setUp();
-ognlUtil = container.getInstance(OgnlUtil.class);
-vs = createValueStack(true);
-}
-
-private OgnlValueStack createValueStack(boolean allowStaticFieldAccess) {
-OgnlValueStack stack = new OgnlValueStack(
-container.getInstance(XWorkConverter.class),
-(CompoundRootAccessor) container.getInstance(RootAccessor.class),
-container.getInstance(TextProvider.class, "system"), 
allowStaticFieldAccess);
-container.inject(stack);
-return stack;
+refreshContainerFields();
 }
 
-/**
- * @return current OgnlValueStackFactory instance from current container
- */
-private OgnlValueStackFactory getValueStackFactory() {
-return (OgnlValueStackFactory) 
container.getInstance(ValueStackFactory.class);
+protected void refreshContainerFields() {
+ognlUtil = container.getInstance(OgnlUtil.class);
+vs = (OgnlValueStack) 
container.getInstance(ValueStackFactory.class).createValueStack();
 }
 
 /**
- * Reloads container and gets a new OgnlValueStackFactory with specified 
new configuration.
+ * Reloads container and sets a new OgnlValueStackFactory with specified 
new configuration.
  * Intended for testing OgnlValueStack instance(s) that are minimally 
configured.
  * This should help ensure no underlying configuration/injection 
side-effects are responsible
  * for the behaviour of fundamental access control flags).
  *
  * @param allowStaticField new allowStaticField configuration
- * @return a new OgnlValueStackFactory with specified new configuration
  */
-private OgnlValueStackFactory reloadValueStackFactory(boolean 
allowStaticField) {
-try {
-reloadTestContainerConfiguration(allowStaticField);
-} catch (Exception ex) {
-fail("Unable to reload container configuration and configure 
ognlValueStackFactory - exception: " + ex);
-}
+private void reloadTestContainerConfiguration(boolean allowStaticField) {
+Map properties = new HashMap<>();
+properties.put(StrutsConstants.STRUTS_ALLOW_STATIC_FIELD_ACCESS, 
Boolean.toString(allowStaticField));
+reloadTestContainerConfiguration(properties);
+}
 
-return getValueStackFactory();
+private void reloadTestContainerConfiguration(Map 
properties) {
+loadConfigurationProviders(new StubConfigurationProvider() {
+@Override
+public void register(ContainerBuilder builder,
+ LocatableProperties props) throws 
ConfigurationException {
+properties.forEach(props::setProperty);
+}
+});
+refreshContainerFields();
 }
 
 public void testExpOverridesCanStackExpUp() throws Exception {
@@ -1159,31 +1153,29 @@ public class OgnlValueStackTest extends XWorkTestCase {
  * when a default configuration is used.
  */
 public void testOgnlValueStackFromOgnlValueStackFactoryDefaultConfig() 
throws IllegalAccessException {
-OgnlValueStackFactory ognlValueStackFactory = getValueStackFactory();
-OgnlValueStack ognlValueStack = (OgnlValueStack) 
ognlValueStackFactory.createValueStack();
 Object accessedValue;
 
 assertTrue("OgnlValueStackFactory staticFieldAccess (default flags) 
not true?",
-reflectField(ognlValueStack.securityMemberAccess, 
"allowStaticFieldAccess"));
+reflectField(vs.securityMemberAccess, 
"allowStaticFieldAccess"));
 // An OgnlValueStack created from the above OgnlValueStackFactory 
should allow public field access,
 // but prevent non-public field access.  It should also deny static 
method access.
-accessedValue = 
ognlValueStack.findValue("@com.opensymphony.xwork2.ognl.OgnlValueStackTest@staticInteger100Method()");
+accessedValue = 
vs.findValue("@com.opensymphony.xwork2.ognl.OgnlValueStackTest@staticInteger100Method()");
  

(struts) branch WW-5352-ognlvaluestack created (now 9c575becf)

2024-01-13 Thread kusal
This is an automated email from the ASF dual-hosted git repository.

kusal pushed a change to branch WW-5352-ognlvaluestack
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 9c575becf WW-5352 Move method to XWorkTestCase

This branch includes the following new commits:

 new 3c8fff46d WW-5352 Clean up OgnlValueStackTest
 new 9c575becf WW-5352 Move method to XWorkTestCase

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(struts) 02/02: WW-5352 Move method to XWorkTestCase

2024-01-13 Thread kusal
This is an automated email from the ASF dual-hosted git repository.

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

commit 9c575becfe730853aedd8e89c0a15db47307b524
Author: Kusal Kithul-Godage 
AuthorDate: Sun Jan 14 18:08:56 2024 +1100

WW-5352 Move method to XWorkTestCase
---
 .../java/com/opensymphony/xwork2/XWorkTestCase.java| 10 ++
 .../opensymphony/xwork2/ognl/OgnlValueStackTest.java   | 18 --
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/core/src/main/java/com/opensymphony/xwork2/XWorkTestCase.java 
b/core/src/main/java/com/opensymphony/xwork2/XWorkTestCase.java
index dc6bb2508..e615e1a79 100644
--- a/core/src/main/java/com/opensymphony/xwork2/XWorkTestCase.java
+++ b/core/src/main/java/com/opensymphony/xwork2/XWorkTestCase.java
@@ -73,6 +73,16 @@ public abstract class XWorkTestCase extends TestCase {
 actionProxyFactory = container.getInstance(ActionProxyFactory.class);
 }
 
+protected void loadButSet(Map properties) {
+loadConfigurationProviders(new StubConfigurationProvider() {
+@Override
+public void register(ContainerBuilder builder,
+ LocatableProperties props) throws 
ConfigurationException {
+properties.forEach((k,v)-> props.setProperty(k, 
String.valueOf(v)));
+}
+});
+}
+
 protected  void loadButAdd(final Class type, final T impl) {
 loadButAdd(type, Container.DEFAULT_NAME, impl);
 }
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 ad5a301ad..3bdfd67fc 100644
--- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
@@ -106,20 +106,10 @@ public class OgnlValueStackTest extends XWorkTestCase {
  *
  * @param allowStaticField new allowStaticField configuration
  */
-private void reloadTestContainerConfiguration(boolean allowStaticField) {
+private void reloadContainer(boolean allowStaticField) {
 Map properties = new HashMap<>();
 properties.put(StrutsConstants.STRUTS_ALLOW_STATIC_FIELD_ACCESS, 
Boolean.toString(allowStaticField));
-reloadTestContainerConfiguration(properties);
-}
-
-private void reloadTestContainerConfiguration(Map 
properties) {
-loadConfigurationProviders(new StubConfigurationProvider() {
-@Override
-public void register(ContainerBuilder builder,
- LocatableProperties props) throws 
ConfigurationException {
-properties.forEach(props::setProperty);
-}
-});
+loadButSet(properties);
 refreshContainerFields();
 }
 
@@ -1184,7 +1174,7 @@ public class OgnlValueStackTest extends XWorkTestCase {
  * when static access flag is set to false.
  */
 public void testOgnlValueStackFromOgnlValueStackFactoryNoStaticAccess() 
throws IllegalAccessException {
-reloadTestContainerConfiguration(false);
+reloadContainer(false);
 Object accessedValue;
 
 assertFalse("OgnlValueStackFactory staticFieldAccess (set false) not 
false?",
@@ -1216,7 +1206,7 @@ public class OgnlValueStackTest extends XWorkTestCase {
  * when static access flag is set to true.
  */
 public void testOgnlValueStackFromOgnlValueStackFactoryAllStaticAccess() 
throws IllegalAccessException {
-reloadTestContainerConfiguration(true);
+reloadContainer(true);
 Object accessedValue;
 
 assertTrue("OgnlValueStackFactory staticFieldAccess (set true) not 
true?",



(struts) branch WW-5352-ognlvaluestack updated (9c575becf -> 9b5cb2d7b)

2024-01-13 Thread kusal
This is an automated email from the ASF dual-hosted git repository.

kusal pushed a change to branch WW-5352-ognlvaluestack
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard 9c575becf WW-5352 Move method to XWorkTestCase
 add 9b5cb2d7b WW-5352 Move method to XWorkTestCase

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (9c575becf)
\
 N -- N -- N   refs/heads/WW-5352-ognlvaluestack (9b5cb2d7b)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 core/src/main/java/com/opensymphony/xwork2/XWorkTestCase.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)