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 2016/11/21 06:57:26 UTC

struts-archetypes git commit: WW-4716 Uses proper way to create actions

Repository: struts-archetypes
Updated Branches:
  refs/heads/master e9bb8c1ea -> a691a13b7


WW-4716 Uses proper way to create actions


Project: http://git-wip-us.apache.org/repos/asf/struts-archetypes/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-archetypes/commit/a691a13b
Tree: http://git-wip-us.apache.org/repos/asf/struts-archetypes/tree/a691a13b
Diff: http://git-wip-us.apache.org/repos/asf/struts-archetypes/diff/a691a13b

Branch: refs/heads/master
Commit: a691a13b7be4f87a6fe8babdd587e88894a7ad60
Parents: e9bb8c1
Author: Lukasz Lenart <lu...@gmail.com>
Authored: Mon Nov 21 07:57:11 2016 +0100
Committer: Lukasz Lenart <lu...@gmail.com>
Committed: Mon Nov 21 07:57:11 2016 +0100

----------------------------------------------------------------------
 .../src/test/java/example/HelloWorldTest.java                    | 2 +-
 .../archetype-resources/src/test/java/example/LoginTest.java     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/a691a13b/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/HelloWorldTest.java
----------------------------------------------------------------------
diff --git a/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/HelloWorldTest.java b/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/HelloWorldTest.java
index ace3a32..28c0a4d 100644
--- a/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/HelloWorldTest.java
+++ b/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/HelloWorldTest.java
@@ -27,7 +27,7 @@ import org.apache.struts2.StrutsTestCase;
 public class HelloWorldTest extends StrutsTestCase {
 
     public void testHelloWorld() throws Exception {
-        HelloWorld hello_world = new HelloWorld();
+        HelloWorld hello_world = container.inject(HelloWorld.class);
         String result = hello_world.execute();
         assertTrue("Expected a success result!",
                 ActionSupport.SUCCESS.equals(result));

http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/a691a13b/struts2-archetype-blank/src/main/resources/archetype-resources/src/test/java/example/LoginTest.java
----------------------------------------------------------------------
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 9b6371c..d12faad 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
@@ -35,7 +35,7 @@ public class LoginTest extends ConfigTest {
     }
 
     public void testLoginSubmit() throws Exception {
-        Login login = new Login();
+        Login login = container.inject(Login.class);
         login.setUsername("username");
         login.setPassword("password");
         String result = login.execute();
@@ -44,7 +44,7 @@ public class LoginTest extends ConfigTest {
 
     // Needs access to an envinronment that includes validators
     public void FIXME_testLoginSubmitInput() throws Exception {
-        Login login = new Login();
+        Login login = container.inject(Login.class);
         String result = login.execute();
         assertInput(result);
         Map errors = assertFieldErrors(login);