Corrections to getRegisteredApplications and CLI implementation
Change-Id: Ia24997b9fcb5d658592f11f710c0b4e8eb40309a
diff --git a/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java b/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
index 5528f26..f8c7eed 100644
--- a/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
@@ -27,8 +27,10 @@
import org.onosproject.common.event.impl.TestEventDispatcher;
import org.onosproject.core.Application;
import org.onosproject.core.ApplicationId;
+import org.onosproject.core.CoreServiceAdapter;
import org.onosproject.core.DefaultApplication;
import org.onosproject.core.DefaultApplicationId;
+import org.onosproject.core.Version;
import java.io.InputStream;
import java.net.URI;
@@ -49,10 +51,13 @@
public class ApplicationManagerTest {
public static final DefaultApplicationId APP_ID = new DefaultApplicationId(1, APP_NAME);
+ private static final Version CORE_VERSION = Version.version(2, 1, "0", "");
private ApplicationManager mgr = new ApplicationManager();
private ApplicationListener listener = new TestListener();
+
+
private boolean deactivated = false;
@Before
@@ -81,6 +86,22 @@
}
@Test
+ public void testGetRegisteredApps() {
+ mgr.coreService = new TestCoreService();
+ Set<Application> apps = mgr.getRegisteredApplications();
+ System.out.println(apps);
+ assertFalse("SET contains less Apps than it should", apps.size() < 158);
+ }
+
+ private static class TestCoreService extends CoreServiceAdapter {
+
+ @Override
+ public Version version() {
+ return CORE_VERSION;
+ }
+ }
+
+ @Test
public void install() {
InputStream stream = ApplicationArchive.class.getResourceAsStream("app.zip");
Application app = mgr.install(stream);
@@ -223,4 +244,4 @@
}
}
-}
+}
\ No newline at end of file