use of test.mock.util.SalTableServiceMock in project openflowplugin by opendaylight.
the class TableFeaturesListenerTest method updateFlowTest.
@Test
public void updateFlowTest() {
TableKey tableKey = new TableKey((short) 2);
TableFeaturesKey tableFeaturesKey = new TableFeaturesKey(tableKey.getId());
addTable(tableKey, NODE_KEY);
TableFeatures tableFeaturesData = new TableFeaturesBuilder().setKey(tableFeaturesKey).build();
InstanceIdentifier<TableFeatures> tableFeaturesII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY).augmentation(FlowCapableNode.class).child(TableFeatures.class, tableFeaturesKey);
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableFeaturesII, tableFeaturesData);
assertCommit(writeTx.submit());
tableFeaturesData = new TableFeaturesBuilder().setKey(tableFeaturesKey).setName("dummy name").build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableFeaturesII, tableFeaturesData);
assertCommit(writeTx.submit());
SalTableServiceMock salTableServiceMock = (SalTableServiceMock) forwardingRulesManager.getSalTableService();
List<UpdateTableInput> updateTableInputs = salTableServiceMock.getUpdateTableInput();
assertEquals(1, updateTableInputs.size());
assertEquals("DOM-0", updateTableInputs.get(0).getTransactionUri().getValue());
}
Aggregations