public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkService, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(DsbenchmarkProvider.class);
- private static final InstanceIdentifier<TestExec> TEST_EXEC_IID = InstanceIdentifier.builder(TestExec.class).build();
- private static final InstanceIdentifier<TestStatus> TEST_STATUS_IID = InstanceIdentifier.builder(TestStatus.class).build();
+ private static final InstanceIdentifier<TestExec> TEST_EXEC_IID =
+ InstanceIdentifier.builder(TestExec.class).build();
+ private static final InstanceIdentifier<TestStatus> TEST_STATUS_IID =
+ InstanceIdentifier.builder(TestStatus.class).build();
private final AtomicReference<ExecStatus> execStatus = new AtomicReference<ExecStatus>( ExecStatus.Idle );
private final DsbenchmarkListenerProvider listenerProvider = new DsbenchmarkListenerProvider();
private final DOMDataBroker domDataBroker; // Async DOM Broker for use with all DOM operations
- private final DataBroker bindingDataBroker; // Async Binding-Aware Broker for use in tx chains; initialized to ping-pong
- // broker in default config (see default-config.xml and dsbenchmark-impl.yang)
+ private final DataBroker bindingDataBroker; // Async Binding-Aware Broker for use in tx chains; initialized to
+ // ping-pong broker in default config (see default-config.xml and
+ // dsbenchmark-impl.yang)
private DataBroker dataBroker; // "Legacy" OSGI Data Broker for use in simple transactions
private RpcRegistration<DsbenchmarkService> dstReg;
public Future<RpcResult<Void>> cleanupStore() {
cleanupTestStore();
LOG.info("Data Store cleaned up");
- return Futures.immediateFuture( RpcResultBuilder.<Void> success().build() );
+ return Futures.immediateFuture( RpcResultBuilder.<Void>success().build());
}
@Override
this.testsCompleted++;
- } catch ( Exception e ) {
+ } catch (Exception e) {
LOG.error( "Test error: {}", e.toString());
execStatus.set( ExecStatus.Idle );
return RpcResultBuilder.success(new StartTestOutputBuilder()
execStatus.set(ExecStatus.Idle);
// Get the number of data change events and cleanup the data change listeners
+ long numDataChanges = listenerProvider.getDataChangeCount();
long numEvents = listenerProvider.getEventCountAndDestroyListeners();
StartTestOutput output = new StartTestOutputBuilder()
.setExecTime(execTime)
.setTxOk((long)dsWriter.getTxOk())
.setNtfOk(numEvents)
+ .setDataChangeEventsOk(numDataChanges)
.setTxError((long)dsWriter.getTxError())
.build();
LOG.info("Failed to cleanup DataStore configtest data");
throw new IllegalStateException(e);
}
-
+
tx = dataBroker.newWriteOnlyTransaction();
tx.put(LogicalDatastoreType.OPERATIONAL, TEST_EXEC_IID, data);
try {