Search in sources :

Example 16 with ConfigSnapshotHolder

use of org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder in project controller by opendaylight.

the class DirectoryStorageAdapterTest method testTwoFilesOnlyOneExtension.

@Test
public void testTwoFilesOnlyOneExtension() throws Exception {
    File folder = getFolder("twoFiles");
    tested = instantiatePersisterFromAdapter(folder, Optional.of("xml"));
    LOG.info("Testing : ", tested);
    List<ConfigSnapshotHolder> results = tested.loadLastConfigs();
    assertEquals(1, results.size());
    assertResult(results.get(0), "<config>1</config>", "cap1-a", "cap2-a", "capa a-a");
}
Also used : ConfigSnapshotHolder(org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder) File(java.io.File) Test(org.junit.Test) PropertiesProviderTest(org.opendaylight.controller.config.persist.test.PropertiesProviderTest)

Example 17 with ConfigSnapshotHolder

use of org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder in project controller by opendaylight.

the class DirectoryStorageAdapterTest method testTwoFilesOneInvalid.

@Test
public void testTwoFilesOneInvalid() throws Exception {
    File folder = getFolder("twoFiles_corrupt");
    tested = instantiatePersisterFromAdapter(folder, Optional.of("xml"));
    LOG.info("Testing : {}", tested);
    List<ConfigSnapshotHolder> results = tested.loadLastConfigs();
    assertEquals(1, results.size());
    assertResult(results.get(0), "<config>1</config>", "cap1-a", "cap2-a", "capa a-a");
}
Also used : ConfigSnapshotHolder(org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder) File(java.io.File) Test(org.junit.Test) PropertiesProviderTest(org.opendaylight.controller.config.persist.test.PropertiesProviderTest)

Aggregations

ConfigSnapshotHolder (org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder)17 Test (org.junit.Test)13 PropertiesProviderTest (org.opendaylight.controller.config.persist.test.PropertiesProviderTest)12 File (java.io.File)8 ArrayList (java.util.ArrayList)2 IOException (java.io.IOException)1 LinkedHashMap (java.util.LinkedHashMap)1 SortedSet (java.util.SortedSet)1 ConflictingVersionException (org.opendaylight.controller.config.api.ConflictingVersionException)1 ModuleFactoryNotFoundException (org.opendaylight.controller.config.api.ModuleFactoryNotFoundException)1 ValidationException (org.opendaylight.controller.config.api.ValidationException)1 ConfigSubsystemFacadeFactory (org.opendaylight.controller.config.facade.xml.ConfigSubsystemFacadeFactory)1 PersisterAggregator (org.opendaylight.controller.config.persist.impl.PersisterAggregator)1 PersisterWithConfiguration (org.opendaylight.controller.config.persist.impl.PersisterAggregator.PersisterWithConfiguration)1 DocumentedException (org.opendaylight.controller.config.util.xml.DocumentedException)1 ServiceReference (org.osgi.framework.ServiceReference)1 ServiceTracker (org.osgi.util.tracker.ServiceTracker)1 ServiceTrackerCustomizer (org.osgi.util.tracker.ServiceTrackerCustomizer)1 SAXException (org.xml.sax.SAXException)1