+ @Test
+ public void bPutSomethingIntoDataStore() throws Exception {
+ writeInitialState();
+ assertTrue(isTopInDataStore());
+ }
+
+ @Test
+ public void cEnsureDataStoreIsEmptyAgainInNewTest() throws Exception {
+ assertFalse(isTopInDataStore());
+ }
+
+ // copy/pasted from Bug1125RegressionTest.writeInitialState()
+ private void writeInitialState() throws InterruptedException, ExecutionException {
+ WriteTransaction initialTx = getDataBroker().newWriteOnlyTransaction();
+ initialTx.put(LogicalDatastoreType.OPERATIONAL, TOP_PATH, new TopBuilder().build());
+ TreeComplexUsesAugment fooAugment = new TreeComplexUsesAugmentBuilder()
+ .setContainerWithUses(new ContainerWithUsesBuilder().setLeafFromGrouping("foo").build()).build();
+ initialTx.put(LogicalDatastoreType.OPERATIONAL, path(TOP_FOO_KEY), topLevelList(TOP_FOO_KEY, fooAugment));
+ initialTx.commit().get();
+ }
+
+ private boolean isTopInDataStore() throws InterruptedException, ExecutionException {
+ try (ReadTransaction readTx = getDataBroker().newReadOnlyTransaction()) {
+ return readTx.exists(LogicalDatastoreType.OPERATIONAL, TOP_PATH).get();
+ }
+ }