import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.api.schema.SystemMapNode;
+import org.opendaylight.yangtools.yang.data.api.schema.builder.CollectionNodeBuilder;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
@RunWith(Parameterized.class)
public class DistributedDataStoreWithSegmentedJournalIntegrationTest
@Parameters(name = "{0}")
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][] {
- { TestDistributedDataStore.class }, { TestClientBackedDataStore.class }
+ { TestClientBackedDataStore.class }
});
}
@Test
public void testManyWritesDeletes() throws Exception {
final IntegrationTestKit testKit = new IntegrationTestKit(getSystem(), datastoreContextBuilder);
- CollectionNodeBuilder<MapEntryNode, MapNode> carMapBuilder = ImmutableNodes.mapNodeBuilder(CAR_QNAME);
+ CollectionNodeBuilder<MapEntryNode, SystemMapNode> carMapBuilder = ImmutableNodes.mapNodeBuilder(CAR_QNAME);
- try (AbstractDataStore dataStore = testKit.setupAbstractDataStore(
- testParameter, "testManyWritesDeletes", "module-shards-cars-member-1.conf", true, "cars")) {
+ try (var dataStore = testKit.setupDataStore(testParameter, "testManyWritesDeletes",
+ "module-shards-cars-member-1.conf", true, "cars")) {
DOMStoreTransactionChain txChain = dataStore.createTransactionChain();
}
}
- final Optional<NormalizedNode<?, ?>> optional = txChain.newReadOnlyTransaction()
+ final Optional<NormalizedNode> optional = txChain.newReadOnlyTransaction()
.read(CarsModel.CAR_LIST_PATH).get(5, TimeUnit.SECONDS);
assertTrue("isPresent", optional.isPresent());
MapNode cars = carMapBuilder.build();
- assertEquals("cars not matching result", cars, optional.get());
+ assertEquals("cars not matching result", cars, optional.orElseThrow());
txChain.close();
}
// test restoration from journal and verify data matches
- try (AbstractDataStore dataStore = testKit.setupAbstractDataStore(
- testParameter, "testManyWritesDeletes", "module-shards-cars-member-1.conf", true, "cars")) {
+ try (var dataStore = testKit.setupDataStore(testParameter, "testManyWritesDeletes",
+ "module-shards-cars-member-1.conf", true, "cars")) {
DOMStoreTransactionChain txChain = dataStore.createTransactionChain();
MapNode cars = carMapBuilder.build();
- final Optional<NormalizedNode<?, ?>> optional = txChain.newReadOnlyTransaction()
+ final Optional<NormalizedNode> optional = txChain.newReadOnlyTransaction()
.read(CarsModel.CAR_LIST_PATH).get(5, TimeUnit.SECONDS);
- assertTrue("isPresent", optional.isPresent());
- assertEquals("restored cars do not match snapshot", cars, optional.get());
+ assertEquals("restored cars do not match snapshot", Optional.of(cars), optional);
txChain.close();
}