struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [1/2] struts git commit: Fixes failing tests under JDK8
Date Tue, 06 Oct 2015 13:36:42 GMT
Repository: struts
Updated Branches:
  refs/heads/master e28e7f69b -> a5812bf0b


Fixes failing tests under JDK8


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

Branch: refs/heads/master
Commit: f0797388bc220b48c720e0fb29d42d4f58243757
Parents: e28e7f6
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Tue Oct 6 15:27:04 2015 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Tue Oct 6 15:27:04 2015 +0200

----------------------------------------------------------------------
 .../freemarker/FreemarkerResultMockedTest.java  | 14 +++++-----
 .../apache/struts2/views/jsp/URLTagTest.java    | 28 ++++++++++----------
 .../apache/struts2/views/jsp/ui/RadioTest.java  |  2 +-
 .../org/apache/struts2/views/jsp/ui/Radio-2.txt |  4 +--
 4 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/f0797388/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java
b/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java
index 3c19077..9794637 100644
--- a/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java
+++ b/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java
@@ -101,22 +101,22 @@ public class FreemarkerResultMockedTest extends StrutsInternalTestCase
{
         dispatcher.serviceAction(request, response, mapping);
 
         // TODO lukaszlenart: remove expectedJDK15 and if() after switching to Java 1.6
-        String expectedJDK15 =
+        String expectedJDK17 =
                 "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" foo=\"bar\"
placeholder=\"input\"/>"
                         + "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" foo=\"bar\"
placeholder=\"input\"/>"
                         + "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" break=\"true\"/>";
-        String expectedJDK16 =
-                "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" placeholder=\"input\"
foo=\"bar\"/>"
-                        + "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" placeholder=\"input\"
foo=\"bar\"/>"
+        String expectedJDK18 =
+                "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" foo=\"bar\"
placeholder=\"input\"/>"
+                        + "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" foo=\"bar\"
placeholder=\"input\"/>"
                         + "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" break=\"true\"/>"
                         + "<input type=\"text\" name=\"required\" value=\"\" id=\"required\"
required=\"true\"/>";
 
         String result = stringWriter.toString();
 
-        if (result.contains("foo=\"bar\" placeholder=\"input\"")) {
-            assertEquals(expectedJDK15, result);
+        if (result.contains("id=\"required\"")) {
+            assertEquals(expectedJDK18, result);
         } else {
-            assertEquals(expectedJDK16, result);
+            assertEquals(expectedJDK17, result);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/struts/blob/f0797388/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java
index 3196d9c..e51637b 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java
@@ -42,6 +42,7 @@ import java.io.File;
 import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -638,11 +639,11 @@ public class URLTagTest extends AbstractUITagTest {
 	}
 
 	public void testAccessToStackInternalsGetsHandledCorrectly() throws Exception {
-		Map<String, Object> params = new HashMap<String, Object>();
+		Map<String, Object> params = new LinkedHashMap<>();
 		params.put("aaa", new String[] {"1${#session[\"foo\"]='true'}"});
-		params.put("aab", new String[] {"1${#session[\"bar\"]}"});
-		params.put("aac", new String[] {"1${#_memberAccess[\"allowStaticMethodAccess\"]='true'}"});
-		params.put("aad", new String[] {"1${#_memberAccess[\"allowStaticMethodAccess\"]}"});
+		params.put("aab", new String[]{"1${#session[\"bar\"]}"});
+		params.put("aac", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]='true'}"});
+		params.put("aad", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]}"});
 
 		request.setParameterMap(params);
 		request.setRequestURI("/public/about");
@@ -661,16 +662,15 @@ public class URLTagTest extends AbstractUITagTest {
 
 		assertNull(session.get("foo"));
 
-		assertEquals("/team.action?" +
-							 "aab=1%24%7B%23session%5B%22bar%22%5D%7D" +
-							 "&amp;" +
-							 "aac=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3D%27true%27%7D"
+
-							 "&amp;" +
-							 "aaa=1%24%7B%23session%5B%22foo%22%5D%3D%27true%27%7D" +
-							 "&amp;" +
-							 "aad=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%7D" +
-							 "&amp;"+
-						     "aae%24%7B%23session%5B%22bar%22%5D%7D=1%24%7B%23session%5B%22bar%22%5D%7D"
+		assertEquals("/team.action?aaa=1%24%7B%23session%5B%22foo%22%5D%3D%27true%27%7D" +
+                        "&amp;" +
+                        "aab=1%24%7B%23session%5B%22bar%22%5D%7D" +
+                        "&amp;" +
+                        "aac=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3D%27true%27%7D"
+
+                        "&amp;" +
+                        "aad=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%7D"
+
+                        "&amp;" +
+                        "aae%24%7B%23session%5B%22bar%22%5D%7D=1%24%7B%23session%5B%22bar%22%5D%7D"
 				, writer.toString()
 		);
 	}

http://git-wip-us.apache.org/repos/asf/struts/blob/f0797388/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
index d3a9488..1c51417 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
@@ -59,7 +59,7 @@ public class RadioTest extends AbstractUITagTest {
         TestAction testAction = (TestAction) action;
         testAction.setFoo("bar");
 
-        HashMap map = new HashMap();
+        Map<String, String> map = new LinkedHashMap<>();
         map.put("1", "One");
         map.put("2", "Two");
         testAction.setMap(map);

http://git-wip-us.apache.org/repos/asf/struts/blob/f0797388/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-2.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-2.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-2.txt
index aa82dff..f5b694a 100644
--- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-2.txt
+++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-2.txt
@@ -1,7 +1,7 @@
 <tr>
     <td class="tdLabel"><label for="myname" class="label">mylabel:</label></td>
     <td>
-<input type="radio" name="myname" id="myname2" value="2"/><label for="myname2">Two</label>
-<input type="radio" name="myname" id="myname1" checked="checked" value="1"/><label
for="myname1">One</label>
+        <input type="radio" name="myname" id="myname1" checked="checked" value="1"/><label
for="myname1">One</label>
+        <input type="radio" name="myname" id="myname2" value="2"/><label for="myname2">Two</label>
     </td>
 </tr>


Mime
View raw message