Search in sources :

Example 1 with TestExecBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExecBuilder in project controller by opendaylight.

the class DsbenchmarkProvider method cleanupTestStore.

private void cleanupTestStore() {
    TestExec data = new TestExecBuilder().setOuterList(Collections.<OuterList>emptyList()).build();
    WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction();
    tx.put(LogicalDatastoreType.CONFIGURATION, TEST_EXEC_IID, data);
    try {
        tx.submit().checkedGet();
        LOG.debug("DataStore config test data cleaned up");
    } catch (final TransactionCommitFailedException e) {
        LOG.info("Failed to cleanup DataStore configtest data");
        throw new IllegalStateException(e);
    }
    tx = simpleTxDataBroker.newWriteOnlyTransaction();
    tx.put(LogicalDatastoreType.OPERATIONAL, TEST_EXEC_IID, data);
    try {
        tx.submit().checkedGet();
        LOG.debug("DataStore operational test data cleaned up");
    } catch (final TransactionCommitFailedException e) {
        LOG.info("Failed to cleanup DataStore operational test data");
        throw new IllegalStateException(e);
    }
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException) TestExecBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExecBuilder) OuterList(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList) TestExec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec)

Aggregations

WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)1 TestExec (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec)1 TestExecBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExecBuilder)1 OuterList (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList)1