X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-persister-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fpersist%2Fimpl%2FPersisterAggregatorTest.java;h=bef1237f980116f84f0f0ba8dc0f58b10028850b;hb=e316a0ef36279a72767703d190f38a39d7d49395;hp=acea75a7432d37dbede7c219ed961784b1f63b86;hpb=213aae87ecaccb43f3d909e0455db43511ace381;p=controller.git diff --git a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterAggregatorTest.java b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterAggregatorTest.java index acea75a743..bef1237f98 100644 --- a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterAggregatorTest.java +++ b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterAggregatorTest.java @@ -8,6 +8,8 @@ package org.opendaylight.controller.netconf.persist.impl; +import com.google.common.collect.Lists; + import org.junit.Test; import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder; import org.opendaylight.controller.config.persist.api.Persister; @@ -21,11 +23,11 @@ import java.util.Arrays; import java.util.List; import java.util.Properties; +import static org.hamcrest.CoreMatchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.containsString; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.opendaylight.controller.netconf.persist.impl.PersisterAggregator.PersisterWithConfiguration; @@ -87,6 +89,22 @@ public class PersisterAggregatorTest { assertEquals(1, DummyAdapter.props); } + @Test + public void testNoopAdapter() throws Exception { + final NoOpStorageAdapter noOpStorageAdapter = new NoOpStorageAdapter(); + final PersisterAggregator persisterAggregator = + new PersisterAggregator(Lists.newArrayList(new PersisterWithConfiguration(noOpStorageAdapter, false))); + + noOpStorageAdapter.instantiate(null); + + persisterAggregator.persistConfig(null); + persisterAggregator.loadLastConfigs(); + persisterAggregator.persistConfig(null); + persisterAggregator.loadLastConfigs(); + + noOpStorageAdapter.close(); + } + @Test public void testLoadFromPropertyFile() throws Exception { PersisterAggregator persisterAggregator = PersisterAggregator.createFromProperties(loadFile("test2.properties"));