diff options
Diffstat (limited to 'framework/src/onos/core/api/src/test/java/org')
4 files changed, 37 insertions, 4 deletions
diff --git a/framework/src/onos/core/api/src/test/java/org/onosproject/app/ApplicationServiceAdapter.java b/framework/src/onos/core/api/src/test/java/org/onosproject/app/ApplicationServiceAdapter.java index 479cc59a..96324a91 100644 --- a/framework/src/onos/core/api/src/test/java/org/onosproject/app/ApplicationServiceAdapter.java +++ b/framework/src/onos/core/api/src/test/java/org/onosproject/app/ApplicationServiceAdapter.java @@ -51,6 +51,10 @@ public class ApplicationServiceAdapter implements ApplicationService { } @Override + public void registerDeactivateHook(ApplicationId appId, Runnable hook) { + } + + @Override public void addListener(ApplicationListener listener) { } diff --git a/framework/src/onos/core/api/src/test/java/org/onosproject/core/CoreServiceAdapter.java b/framework/src/onos/core/api/src/test/java/org/onosproject/core/CoreServiceAdapter.java index 0f6abd68..6d45e8c5 100644 --- a/framework/src/onos/core/api/src/test/java/org/onosproject/core/CoreServiceAdapter.java +++ b/framework/src/onos/core/api/src/test/java/org/onosproject/core/CoreServiceAdapter.java @@ -43,7 +43,12 @@ public class CoreServiceAdapter implements CoreService { } @Override - public ApplicationId registerApplication(String identifier) { + public ApplicationId registerApplication(String name) { + return null; + } + + @Override + public ApplicationId registerApplication(String name, Runnable preDeactivate) { return null; } diff --git a/framework/src/onos/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java b/framework/src/onos/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java index d42e22fa..14201472 100644 --- a/framework/src/onos/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java +++ b/framework/src/onos/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java @@ -192,14 +192,17 @@ public class IntentTestsMocks { new MplsLabelResourceAllocation(MplsLabel.valueOf(10))); } + @Override public IntentId intentId() { return null; } + @Override public Collection<Link> links() { return null; } + @Override public Set<ResourceRequest> resources() { return null; } @@ -408,7 +411,7 @@ public class IntentTestsMocks { @Override public int hashCode() { - return Objects.hash(priority); + return priority; } @Override 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()); |