aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/api/src/test/java/org/onosproject/ui/topo/PropertyPanelTest.java
diff options
context:
space:
mode:
authorAshlee Young <ashlee@wildernessvoice.com>2015-11-05 14:00:42 -0800
committerAshlee Young <ashlee@wildernessvoice.com>2015-11-05 14:00:42 -0800
commitb34f82bf11934fc6b938ef997d536a7ccea76c36 (patch)
tree10559ebf65962abb741883ca9d23aec241ced504 /framework/src/onos/core/api/src/test/java/org/onosproject/ui/topo/PropertyPanelTest.java
parent2cdecb8c41956d7dd8ab5d59591ebc21f3c64a9e (diff)
Updates ONOS tree to checkin id ca9cc8e28eba18da77f4fa021fb7c3a3f76e5d44
upstream. Change-Id: I49f8e41733afea8101ec50c0102213c8d18949ae Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/core/api/src/test/java/org/onosproject/ui/topo/PropertyPanelTest.java')
-rw-r--r--framework/src/onos/core/api/src/test/java/org/onosproject/ui/topo/PropertyPanelTest.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/framework/src/onos/core/api/src/test/java/org/onosproject/ui/topo/PropertyPanelTest.java b/framework/src/onos/core/api/src/test/java/org/onosproject/ui/topo/PropertyPanelTest.java
index 7e6cc227..157cdc74 100644
--- a/framework/src/onos/core/api/src/test/java/org/onosproject/ui/topo/PropertyPanelTest.java
+++ b/framework/src/onos/core/api/src/test/java/org/onosproject/ui/topo/PropertyPanelTest.java
@@ -20,17 +20,38 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.onosproject.ui.topo.PropertyPanel.Prop;
+import java.text.NumberFormat;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Locale;
import java.util.Map;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
/**
* Unit tests for {@link PropertyPanel}.
*/
public class PropertyPanelTest {
+ // Modified property panel subclass to use ENGLISH locale formatter so
+ // we know formatted numbers will use comma for the thousand separator.
+ private static final class EnglishPropertyPanel extends PropertyPanel {
+ private static final NumberFormat ENGLISH_FORMATTER =
+ NumberFormat.getInstance(Locale.ENGLISH);
+
+ public EnglishPropertyPanel(String title, String typeId) {
+ super(title, typeId);
+ }
+
+ @Override
+ protected NumberFormat formatter() {
+ return ENGLISH_FORMATTER;
+ }
+ }
+
private static final String TITLE_ORIG = "Original Title";
private static final String TYPE_ORIG = "Original type ID";
private static final String TITLE_NEW = "New Title";
@@ -76,7 +97,7 @@ public class PropertyPanelTest {
@Test
public void basic() {
- pp = new PropertyPanel(TITLE_ORIG, TYPE_ORIG);
+ pp = new EnglishPropertyPanel(TITLE_ORIG, TYPE_ORIG);
assertEquals("wrong title", TITLE_ORIG, pp.title());
assertEquals("wrong type", TYPE_ORIG, pp.typeId());
assertNull("id?", pp.id());