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/28 16:12:46 UTC

struts git commit: WW-4721 Enables test

Repository: struts
Updated Branches:
  refs/heads/master 99bb67143 -> 0014f8935


WW-4721 Enables test


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

Branch: refs/heads/master
Commit: 0014f8935acde640eaeeca100be641178bcc5cc2
Parents: 99bb671
Author: Lukasz Lenart <lu...@apache.org>
Authored: Mon Nov 28 17:12:34 2016 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Mon Nov 28 17:12:34 2016 +0100

----------------------------------------------------------------------
 core/src/site/resources/tags/number.html                 |  2 +-
 .../java/org/apache/struts2/views/jsp/NumberTagTest.java | 11 +++--------
 2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/0014f893/core/src/site/resources/tags/number.html
----------------------------------------------------------------------
diff --git a/core/src/site/resources/tags/number.html b/core/src/site/resources/tags/number.html
index eabc6fa..744a72f 100644
--- a/core/src/site/resources/tags/number.html
+++ b/core/src/site/resources/tags/number.html
@@ -103,7 +103,7 @@ Please do not edit it directly.
 					<td align="left" valign="top"></td>
 					<td align="left" valign="top">false</td>
 					<td align="left" valign="top">String</td>
-					<td align="left" valign="top">The rounding mode to use - not implemented yet as this required Java 1.6</td>
+					<td align="left" valign="top">The rounding mode to use, possible values: ceiling, down, floor, half-down, half-even, half-up, unnecessary, up</td>
 				</tr>
 				<tr>
 					<td align="left" valign="top">type</td>

http://git-wip-us.apache.org/repos/asf/struts/blob/0014f893/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java
index 525e54a..f215cf2 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/NumberTagTest.java
@@ -3,6 +3,7 @@ package org.apache.struts2.views.jsp;
 import com.opensymphony.xwork2.ActionContext;
 import org.apache.struts2.TestAction;
 
+import java.math.RoundingMode;
 import java.text.NumberFormat;
 import java.util.Locale;
 
@@ -65,10 +66,7 @@ public class NumberTagTest extends AbstractTagTest {
 
         // then
         NumberFormat format = NumberFormat.getCurrencyInstance((Locale) context.get(ActionContext.LOCALE));
-        /*
-        TODO lukaszlenart: enable when switched to Java 1.6
         format.setRoundingMode(RoundingMode.CEILING);
-        */
         String expected = format.format(120.0f);
 
         assertEquals(expected, writer.toString());
@@ -84,7 +82,7 @@ public class NumberTagTest extends AbstractTagTest {
         NumberTag tag = new NumberTag();
         tag.setPageContext(pageContext);
         tag.setName("floatNumber");
-        tag.setRoundingMode("ceiling");
+        tag.setRoundingMode("down");
 
         // when
         tag.doStartTag();
@@ -92,10 +90,7 @@ public class NumberTagTest extends AbstractTagTest {
 
         // then
         NumberFormat format = NumberFormat.getInstance((Locale) context.get(ActionContext.LOCALE));
-        /*
-        TODO lukaszlenart: enable when switched to Java 1.6
-        format.setRoundingMode(RoundingMode.CEILING);
-        */
+        format.setRoundingMode(RoundingMode.DOWN);
         String expected = format.format(120.45f);
 
         assertEquals(expected, writer.toString());