[struts] 01/01: WW-4043 Moves TestUtils into junit-plugin
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch WW-4043-moves-test-utils in repository https://gitbox.apache.org/repos/asf/struts.git commit 592c942c764c3eeca69ca04a4e93f824dcbd6a53 Author: Lukasz Lenart AuthorDate: Sun Apr 26 09:31:18 2020 +0200 WW-4043 Moves TestUtils into junit-plugin --- .../test/java/org/apache/struts2/TestUtils.java| 94 -- .../apache/struts2/json/DefaultJSONWriterTest.java | 1 + .../apache/struts2/json/JSONInterceptorTest.java | 1 + .../org/apache/struts2/json/JSONPopulatorTest.java | 1 + .../org/apache/struts2/json/JSONResultTest.java| 3 +- .../json/JSONValidationInterceptorTest.java| 1 + .../java/org/apache/struts2/util}/TestUtils.java | 42 +- 7 files changed, 23 insertions(+), 120 deletions(-) diff --git a/core/src/test/java/org/apache/struts2/TestUtils.java b/core/src/test/java/org/apache/struts2/TestUtils.java deleted file mode 100644 index 32f5630..000 --- a/core/src/test/java/org/apache/struts2/TestUtils.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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. - */ -package org.apache.struts2; - -import java.io.InputStream; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.StringTokenizer; - -/** - * Utility methods for test classes - * - */ -public class TestUtils { -/** - * normalizes a string so that strings generated on different platforms can be compared. any group of one or more - * space, tab, \r, and \n characters are converted to a single space character - * - * @param obj the object to be normalized. normalize will perform its operation on obj.toString().trim() ; - * @param appendSpace - * @return the normalized string - */ -public static String normalize(Object obj, boolean appendSpace) { -StringTokenizer st = -new StringTokenizer(obj.toString().trim(), " \t\r\n"); -StringBuilder buffer = new StringBuilder(128); - -while(st.hasMoreTokens()) { -buffer.append(st.nextToken()); -} - -return buffer.toString(); -} - - -public static String normalize(URL url) throws Exception { -return normalize(readContent(url), true); -} -/** - * Attempt to verify the contents of text against the contents of the URL specified. Performs a - * trim on both ends - * - * @param url the HTML snippet that we want to validate against - * @throws Exception if the validation failed - */ -public static boolean compare(URL url, String text) -throws Exception { -/** - * compare the trimmed values of each buffer and make sure they're equivalent. however, let's make sure to - * normalize the strings first to account for line termination differences between platforms. - */ -String writerString = TestUtils.normalize(text, true); -String bufferString = TestUtils.normalize(readContent(url), true); - -return bufferString.equals(writerString); -} - - - -public static String readContent(URL url) -throws Exception { -if(url == null) { -throw new Exception("unable to verify a null URL"); -} - -StringBuilder buffer = new StringBuilder(128); -try (InputStream in = url.openStream()) { -byte[] buf = new byte[4096]; -int nbytes; - -while ((nbytes = in.read(buf)) > 0) { -buffer.append(new String(buf, 0, nbytes)); -} -} - -return buffer.toString(); -} -} diff --git a/plugins/json/src/test/java/org/apache/struts2/json/DefaultJSONWriterTest.java b/plugins/json/src/test/java/org/apache/struts2/json/DefaultJSONWriterTest.java index 1f34921..05e3280 100644 --- a/plugins/json/src/test/java/org/apache/struts2/json/DefaultJSONWriterTest.java +++ b/plugins/json/src/test/java/org/apache/struts2/json/DefaultJSONWriterTest.java @@ -21,6 +21,7 @@ package org.apache.struts2.json; import org.apache.struts2.StrutsTestCase; import org.apache.struts2.json.annotations.JSONFieldBridge; import org.apache.struts2.json.br
[struts] branch WW-4043-moves-test-utils created (now 592c942)
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a change to branch WW-4043-moves-test-utils in repository https://gitbox.apache.org/repos/asf/struts.git. at 592c942 WW-4043 Moves TestUtils into junit-plugin This branch includes the following new commits: new 592c942 WW-4043 Moves TestUtils into junit-plugin The 1 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-site] branch master updated: Trigger re-deploy
This is an automated email from the ASF dual-hosted git repository. rgielen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/struts-site.git The following commit(s) were added to refs/heads/master by this push: new 8d69e99 Trigger re-deploy 8d69e99 is described below commit 8d69e995e493cd94803a7abb80014067fd6930df Author: René Gielen AuthorDate: Sun Apr 26 12:19:05 2020 +0200 Trigger re-deploy --- source/primer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/primer.md b/source/primer.md index 937b2e3..895edc7 100644 --- a/source/primer.md +++ b/source/primer.md @@ -242,7 +242,7 @@ Pragmatic security can be used to fine-tune security make authorization decision the parameters of a call, or the internal state of a Web component. It can also be used to restrict authentication based on information in a database. -For more about security, you should read the [Java EE tutorial](http://docs.oracle.com/javaee/6/tutorial/doc/gijrp.html). +For more about security you should read the [Java EE tutorial](http://docs.oracle.com/javaee/6/tutorial/doc/gijrp.html). Other projects, like [Apache Shiro](http://shiro.apache.org/) or [Spring Security](https://spring.io/projects/spring-security/) might also help you to secure your web application.
Buildbot success in on jekyll_websites
The Buildbot has detected a passing build on builder jekyll_websites while building struts. Full details are available at: https://ci2.apache.org/#builders/7/builds/93 Buildbot URL: https://ci2.apache.org/ Worker for this Build: bb_slave10_ubuntu Build Reason: Triggered jekyll auto-build via .asf.yaml by rgielen Blamelist: asfinfra, commits@struts.apache.org Build succeeded! Sincerely, -The Buildbot
[struts-site] branch asf-site updated: Automatic Site Publish by Buildbot
This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/struts-site.git The following commit(s) were added to refs/heads/asf-site by this push: new adcd05a Automatic Site Publish by Buildbot adcd05a is described below commit adcd05a4dc8ea709ae5cfebd4f1600e3336312ad Author: buildbot AuthorDate: Sun Apr 26 10:19:56 2020 + Automatic Site Publish by Buildbot --- output/primer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/primer.html b/output/primer.html index 0f0478a..3c0fa51 100644 --- a/output/primer.html +++ b/output/primer.html @@ -393,7 +393,7 @@ Pragmatic security can be used to fine-tune security make authorization decision the parameters of a call, or the internal state of a Web component. It can also be used to restrict authentication based on information in a database. -For more about security, you should read the http://docs.oracle.com/javaee/6/tutorial/doc/gijrp.html";>Java EE tutorial. +For more about security you should read the http://docs.oracle.com/javaee/6/tutorial/doc/gijrp.html";>Java EE tutorial. Other projects, like http://shiro.apache.org/";>Apache Shiro or https://spring.io/projects/spring-security/";>Spring Security might also help you to secure your web application.
[struts] branch master updated: Merge pull request #404 from JCgH4164838Gh792C124B5/WW-5069
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/struts.git The following commit(s) were added to refs/heads/master by this push: new 9faa39c Merge pull request #404 from JCgH4164838Gh792C124B5/WW-5069 new 387c203 Merge pull request #409 from JCgH4164838Gh792C124B5/WW-5069_CPickPR404 9faa39c is described below commit 9faa39c8dc7d6cbdc10ebb393531a90a3ec58c97 Author: Lukasz Lenart AuthorDate: Mon Apr 20 07:23:57 2020 +0200 Merge pull request #404 from JCgH4164838Gh792C124B5/WW-5069 Initial fix for WW-5069 (improve build behaviour JDK9+) (cherry picked from commit 1526b36dd623164d671ec1f03ecf832b6b71f313) --- .../java/com/opensymphony/xwork2/validator/DateRangeValidatorTest.java | 1 + .../com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java | 1 + 2 files changed, 2 insertions(+) diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/DateRangeValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/DateRangeValidatorTest.java index a8f64e9..98a5ed0 100644 --- a/core/src/test/java/com/opensymphony/xwork2/validator/DateRangeValidatorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/validator/DateRangeValidatorTest.java @@ -48,6 +48,7 @@ public class DateRangeValidatorTest extends XWorkTestCase { HashMap params = new HashMap<>(); params.put("date", date.getTime()); context.put(ActionContext.PARAMETERS, HttpParameters.create(params).build()); +context.put(ActionContext.LOCALE, Locale.US); // Force US Locale for date conversion tests on JDK9+ ActionProxy proxy = actionProxyFactory.createActionProxy("", MockConfigurationProvider.VALIDATION_ACTION_NAME, null, context); proxy.execute(); diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java index 62ed2ba..0b64968 100644 --- a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java @@ -40,6 +40,7 @@ public class VisitorFieldValidatorTest extends XWorkTestCase { public void setUp() throws Exception { super.setUp(); +ActionContext.getContext().put(ActionContext.LOCALE, Locale.US); // Force US Locale for date conversion tests on JDK9+ action = container.inject(VisitorValidatorTestAction.class); TestBean bean = action.getBean();
[struts] branch struts-2-5-x updated (5c82f02 -> e32bd7d)
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a change to branch struts-2-5-x in repository https://gitbox.apache.org/repos/asf/struts.git. from 5c82f02 Merge pull request #400 from atkaiser/WW5065-FixAbstractMatcherReplaceParams add 30b4304 WW-5065 Defines a new flag to control appending params add 2eeac36 WW-5065 Cleans up code and marks old constructor as deprecated add 6e1d2ad WW-5065 Adds missing flag value new e32bd7d Merge pull request #405 from apache/WW-5065-append-or-not The 1 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. Summary of changes: .../xwork2/config/impl/AbstractMatcher.java| 69 -- .../xwork2/config/impl/ActionConfigMatcher.java| 28 - .../xwork2/config/impl/DefaultConfiguration.java | 17 -- .../xwork2/config/impl/NamespaceMatcher.java | 20 ++- .../providers/XWorkConfigurationProvider.java | 2 + .../java/org/apache/struts2/StrutsConstants.java | 3 + .../config/impl/ActionConfigMatcherTest.java | 61 ++- 7 files changed, 160 insertions(+), 40 deletions(-)
[struts] 01/01: Merge pull request #405 from apache/WW-5065-append-or-not
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch struts-2-5-x in repository https://gitbox.apache.org/repos/asf/struts.git commit e32bd7dba9477496c4a7b3ce3c30630bf0a3bc3b Merge: 5c82f02 6e1d2ad Author: Lukasz Lenart AuthorDate: Sun Apr 26 19:51:29 2020 +0200 Merge pull request #405 from apache/WW-5065-append-or-not [WW-5065] Defines a new flag to control appending params .../xwork2/config/impl/AbstractMatcher.java| 69 -- .../xwork2/config/impl/ActionConfigMatcher.java| 28 - .../xwork2/config/impl/DefaultConfiguration.java | 17 -- .../xwork2/config/impl/NamespaceMatcher.java | 20 ++- .../providers/XWorkConfigurationProvider.java | 2 + .../java/org/apache/struts2/StrutsConstants.java | 3 + .../config/impl/ActionConfigMatcherTest.java | 61 ++- 7 files changed, 160 insertions(+), 40 deletions(-)
[struts] branch WW-5017-drop-validation updated (4a8315f -> 13cbf0e)
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a change to branch WW-5017-drop-validation in repository https://gitbox.apache.org/repos/asf/struts.git. omit 4a8315f WW-5017 Drops deprecated Validation annotation as not needed new 13cbf0e WW-5017 Drops deprecated Validation annotation as not needed 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 (4a8315f) \ N -- N -- N refs/heads/WW-5017-drop-validation (13cbf0e) 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. The 1 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. Summary of changes: .../test/java/com/opensymphony/xwork2/test/AnnotationUserMarker.java | 3 --- 1 file changed, 3 deletions(-)
[struts] 01/01: WW-5017 Drops deprecated Validation annotation as not needed
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch WW-5017-drop-validation in repository https://gitbox.apache.org/repos/asf/struts.git commit 13cbf0e4188fef8b44e61a51b619cf57e62fbabd Author: Lukasz Lenart AuthorDate: Sun Apr 26 07:50:13 2020 +0200 WW-5017 Drops deprecated Validation annotation as not needed --- .../AnnotationValidationConfigurationBuilder.java | 10 -- .../xwork2/validator/annotations/Validation.java | 141 - .../xwork2/SimpleAnnotationAction.java | 6 +- .../xwork2/test/AnnotationDataAware.java | 1 - .../opensymphony/xwork2/test/AnnotationUser.java | 23 ++-- .../xwork2/test/AnnotationUserMarker.java | 22 ++-- .../ValidateAnnotatedMethodOnlyAction.java | 7 +- 7 files changed, 21 insertions(+), 189 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java b/core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java index 5b41afd..64f46d5 100644 --- a/core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java +++ b/core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java @@ -73,16 +73,6 @@ public class AnnotationValidationConfigurationBuilder { if (a instanceof Validations) { processValidationAnnotation(a, fieldName, methodName, result); } - -// Process single custom validator -if (a instanceof Validation) { -Validation v = (Validation) a; -if (v.validations() != null) { -for (Validations val : v.validations()) { -processValidationAnnotation(val, fieldName, methodName, result); -} -} -} // Process single custom validator else if (a instanceof ExpressionValidator) { ExpressionValidator v = (ExpressionValidator) a; diff --git a/core/src/main/java/com/opensymphony/xwork2/validator/annotations/Validation.java b/core/src/main/java/com/opensymphony/xwork2/validator/annotations/Validation.java deleted file mode 100644 index 036b2dd..000 --- a/core/src/main/java/com/opensymphony/xwork2/validator/annotations/Validation.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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. - */ -package com.opensymphony.xwork2.validator.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * - * This annotation has been deprecated since 2.1 as its previous purpose, to define classes that support annotation validations, - * is no longer necessary. - * - * - * Annotation usage: - * - * - * The Validation annotation must be applied at Type level. - * - * - * Annotation parameters: - * - * - * - * - * Parameter - * Required - * Default - * Notes - * - * - * validations - * yes - * - * - * - * - * - * - * Example code: - * - * An Annotated Interface - * - * - * @Validation() - * public interface AnnotationDataAware { - * - * void setBarObj(Bar b); - * - * Bar getBarObj(); - * - * @RequiredFieldValidator(message = "You must enter a value for data.") - * @RequiredStringValidator(message = "You must enter a value for data.") - * void setData(String data); - * - * String getData(); - * } - * - * - * - * Example code: - * - * An Annotated Class - * - * - * @Validation() - * public class SimpleAnnotationAction extends ActionSupport { - * - * @RequiredFieldValidator(type = ValidatorType.FIELD, message = "You must enter a value for bar.") - * @IntRangeFieldValidator(type = ValidatorType.FIELD, min = "6", max = "10", message = "bar must be between ${min} and ${max}, current value is ${bar}.") - * public void setBar(int bar) { - * this.bar = bar; - * } - * - * public int getBar() { - * retu
[struts] branch WW-5070-root-action-model updated (19c71ff -> d826efb)
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a change to branch WW-5070-root-action-model in repository https://gitbox.apache.org/repos/asf/struts.git. from 19c71ff WW-5070 Adds more sophisticated logic to search for the Root new 333f781 WW-5070 Generates a new serialVersionUID new 48435c4 WW-5070 Uses else if to avoid double operation on stack new d826efb WW-5070 Re-phrases JavaDoc for setRoot() method The 3 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. Summary of changes: .../src/main/java/org/apache/struts2/json/JSONResult.java | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-)
[struts] 03/03: WW-5070 Re-phrases JavaDoc for setRoot() method
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch WW-5070-root-action-model in repository https://gitbox.apache.org/repos/asf/struts.git commit d826efb9d09d2fc0b09a2eafde5bafc38ff3c6a8 Author: Lukasz Lenart AuthorDate: Mon Apr 27 08:20:39 2020 +0200 WW-5070 Re-phrases JavaDoc for setRoot() method --- plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java index ba46d96..26c1735 100644 --- a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java +++ b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java @@ -296,8 +296,8 @@ public class JSONResult implements Result { /** * Sets the root object to be serialized, defaults to the Action. - * If the Action implements {@link ModelDriven}, model will be used instead - * and assumptions is the Model was pushed on the top of the stack + * If the Action implements {@link ModelDriven}, the Model will be used instead, + * with the logic assuming the Model was pushed onto the top of the stack. * * @param root OGNL expression of root object to be serialized */
[struts] 02/03: WW-5070 Uses else if to avoid double operation on stack
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch WW-5070-root-action-model in repository https://gitbox.apache.org/repos/asf/struts.git commit 48435c42095b201f606eb39e86137cb213bfbd4d Author: Lukasz Lenart AuthorDate: Mon Apr 27 08:19:29 2020 +0200 WW-5070 Uses else if to avoid double operation on stack --- plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java index bb35bf2..ba46d96 100644 --- a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java +++ b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java @@ -224,9 +224,8 @@ public class JSONResult implements Result { if (rootObject instanceof ModelDriven) { LOG.debug("Action is an instance of ModelDriven, assuming model is on the top of the stack and using it"); rootObject = stack.peek(); -} -if (rootObject == null) { -LOG.debug("Neither #action nor ModelDriven, peeking up object from top of the stack"); +} else if (rootObject == null) { +LOG.debug("Neither #action nor ModelDriven, peeking up object from the top of the stack"); rootObject = stack.peek(); } }
[struts] 01/03: WW-5070 Generates a new serialVersionUID
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch WW-5070-root-action-model in repository https://gitbox.apache.org/repos/asf/struts.git commit 333f7812073a51530407538033fa6ff747470c02 Author: Lukasz Lenart AuthorDate: Mon Apr 27 08:17:35 2020 +0200 WW-5070 Generates a new serialVersionUID --- plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java index 5c38e58..bb35bf2 100644 --- a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java +++ b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java @@ -69,6 +69,8 @@ import com.opensymphony.xwork2.util.WildcardUtil; */ public class JSONResult implements Result { +private static final long serialVersionUID = 233903199020467341L; + private static final Logger LOG = LogManager.getLogger(JSONResult.class); /**