ONOS-6668 Fix Decimal format for some localizations
Change-Id: I4926c1127415c3489c33d27535888bed149312a6
diff --git a/core/api/src/test/java/org/onosproject/ui/table/cell/NumberFormatterTest.java b/core/api/src/test/java/org/onosproject/ui/table/cell/NumberFormatterTest.java
index 68ac2ad..f65f7e1 100644
--- a/core/api/src/test/java/org/onosproject/ui/table/cell/NumberFormatterTest.java
+++ b/core/api/src/test/java/org/onosproject/ui/table/cell/NumberFormatterTest.java
@@ -16,9 +16,13 @@
package org.onosproject.ui.table.cell;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.onosproject.ui.table.CellFormatter;
+import java.util.Locale;
+
import static org.junit.Assert.assertEquals;
/**
@@ -30,6 +34,19 @@
private CellFormatter f5dp = NumberFormatter.TO_5DP;
private CellFormatter fInt = NumberFormatter.INTEGER;
+ private static Locale systemLocale;
+
+ @BeforeClass
+ public static void classSetup() {
+ systemLocale = Locale.getDefault();
+ Locale.setDefault(Locale.US);
+ }
+
+ @AfterClass
+ public static void classTeardown() {
+ Locale.setDefault(systemLocale);
+ }
+
@Test
public void defaultNullValue() {
assertEquals("default null value", "", f5dp.format(null));
diff --git a/core/api/src/test/java/org/onosproject/ui/topo/TopoUtilsTest.java b/core/api/src/test/java/org/onosproject/ui/topo/TopoUtilsTest.java
index e8712dc..fa04be7 100644
--- a/core/api/src/test/java/org/onosproject/ui/topo/TopoUtilsTest.java
+++ b/core/api/src/test/java/org/onosproject/ui/topo/TopoUtilsTest.java
@@ -16,6 +16,8 @@
package org.onosproject.ui.topo;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DefaultLink;
@@ -24,6 +26,8 @@
import org.onosproject.net.provider.ProviderId;
import org.onosproject.ui.AbstractUiTest;
+import java.util.Locale;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -41,6 +45,19 @@
private static final ConnectPoint CP_FU = deviceConnectPoint("fu:001/3");
private static final ConnectPoint CP_BAH = deviceConnectPoint("bah:002/5");
+ private static Locale systemLocale;
+
+ @BeforeClass
+ public static void classSetup() {
+ systemLocale = Locale.getDefault();
+ Locale.setDefault(Locale.US);
+ }
+
+ @AfterClass
+ public static void classTeardown() {
+ Locale.setDefault(systemLocale);
+ }
+
private static final Link LINK_FU_BAH = DefaultLink.builder()
.src(CP_FU)
.dst(CP_BAH)