Search in sources :

Example 6 with PropertiesProviderTest

use of org.opendaylight.controller.config.persist.test.PropertiesProviderTest in project controller by opendaylight.

the class DirectoryStorageAdapterTest method instantiatePersisterFromAdapter.

private Persister instantiatePersisterFromAdapter(final File file, final Optional<String> extensions) {
    PropertiesProviderTest pp = new PropertiesProviderTest();
    pp.addProperty(XmlDirectoryStorageAdapter.DIRECTORY_STORAGE_PROP, file.getPath());
    if (extensions.isPresent()) {
        pp.addProperty(XmlDirectoryStorageAdapter.INCLUDE_EXT_PROP, extensions.get());
    }
    XmlDirectoryStorageAdapter dsa = new XmlDirectoryStorageAdapter();
    return dsa.instantiate(pp);
}
Also used : PropertiesProviderTest(org.opendaylight.controller.config.persist.test.PropertiesProviderTest)

Aggregations

PropertiesProviderTest (org.opendaylight.controller.config.persist.test.PropertiesProviderTest)6 Test (org.junit.Test)5 ConfigSnapshotHolder (org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder)5 File (java.io.File)1