Search in sources :

Example 1 with ApplicationDescription

use of org.onosproject.app.ApplicationDescription in project onos by opennetworkinglab.

the class ApplicationArchiveTest method savePlainApp.

@Test
public void savePlainApp() throws IOException {
    InputStream stream = getClass().getResourceAsStream("app.xml");
    ApplicationDescription app = aar.saveApplication(stream);
    validate(app);
    stream.close();
}
Also used : InputStream(java.io.InputStream) ApplicationDescription(org.onosproject.app.ApplicationDescription) Test(org.junit.Test) DefaultApplicationDescriptionTest(org.onosproject.app.DefaultApplicationDescriptionTest)

Example 2 with ApplicationDescription

use of org.onosproject.app.ApplicationDescription in project onos by opennetworkinglab.

the class ApplicationArchiveTest method saveSelfContainedApp.

@Test
public void saveSelfContainedApp() throws IOException {
    InputStream stream = getClass().getResourceAsStream("app.scj");
    ApplicationDescription app = aar.saveApplication(stream);
    validate(app);
    stream.close();
}
Also used : InputStream(java.io.InputStream) ApplicationDescription(org.onosproject.app.ApplicationDescription) Test(org.junit.Test) DefaultApplicationDescriptionTest(org.onosproject.app.DefaultApplicationDescriptionTest)

Example 3 with ApplicationDescription

use of org.onosproject.app.ApplicationDescription in project onos by opennetworkinglab.

the class ApplicationArchiveTest method loadApp.

@Test
public void loadApp() throws IOException {
    saveZippedApp();
    ApplicationDescription app = aar.getApplicationDescription(APP_NAME);
    validate(app);
}
Also used : ApplicationDescription(org.onosproject.app.ApplicationDescription) Test(org.junit.Test) DefaultApplicationDescriptionTest(org.onosproject.app.DefaultApplicationDescriptionTest)

Example 4 with ApplicationDescription

use of org.onosproject.app.ApplicationDescription in project onos by opennetworkinglab.

the class ApplicationArchiveTest method saveZippedApp.

@Test
public void saveZippedApp() throws IOException {
    InputStream stream = getClass().getResourceAsStream("app.zip");
    ApplicationDescription app = aar.saveApplication(stream);
    validate(app);
    stream.close();
}
Also used : InputStream(java.io.InputStream) ApplicationDescription(org.onosproject.app.ApplicationDescription) Test(org.junit.Test) DefaultApplicationDescriptionTest(org.onosproject.app.DefaultApplicationDescriptionTest)

Example 5 with ApplicationDescription

use of org.onosproject.app.ApplicationDescription in project onos by opennetworkinglab.

the class SimpleApplicationStore method loadFromDisk.

private void loadFromDisk() {
    for (String name : getApplicationNames()) {
        ApplicationId appId = idStore.registerApplication(name);
        ApplicationDescription appDesc = getApplicationDescription(name);
        DefaultApplication app = DefaultApplication.builder(appDesc).withAppId(appId).build();
        apps.put(appId, app);
        states.put(appId, isActive(name) ? INSTALLED : ACTIVE);
    // load app permissions
    }
}
Also used : DefaultApplication(org.onosproject.core.DefaultApplication) ApplicationId(org.onosproject.core.ApplicationId) ApplicationDescription(org.onosproject.app.ApplicationDescription)

Aggregations

ApplicationDescription (org.onosproject.app.ApplicationDescription)11 InputStream (java.io.InputStream)5 Test (org.junit.Test)4 ApplicationException (org.onosproject.app.ApplicationException)4 DefaultApplicationDescriptionTest (org.onosproject.app.DefaultApplicationDescriptionTest)4 ApplicationId (org.onosproject.core.ApplicationId)4 DefaultApplication (org.onosproject.core.DefaultApplication)4 ByteArrayInputStream (java.io.ByteArrayInputStream)2 IOException (java.io.IOException)2 ApplicationEvent (org.onosproject.app.ApplicationEvent)2 Charsets (com.google.common.base.Charsets)1 MoreObjects (com.google.common.base.MoreObjects)1 Preconditions (com.google.common.base.Preconditions)1 Throwables (com.google.common.base.Throwables)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 Multimap (com.google.common.collect.Multimap)1 Multimaps.newSetMultimap (com.google.common.collect.Multimaps.newSetMultimap)1 Multimaps.synchronizedSetMultimap (com.google.common.collect.Multimaps.synchronizedSetMultimap)1