Skip to content
Snippets Groups Projects
Commit 9a7a7b60 authored by Tim Molter's avatar Tim Molter
Browse files

attempt unit test fix

parent 04a6bab7
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ public class ValueFormatTest { ...@@ -50,7 +50,7 @@ public class ValueFormatTest {
String stringValue = AxisValueFormatterUtil.formatNumber(value, null, null, locale); String stringValue = AxisValueFormatterUtil.formatNumber(value, null, null, locale);
assertThat(stringValue, equalTo("1")); assertThat(stringValue, equalTo("1"));
value = new BigDecimal("1000"); value = new BigDecimal(1000L);
stringValue = AxisValueFormatterUtil.formatNumber(value, null, null, locale); stringValue = AxisValueFormatterUtil.formatNumber(value, null, null, locale);
assertThat(stringValue, equalTo("1000")); assertThat(stringValue, equalTo("1000"));
...@@ -58,7 +58,7 @@ public class ValueFormatTest { ...@@ -58,7 +58,7 @@ public class ValueFormatTest {
stringValue = AxisValueFormatterUtil.formatNumber(value, null, null, locale); stringValue = AxisValueFormatterUtil.formatNumber(value, null, null, locale);
assertThat(stringValue, equalTo("9999")); assertThat(stringValue, equalTo("9999"));
value = new BigDecimal("20000"); value = new BigDecimal(20000L);
stringValue = AxisValueFormatterUtil.formatNumber(value, null, null, locale); stringValue = AxisValueFormatterUtil.formatNumber(value, null, null, locale);
assertThat(stringValue, equalTo("2E4")); assertThat(stringValue, equalTo("2E4"));
...@@ -116,44 +116,44 @@ public class ValueFormatTest { ...@@ -116,44 +116,44 @@ public class ValueFormatTest {
public void testDateFormatting() { public void testDateFormatting() {
// ms // ms
BigDecimal value = new BigDecimal("1358108105531"); BigDecimal value = new BigDecimal(1358108105531L);
BigDecimal min = new BigDecimal("1358108105100"); BigDecimal min = new BigDecimal(1358108105100L);
BigDecimal max = new BigDecimal("1358108105900"); BigDecimal max = new BigDecimal(1358108105900L);
String stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale); String stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale);
assertThat(stringValue, equalTo("05:531")); assertThat(stringValue, equalTo("05:531"));
// sec // sec
value = new BigDecimal("1358108105000"); value = new BigDecimal(1358108105000L);
min = new BigDecimal("1358108101000"); min = new BigDecimal(1358108101000L);
max = new BigDecimal("1358108109000"); max = new BigDecimal(1358108109000L);
stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale); stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale);
assertThat(stringValue, equalTo("15:05")); assertThat(stringValue, equalTo("15:05"));
// min // min
value = new BigDecimal("1358111750000"); value = new BigDecimal(1358111750000L);
min = new BigDecimal("1358111690000"); min = new BigDecimal(1358111690000L);
max = new BigDecimal("1358111870000"); max = new BigDecimal(1358111870000L);
stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale); stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale);
assertThat(stringValue, equalTo("22:15")); assertThat(stringValue, equalTo("22:15"));
// hour // hour
value = new BigDecimal("1358111870000"); value = new BigDecimal(1358111870000L);
min = new BigDecimal("1358101070000"); min = new BigDecimal(1358101070000L);
max = new BigDecimal("1358115470000"); max = new BigDecimal(1358115470000L);
stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale); stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale);
assertThat(stringValue, equalTo("13:22")); assertThat(stringValue, equalTo("13:22"));
// day // day
value = new BigDecimal("1358112317000"); value = new BigDecimal(1358112317000L);
min = new BigDecimal("1357939517000"); min = new BigDecimal(1357939517000L);
max = new BigDecimal("1358285117000"); max = new BigDecimal(1358285117000L);
stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale); stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale);
assertThat(stringValue, equalTo("Sun")); assertThat(stringValue, equalTo("Sun"));
// week // week
value = new BigDecimal("1358112317000"); value = new BigDecimal(1358112317000L);
min = new BigDecimal("1357075517000"); min = new BigDecimal(1357075517000L);
max = new BigDecimal("1359149117000"); max = new BigDecimal(1359149117000L);
stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale); stringValue = AxisValueFormatterUtil.formatDateValue(value, min, max, null, locale);
assertThat(stringValue, equalTo("Jan-13")); assertThat(stringValue, equalTo("Jan-13"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment