You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2020/05/17 06:56:45 UTC

[struts-archetypes] branch master updated: Minor archetype fixes: - Allow the unit tests for projects built from the Angular and Convention archetypes to run under JDK 11 (issue not seen with JDK8). - Fix broken unit test for projects built from Blank archetype. - Fix broken unit test for projects built from Convention archetype. - Fix comment typo in HelloAction for the Convention archetype.

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-archetypes.git


The following commit(s) were added to refs/heads/master by this push:
     new 8aae883  Minor archetype fixes: - Allow the unit tests for projects built from the Angular and Convention   archetypes to run under JDK 11 (issue not seen with JDK8). - Fix broken unit test for projects built from Blank archetype. - Fix broken unit test for projects built from Convention archetype. - Fix comment typo in HelloAction for the Convention archetype.
     new fc87415  Merge pull request #6 from JCgH4164838Gh792C124B5/FixGeneratedTestBugs
8aae883 is described below

commit 8aae883fa5a50ef6b2a0f336705ebcf396de3cc7
Author: JCgH4164838Gh792C124B5 <43...@users.noreply.github.com>
AuthorDate: Sat May 16 17:47:17 2020 -0400

    Minor archetype fixes:
    - Allow the unit tests for projects built from the Angular and Convention
      archetypes to run under JDK 11 (issue not seen with JDK8).
    - Fix broken unit test for projects built from Blank archetype.
    - Fix broken unit test for projects built from Convention archetype.
    - Fix comment typo in HelloAction for the Convention archetype.
---
 .../src/main/resources/archetype-resources/pom.xml                | 8 ++++++++
 .../archetype-resources/src/test/java/example/LoginTest.java      | 2 +-
 .../src/main/resources/archetype-resources/pom.xml                | 8 ++++++++
 .../archetype-resources/src/main/java/actions/HelloAction.java    | 2 +-
 .../src/test/java/actions/HelloActionTest.java                    | 2 +-
 5 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml b/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml
index 9c2d2e1..b650608 100644
--- a/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml
+++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml
@@ -67,6 +67,14 @@
         </dependency>
 
         <dependency>
+            <!-- Needed for tests to run under JDK11 (works without it in JDK8).  Why?  That is still unclear. -->
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-compress</artifactId>
+            <version>1.20</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
             <version>3.1.0</version>
diff --git a/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/LoginTest.java b/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/LoginTest.java
index 88f9445..e2f2b2e 100644
--- a/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/LoginTest.java
+++ b/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/LoginTest.java
@@ -29,7 +29,7 @@ import java.util.Map;
 public class LoginTest extends ConfigTest {
 
     public void testLoginConfig() {
-        ActionConfig config = assertClass("/example", "Login_input", "${package}.Login");
+        ActionConfig config = assertClass("/example", "Login_input", "${package}.example.Login");
         assertResult(config, ActionSupport.SUCCESS, "Menu");
         assertResult(config, ActionSupport.INPUT, "/WEB-INF/example/Login.jsp");
     }
diff --git a/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml b/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
index 4c19a1d..fb462af 100644
--- a/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
+++ b/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
@@ -61,6 +61,14 @@
         </dependency>
 
         <dependency>
+            <!-- Needed for tests to run under JDK11 (works without it in JDK8).  Why?  That is still unclear. -->
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-compress</artifactId>
+            <version>1.20</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
             <version>3.1.0</version>
diff --git a/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/java/actions/HelloAction.java b/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/java/actions/HelloAction.java
index 1241b96..ec01ff2 100644
--- a/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/java/actions/HelloAction.java
+++ b/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/java/actions/HelloAction.java
@@ -13,7 +13,7 @@ public class HelloAction extends ActionSupport {
     }
 
     /**
-     * Provide default valuie for Message property.
+     * Provide default value for Message property.
      */
     public static final String MESSAGE = "hello.message";
 
diff --git a/struts2-archetype-convention/src/main/resources/archetype-resources/src/test/java/actions/HelloActionTest.java b/struts2-archetype-convention/src/main/resources/archetype-resources/src/test/java/actions/HelloActionTest.java
index a789216..60e94d2 100644
--- a/struts2-archetype-convention/src/main/resources/archetype-resources/src/test/java/actions/HelloActionTest.java
+++ b/struts2-archetype-convention/src/main/resources/archetype-resources/src/test/java/actions/HelloActionTest.java
@@ -7,7 +7,7 @@ import com.opensymphony.xwork2.ActionSupport;
 
 public class HelloActionTest extends StrutsTestCase {
 
-    public void testHelloAction() {
+    public void testHelloAction() throws Exception {
         HelloAction hello = new HelloAction();
         ActionContext.getContext().getContainer().inject(hello);
         String result = hello.execute();