mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
WW-4721 Enables test
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user