use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class SimpleApplicationStoreTest method permissions.
@Test
public void permissions() {
Application app = createTestApp();
ImmutableSet<Permission> permissions = ImmutableSet.of(new Permission(AppPermission.class.getName(), "FLOWRULE_WRITE"));
store.setPermissions(app.id(), permissions);
assertEquals("incorrect app perms", 1, store.getPermissions(app.id()).size());
assertEquals("incorrect app state", INSTALLED, store.getState(app.id()));
assertEquals("incorrect event type", APP_PERMISSIONS_CHANGED, delegate.event.type());
assertEquals("incorrect event app", app, delegate.event.subject());
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class SimpleApplicationStoreTest method remove.
@Test
public void remove() {
Application app = createTestApp();
store.remove(app.id());
assertEquals("incorrect app count", 0, store.getApplications().size());
assertEquals("incorrect event type", APP_UNINSTALLED, delegate.event.type());
assertEquals("incorrect event app", app, delegate.event.subject());
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class SimpleApplicationStoreTest method activate.
@Test
public void activate() {
Application app = createTestApp();
store.activate(app.id());
assertEquals("incorrect app count", 1, store.getApplications().size());
assertEquals("incorrect app state", ACTIVE, store.getState(app.id()));
assertEquals("incorrect event type", APP_ACTIVATED, delegate.event.type());
assertEquals("incorrect event app", app, delegate.event.subject());
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class SimpleApplicationStoreTest method create.
@Test
public void create() {
Application app = createTestApp();
assertEquals("incorrect name", "org.foo.app", app.id().name());
assertEquals("incorrect app count", 1, store.getApplications().size());
assertEquals("incorrect app", app, store.getApplication(app.id()));
assertEquals("incorrect app state", INSTALLED, store.getState(app.id()));
assertEquals("incorrect event type", APP_INSTALLED, delegate.event.type());
assertEquals("incorrect event app", app, delegate.event.subject());
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class SimpleApplicationStore method activate.
@Override
public void activate(ApplicationId appId) {
Application app = apps.get(appId);
if (app != null) {
setActive(appId.name());
states.put(appId, ACTIVE);
delegate.notify(new ApplicationEvent(APP_ACTIVATED, app));
}
}
Aggregations