This removes generic types and casts which aren’t necessary.
JIRA: OPNFLWPLUG-1044
Change-Id: I267045bb85b7c1c657fe9f9a2ac869d9914f3eb0
Signed-off-by: Stephen Kitt <skitt@redhat.com>
MoreExecutors.directExecutor());
return Futures.transform(
rpcResult,
- this.<ControlBundleOutput>createRpcResultCondenser("committed active bundle"),
+ this.createRpcResultCondenser("committed active bundle"),
MoreExecutors.directExecutor());
}
}
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
- }).when(mockFlowPusher).execute(ArgumentMatchers.<Runnable>any());
+ }).when(mockFlowPusher).execute(ArgumentMatchers.any());
flowWriterConcurrent = new FlowWriterConcurrent(mockDataBroker, mockFlowPusher);
}
@Test
public void testAddFlows() throws Exception {
flowWriterConcurrent.addFlows(1, FLOWS_PER_DPN, 10, 10, 10, (short) 0, (short) 1, true);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.<LogicalDatastoreType>any(),
- ArgumentMatchers.<InstanceIdentifier<DataObject>>any(), ArgumentMatchers.<DataObject>any(),
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
ArgumentMatchers.anyBoolean());
}
public void testDeleteFlows() throws Exception {
flowWriterConcurrent.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
- .delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ .delete(ArgumentMatchers.any(),
ArgumentMatchers.<InstanceIdentifier<DataObject>>any());
}
}
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
Mockito.doAnswer(invocation -> {
((Runnable)invocation.getArguments()[0]).run();
return null;
- }).when(mockFlowPusher).execute(ArgumentMatchers.<Runnable>any());
+ }).when(mockFlowPusher).execute(ArgumentMatchers.any());
flowWriterDirectOFRpc = new FlowWriterDirectOFRpc(mockDataBroker, mockSalFlowService, mockFlowPusher);
}
@Test
public void testRpcFlowAdd() throws Exception {
flowWriterDirectOFRpc.rpcFlowAdd("1", FLOWS_PER_DPN, 10);
- Mockito.verify(mockSalFlowService, Mockito.times(FLOWS_PER_DPN)).addFlow(Mockito.<AddFlowInput>any());
+ Mockito.verify(mockSalFlowService, Mockito.times(FLOWS_PER_DPN)).addFlow(Mockito.any());
}
@Test
public void testRpcFlowAddAll() throws Exception {
flowWriterDirectOFRpc.rpcFlowAddAll(FLOWS_PER_DPN, 10);
- Mockito.verify(mockSalFlowService, Mockito.times(FLOWS_PER_DPN)).addFlow(Mockito.<AddFlowInput>any());
+ Mockito.verify(mockSalFlowService, Mockito.times(FLOWS_PER_DPN)).addFlow(Mockito.any());
}
}
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
- }).when(mockFlowPusher).execute(ArgumentMatchers.<Runnable>any());
+ }).when(mockFlowPusher).execute(ArgumentMatchers.any());
flowWriterSequential = new FlowWriterSequential(mockDataBroker, mockFlowPusher);
}
@Test
public void testAddFlows() throws Exception {
flowWriterSequential.addFlows(1, FLOWS_PER_DPN, 10, 10, (short) 0, (short) 1, true);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.<LogicalDatastoreType>any(),
- ArgumentMatchers.<InstanceIdentifier<DataObject>>any(), ArgumentMatchers.<DataObject>any(),
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
ArgumentMatchers.anyBoolean());
}
public void testDeleteFlows() throws Exception {
flowWriterSequential.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
- .delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ .delete(ArgumentMatchers.any(),
ArgumentMatchers.<InstanceIdentifier<DataObject>>any());
}
}
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.TransactionChain;
-import org.opendaylight.mdsal.binding.api.TransactionChainListener;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
- }).when(mockFlowPusher).execute(ArgumentMatchers.<Runnable>any());
+ }).when(mockFlowPusher).execute(ArgumentMatchers.any());
final TransactionChain mockedTxChain = mock(TransactionChain.class);
when(mockedTxChain.newWriteOnlyTransaction()).thenReturn(writeTransaction);
doReturn(mockedTxChain).when(mockDataBroker)
- .createTransactionChain(ArgumentMatchers.<TransactionChainListener>any());
+ .createTransactionChain(ArgumentMatchers.any());
doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit();
@Test
public void testAddFlows() throws Exception {
flowWriterTxChain.addFlows(1, FLOWS_PER_DPN, 10, 10, 10, (short) 0, (short) 1, true);
- Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.<LogicalDatastoreType>any(),
- ArgumentMatchers.<InstanceIdentifier<DataObject>>any(), ArgumentMatchers.<DataObject>any(),
+ Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
ArgumentMatchers.anyBoolean());
}
public void testDeleteFlows() throws Exception {
flowWriterTxChain.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
- .delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ .delete(ArgumentMatchers.any(),
ArgumentMatchers.<InstanceIdentifier<DataObject>>any());
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.bulk.flow.list.grouping.BulkFlowItemBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
salBulkFlowService.addFlowsDs(addFlowsDsInput);
verify(writeTransaction).commit();
- verify(writeTransaction).put(ArgumentMatchers.<LogicalDatastoreType>any(),
- ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ verify(writeTransaction).put(ArgumentMatchers.any(), ArgumentMatchers.any(),
flowArgumentCaptor.capture(), Mockito.anyBoolean());
Flow flow = flowArgumentCaptor.getValue();
final RemoveFlowsDsInput removeFlowsDsInput = removeFlowsDsInputBuilder.build();
salBulkFlowService.removeFlowsDs(removeFlowsDsInput);
- verify(writeTransaction).delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ verify(writeTransaction).delete(ArgumentMatchers.any(),
ArgumentMatchers.<InstanceIdentifier<Flow>>any());
verify(writeTransaction, times(2)).commit();
}
@Test
public void testAddRemoveFlowsRpc() throws Exception {
- Mockito.when(mockSalFlowService.addFlow(ArgumentMatchers.<AddFlowInput>any()))
+ Mockito.when(mockSalFlowService.addFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
- Mockito.when(mockSalFlowService.removeFlow(ArgumentMatchers.<RemoveFlowInput>any()))
+ Mockito.when(mockSalFlowService.removeFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new RemoveFlowOutputBuilder().build()).buildFuture());
final BulkFlowItemBuilder bulkFlowItemBuilder = new BulkFlowItemBuilder();
final AddFlowsRpcInput addFlowsRpcInput = addFlowsRpcInputBuilder.build();
salBulkFlowService.addFlowsRpc(addFlowsRpcInput);
- verify(mockSalFlowService).addFlow(ArgumentMatchers.<AddFlowInput>any());
+ verify(mockSalFlowService).addFlow(ArgumentMatchers.any());
final RemoveFlowsRpcInputBuilder removeFlowsRpcInputBuilder = new RemoveFlowsRpcInputBuilder();
removeFlowsRpcInputBuilder.setBulkFlowItem(bulkFlowItems);
final RemoveFlowsRpcInput removeFlowsRpcInput = removeFlowsRpcInputBuilder.build();
salBulkFlowService.removeFlowsRpc(removeFlowsRpcInput);
- verify(mockSalFlowService).removeFlow(ArgumentMatchers.<RemoveFlowInput>any());
+ verify(mockSalFlowService).removeFlow(ArgumentMatchers.any());
}
@Test
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
- }).when(mockTablePusher).execute(ArgumentMatchers.<Runnable>any());
+ }).when(mockTablePusher).execute(ArgumentMatchers.any());
tableWriter = new TableWriter(mockDataBroker, mockTablePusher);
}
public void testAddTables() throws Exception {
tableWriter.addTables(DPN_COUNT, START_TABLE_ID, END_TABLE_ID);
Mockito.verify(writeTransaction, Mockito.times(TABLES_PER_DPN))
- .put(ArgumentMatchers.<LogicalDatastoreType>any(),
- ArgumentMatchers.<InstanceIdentifier<DataObject>>any(), ArgumentMatchers.<DataObject>any(),
+ .put(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
ArgumentMatchers.anyBoolean());
}
public void testDeleteTables() throws Exception {
tableWriter.deleteTables(DPN_COUNT, START_TABLE_ID, END_TABLE_ID);
Mockito.verify(writeTransaction, Mockito.times(TABLES_PER_DPN))
- .delete(ArgumentMatchers.<LogicalDatastoreType>any(),
+ .delete(ArgumentMatchers.any(),
ArgumentMatchers.<InstanceIdentifier<DataObject>>any());
}
}
.build();
private final Multimap<BigInteger, String> dpnToPortMultiMap = Multimaps
- .synchronizedListMultimap(ArrayListMultimap.<BigInteger, String>create());
+ .synchronizedListMultimap(ArrayListMultimap.create());
@SuppressWarnings("IllegalCatch")
public FlowNodeConnectorInventoryTranslatorImpl(final DataBroker dataBroker) {
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
deviceMastershipManager = new DeviceMastershipManager(clusterSingletonService, reconciliationAgent, dataBroker,
mastershipChangeServiceManager, rpcProviderService, reconciliationService);
Mockito.lenient().when(clusterSingletonService
- .registerClusterSingletonService(ArgumentMatchers.<ClusterSingletonService>any()))
+ .registerClusterSingletonService(ArgumentMatchers.any()))
.thenReturn(registration);
Mockito.when(deviceInfo.getNodeId()).thenReturn(nodeId);
Mockito.when(nodeId.getValue()).thenReturn("dummyValue");
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
- Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.emptyList()).build();
Flow flow = new FlowBuilder().withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
- Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.emptyList()).build();
Flow flow = new FlowBuilder().withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
- Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.emptyList()).build();
IpMatch ipMatch = new IpMatchBuilder().setIpDscp(new Dscp((short) 4)).build();
Match match = new MatchBuilder().setIpMatch(ipMatch).build();
Flow flow = new FlowBuilder().setMatch(match).withKey(flowKey).setTableId((short) 2).build();
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
- Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.emptyList()).build();
Flow flow = new FlowBuilder().withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<StaleFlow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(StaleFlow.class, flowKey);
- Table table = new TableBuilder().withKey(tableKey).setStaleFlow(Collections.<StaleFlow>emptyList()).build();
+ Table table = new TableBuilder().withKey(tableKey).setStaleFlow(Collections.emptyList()).build();
StaleFlow flow = new StaleFlowBuilder().withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
public abstract class FRMTest extends AbstractDataBrokerTest {
public void addFlowCapableNode(NodeKey nodeKey) {
- Nodes nodes = new NodesBuilder().setNode(Collections.<Node>emptyList()).build();
+ Nodes nodes = new NodesBuilder().setNode(Collections.emptyList()).build();
FlowCapableNodeBuilder fcnBuilder = new FlowCapableNodeBuilder();
NodeBuilder nodeBuilder = new NodeBuilder();
public void addTable(final TableKey tableKey, final NodeKey nodeKey) {
addFlowCapableNode(nodeKey);
- final Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ final Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.emptyList()).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
}
return Futures.transform(JdkFutureAdapters.listenInPoolThread(rpcResultFuture),
- ReconcileUtil.<ProcessFlatBatchOutput>createRpcResultToVoidFunction("flat-batch"),
+ ReconcileUtil.createRpcResultToVoidFunction("flat-batch"),
MoreExecutors.directExecutor());
}, MoreExecutors.directExecutor());
return resultVehicle;
final ListenableFuture<RpcResult<Void>> singleVoidAddResult = Futures.transform(
Futures.allAsList(allResults),
- ReconcileUtil.<AddFlowOutput>createRpcResultCondenser("flow adding"),
+ ReconcileUtil.createRpcResultCondenser("flow adding"),
MoreExecutors.directExecutor());
final ListenableFuture<RpcResult<Void>> singleVoidUpdateResult = Futures.transform(
Futures.allAsList(allUpdateResults),
- ReconcileUtil.<UpdateFlowOutput>createRpcResultCondenser("flow updating"),
+ ReconcileUtil.createRpcResultCondenser("flow updating"),
MoreExecutors.directExecutor());
return Futures.transform(Futures.allAsList(singleVoidAddResult, singleVoidUpdateResult),
- ReconcileUtil.<Void>createRpcResultCondenser("flow add/update"),
+ ReconcileUtil.createRpcResultCondenser("flow add/update"),
MoreExecutors.directExecutor());
}
final ListenableFuture<RpcResult<Void>> singleVoidResult = Futures.transform(
Futures.allAsList(allResults),
- ReconcileUtil.<RemoveFlowOutput>createRpcResultCondenser("flow remove"),
+ ReconcileUtil.createRpcResultCondenser("flow remove"),
MoreExecutors.directExecutor());
return Futures.transformAsync(singleVoidResult,
}
return Futures.transform(Futures.allAsList(allResults),
- ReconcileUtil.<RemoveMeterOutput>createRpcResultCondenser("meter remove"),
+ ReconcileUtil.createRpcResultCondenser("meter remove"),
MoreExecutors.directExecutor());
}
final ListenableFuture<RpcResult<Void>> singleVoidResult = Futures.transform(
Futures.allAsList(allResults),
- ReconcileUtil.<RemoveGroupOutput>createRpcResultCondenser("group remove"),
+ ReconcileUtil.createRpcResultCondenser("group remove"),
MoreExecutors.directExecutor());
return Futures.transformAsync(singleVoidResult,
final ListenableFuture<RpcResult<Void>> singleVoidResult = Futures.transform(
Futures.allAsList(allResults),
- ReconcileUtil.<UpdateTableOutput>createRpcResultCondenser("table update"),
+ ReconcileUtil.createRpcResultCondenser("table update"),
MoreExecutors.directExecutor());
return Futures.transformAsync(singleVoidResult,
final ListenableFuture<RpcResult<Void>> singleVoidAddResult = Futures.transform(
Futures.allAsList(allResults),
- ReconcileUtil.<AddGroupOutput>createRpcResultCondenser("group add"),
+ ReconcileUtil.createRpcResultCondenser("group add"),
MoreExecutors.directExecutor());
final ListenableFuture<RpcResult<Void>> singleVoidUpdateResult = Futures.transform(
Futures.allAsList(allUpdateResults),
- ReconcileUtil.<UpdateGroupOutput>createRpcResultCondenser("group update"),
+ ReconcileUtil.createRpcResultCondenser("group update"),
MoreExecutors.directExecutor());
final ListenableFuture<RpcResult<Void>> summaryResult = Futures.transform(
Futures.allAsList(singleVoidAddResult, singleVoidUpdateResult),
- ReconcileUtil.<Void>createRpcResultCondenser("group add/update"),
+ ReconcileUtil.createRpcResultCondenser("group add/update"),
MoreExecutors.directExecutor());
final ListenableFuture<RpcResult<Void>> singleVoidAddResult = Futures.transform(
Futures.allAsList(allResults),
- ReconcileUtil.<AddMeterOutput>createRpcResultCondenser("meter add"),
+ ReconcileUtil.createRpcResultCondenser("meter add"),
MoreExecutors.directExecutor());
final ListenableFuture<RpcResult<Void>> singleVoidUpdateResult = Futures.transform(
Futures.allAsList(allUpdateResults),
- ReconcileUtil.<UpdateMeterOutput>createRpcResultCondenser("meter update"),
+ ReconcileUtil.createRpcResultCondenser("meter update"),
MoreExecutors.directExecutor());
return Futures.transform(Futures.allAsList(singleVoidUpdateResult, singleVoidAddResult),
- ReconcileUtil.<Void>createRpcResultCondenser("meter add/update"),
+ ReconcileUtil.createRpcResultCondenser("meter add/update"),
MoreExecutors.directExecutor());
}
-/**
+/*
* Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
LOG.debug("{} finished successfully: {}", prefix, nodeId.getValue());
} else {
final Collection<RpcError> errors = MoreObjects.firstNonNull(result.getErrors(),
- ImmutableList.<RpcError>of());
+ ImmutableList.of());
LOG.debug("{} failed: {} -> {}", prefix, nodeId.getValue(), errors);
}
} else {
return Futures.transformAsync(result, input1 -> {
if (input1.isSuccessful()) {
- return Futures.<RpcResult<Void>>immediateFuture(RpcResultBuilder.<Void>success().build());
+ return Futures.immediateFuture(RpcResultBuilder.<Void>success().build());
} else {
- return Futures.<RpcResult<Void>>immediateFailedFuture(null);
+ return Futures.immediateFailedFuture(null);
}
});
};
return Collections.emptyList();
}
- return MoreObjects.firstNonNull(node.getGroup(), ImmutableList.<Group>of());
+ return MoreObjects.firstNonNull(node.getGroup(), ImmutableList.of());
}
public static List<Table> safeTables(FlowCapableNode node) {
return Collections.emptyList();
}
- return MoreObjects.firstNonNull(node.getTable(), ImmutableList.<Table>of());
+ return MoreObjects.firstNonNull(node.getTable(), ImmutableList.of());
}
public static List<Meter> safeMeters(FlowCapableNode node) {
return Collections.emptyList();
}
- return MoreObjects.firstNonNull(node.getMeter(), ImmutableList.<Meter>of());
+ return MoreObjects.firstNonNull(node.getMeter(), ImmutableList.of());
}
}
public static Group createGroup(final long groupIdValue) {
final Buckets buckets = new BucketsBuilder()
- .setBucket(Collections.<Bucket>emptyList())
+ .setBucket(Collections.emptyList())
.build();
return new GroupBuilder()
.setGroupId(new GroupId(groupIdValue))
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
-import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.SalFlatBatchService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
import org.opendaylight.yangtools.yang.binding.RpcService;
provider.init();
Mockito.verify(dataBroker, Mockito.times(2)).registerDataTreeChangeListener(
- ArgumentMatchers.<DataTreeIdentifier<FlowCapableNode>>any(),
- ArgumentMatchers.<DataTreeChangeListener<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any());
}
@After
Mockito.doReturn(FluentFutures.immediateFluentFuture(Optional.of(dataBefore))).when(roTx)
.read(LogicalDatastoreType.OPERATIONAL, fcNodePath);
final SyncupEntry syncupEntry = new SyncupEntry(after, dsTypeAfter, before, dsTypeBefore);
- Mockito.when(reactor.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(),
+ Mockito.when(reactor.syncup(ArgumentMatchers.any(),
Mockito.eq(syncupEntry))).thenReturn(Futures.immediateFuture(Boolean.TRUE));
return syncupEntry;
}
Mockito.doReturn(FluentFutures.immediateFluentFuture(Optional.of(configNode))).when(roTx)
.read(LogicalDatastoreType.CONFIGURATION, fcNodePath);
final SyncupEntry syncupEntry = new SyncupEntry(after, dsTypeAfter, before, dsTypeBefore);
- Mockito.when(reactor.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(),
+ Mockito.when(reactor.syncup(ArgumentMatchers.any(),
Mockito.eq(syncupEntry))).thenReturn(Futures.immediateFuture(Boolean.TRUE));
return syncupEntry;
}
final SyncupEntry zipped = new SyncupEntry(dataAfter2, configDS, dataBefore, configDS);
final List<ListenableFuture<Boolean>> allResults = new ArrayList<>();
- Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
+ Mockito.when(delegate.syncup(ArgumentMatchers.any(), Mockito.eq(first)))
.thenAnswer(invocationOnMock -> {
LOG.info("unlocking next configs");
latchForNext.countDown();
final SyncupEntry first = new SyncupEntry(dataBefore, configDS, null, configDS);
final SyncupEntry second = new SyncupEntry(dataAfter, configDS, dataBefore, configDS);
- Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
+ Mockito.when(delegate.syncup(ArgumentMatchers.any(), Mockito.eq(first)))
.thenAnswer(invocationOnMock -> {
LOG.info("unlocking next config");
latchForNext.countDown();
final SyncupEntry first = new SyncupEntry(configAfter, configDS, configBefore, configDS);
final SyncupEntry second = new SyncupEntry(configActual, configDS, freshOperational, operationalDS);
- Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(), Mockito.eq(first)))
+ Mockito.when(delegate.syncup(ArgumentMatchers.any(), Mockito.eq(first)))
.thenAnswer(invocationOnMock -> {
LOG.info("unlocking for fresh operational");
latchForNext.countDown();
import org.opendaylight.openflowplugin.applications.frsync.SyncPlanPushStrategy;
import org.opendaylight.openflowplugin.applications.frsync.impl.strategy.SynchronizationDiffInput;
import org.opendaylight.openflowplugin.applications.frsync.util.ReconcileUtil;
-import org.opendaylight.openflowplugin.applications.frsync.util.SyncCrudCounters;
import org.opendaylight.openflowplugin.applications.frsync.util.SyncupEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
operationalFcn, LogicalDatastoreType.OPERATIONAL);
Mockito.when(syncPlanPushStrategy.executeSyncStrategy(
- ArgumentMatchers.<ListenableFuture<RpcResult<Void>>>any(),
- ArgumentMatchers.<SynchronizationDiffInput>any(),
- ArgumentMatchers.<SyncCrudCounters>any()))
+ ArgumentMatchers.any(),
+ ArgumentMatchers.any(),
+ ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<Void>success().buildFuture());
final ListenableFuture<Boolean> syncupResult = reactor.syncup(NODE_IDENT, syncupEntry);
Assert.assertTrue(voidRpcResult);
Mockito.verify(syncPlanPushStrategy).executeSyncStrategy(
- ArgumentMatchers.<ListenableFuture<RpcResult<Void>>>any(),
+ ArgumentMatchers.any(),
syncDiffInputCaptor.capture(),
- ArgumentMatchers.<SyncCrudCounters>any());
+ ArgumentMatchers.any());
final SynchronizationDiffInput diffInput = syncDiffInputCaptor.getValue();
Assert.assertEquals(1, ReconcileUtil.countTotalPushed(diffInput.getFlowsToAddOrUpdate().values()));
@Test
public void testSyncupSuccess() {
- Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(),
- ArgumentMatchers.<SyncupEntry>any())).thenReturn(Futures.immediateFuture(Boolean.TRUE));
+ Mockito.when(delegate.syncup(ArgumentMatchers.any(),
+ ArgumentMatchers.any())).thenReturn(Futures.immediateFuture(Boolean.TRUE));
reactor.syncup(fcNodePath, syncupEntry);
@Test
public void testSyncupFail() {
- Mockito.when(delegate.syncup(ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any(),
- ArgumentMatchers.<SyncupEntry>any())).thenReturn(Futures.immediateFuture(Boolean.FALSE));
+ Mockito.when(delegate.syncup(ArgumentMatchers.any(),
+ ArgumentMatchers.any())).thenReturn(Futures.immediateFuture(Boolean.FALSE));
reactor.syncup(fcNodePath, syncupEntry);
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
import org.opendaylight.openflowplugin.applications.frsync.util.ReconciliationRegistry;
public void setUp() throws Exception {
deviceMastershipManager = new DeviceMastershipManager(clusterSingletonService, new ReconciliationRegistry());
Mockito.when(clusterSingletonService
- .registerClusterSingletonService(ArgumentMatchers.<ClusterSingletonService>any()))
+ .registerClusterSingletonService(ArgumentMatchers.any()))
.thenReturn(registration);
}
final Future<RpcResult<AddFlowOutput>> addResult = flowForwarder.add(flowPath, flow, flowCapableNodePath);
- Mockito.verify(salFlowService).addFlow(ArgumentMatchers.<AddFlowInput>any());
+ Mockito.verify(salFlowService).addFlow(ArgumentMatchers.any());
final AddFlowInput flowInput = addFlowInputCpt.getValue();
Assert.assertEquals(2, flowInput.getTableId().shortValue());
Assert.assertEquals(emptyMatch, flowInput.getMatch());
final Future<RpcResult<UpdateFlowOutput>> updateResult = flowForwarder.update(flowPath, flow,
flowUpdated, flowCapableNodePath);
- Mockito.verify(salFlowService).updateFlow(ArgumentMatchers.<UpdateFlowInput>any());
+ Mockito.verify(salFlowService).updateFlow(ArgumentMatchers.any());
final UpdateFlowInput updateFlowInput = updateFlowInputCpt.getValue();
final OriginalFlow flowOrigInput = updateFlowInput.getOriginalFlow();
final UpdatedFlow flowInput = updateFlowInput.getUpdatedFlow();
final Future<RpcResult<RemoveFlowOutput>> removeResult = flowForwarder.remove(flowPath,
removeFlow, flowCapableNodePath);
- Mockito.verify(salFlowService).removeFlow(ArgumentMatchers.<RemoveFlowInput>any());
+ Mockito.verify(salFlowService).removeFlow(ArgumentMatchers.any());
final RemoveFlowInput flowInput = removeFlowInputCpt.getValue();
Assert.assertEquals(2, flowInput.getTableId().shortValue());
Assert.assertEquals(emptyMatch, flowInput.getMatch());
final Future<RpcResult<RemoveGroupOutput>> addResult =
groupForwarder.remove(groupPath, group, flowCapableNodePath);
- Mockito.verify(salGroupService).removeGroup(ArgumentMatchers.<RemoveGroupInput>any());
+ Mockito.verify(salGroupService).removeGroup(ArgumentMatchers.any());
Assert.assertTrue(addResult.isDone());
final RpcResult<RemoveGroupOutput> result = addResult.get(2, TimeUnit.SECONDS);
final Future<RpcResult<UpdateGroupOutput>> addResult =
groupForwarder.update(groupPath, groupOriginal, groupUpdate, flowCapableNodePath);
- Mockito.verify(salGroupService).updateGroup(ArgumentMatchers.<UpdateGroupInput>any());
+ Mockito.verify(salGroupService).updateGroup(ArgumentMatchers.any());
Assert.assertTrue(addResult.isDone());
final RpcResult<UpdateGroupOutput> result = addResult.get(2, TimeUnit.SECONDS);
final Future<RpcResult<AddGroupOutput>> addResult = groupForwarder.add(groupPath, group, flowCapableNodePath);
- Mockito.verify(salGroupService).addGroup(ArgumentMatchers.<AddGroupInput>any());
+ Mockito.verify(salGroupService).addGroup(ArgumentMatchers.any());
Assert.assertTrue(addResult.isDone());
final RpcResult<AddGroupOutput> result = addResult.get(2, TimeUnit.SECONDS);
final Future<RpcResult<RemoveMeterOutput>> removeResult =
meterForwarder.remove(meterPath, removeMeter, flowCapableNodePath);
- Mockito.verify(salMeterService).removeMeter(ArgumentMatchers.<RemoveMeterInput>any());
+ Mockito.verify(salMeterService).removeMeter(ArgumentMatchers.any());
Assert.assertTrue(removeResult.isDone());
final RpcResult<RemoveMeterOutput> meterResult = removeResult.get(2, TimeUnit.SECONDS);
final Future<RpcResult<UpdateMeterOutput>> updateResult =
meterForwarder.update(meterPath, meterOriginal, meterUpdate,
flowCapableNodePath);
- Mockito.verify(salMeterService).updateMeter(ArgumentMatchers.<UpdateMeterInput>any());
+ Mockito.verify(salMeterService).updateMeter(ArgumentMatchers.any());
Assert.assertTrue(updateResult.isDone());
final RpcResult<UpdateMeterOutput> meterResult = updateResult.get(2, TimeUnit.SECONDS);
);
final Future<RpcResult<AddMeterOutput>> addResult = meterForwarder.add(meterPath, meter, flowCapableNodePath);
- Mockito.verify(salMeterService).addMeter(ArgumentMatchers.<AddMeterInput>any());
+ Mockito.verify(salMeterService).addMeter(ArgumentMatchers.any());
Assert.assertTrue(addResult.isDone());
final RpcResult<AddMeterOutput> meterResult = addResult.get(2, TimeUnit.SECONDS);
groupsToAddOrUpdate, metersToAddOrUpdate, flowsToAddOrUpdate,
flowsToRemove, metersToRemove, groupsToRemove);
- Mockito.when(flatBatchService.processFlatBatch(ArgumentMatchers.<ProcessFlatBatchInput>any()))
+ Mockito.when(flatBatchService.processFlatBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new ProcessFlatBatchOutputBuilder().build()).buildFuture());
final SyncCrudCounters counters = new SyncCrudCounters();
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutputBuilder;
final ListenableFuture<RpcResult<Void>> rpcResult = syncPlanPushStrategy.executeSyncStrategy(
RpcResultBuilder.<Void>success().buildFuture(), diffInput, syncCounters);
- Mockito.verify(groupCommitter, Mockito.times(6)).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(groupCommitter, Mockito.times(3)).update(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.<Group>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(groupCommitter, Mockito.times(6)).remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(flowCommitter, Mockito.times(6)).add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
- ArgumentMatchers.<Flow>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(flowCommitter, Mockito.times(3)).update(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
- ArgumentMatchers.<Flow>any(), ArgumentMatchers.<Flow>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(flowCommitter, Mockito.times(6)).remove(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
- ArgumentMatchers.<Flow>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(meterCommitter, Mockito.times(3)).add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
- ArgumentMatchers.<Meter>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(meterCommitter, Mockito.times(3)).update(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
- ArgumentMatchers.<Meter>any(), ArgumentMatchers.<Meter>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
- Mockito.verify(meterCommitter, Mockito.times(3)).remove(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
- ArgumentMatchers.<Meter>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ Mockito.verify(groupCommitter, Mockito.times(6)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
+ Mockito.verify(groupCommitter, Mockito.times(3)).update(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
+ Mockito.verify(groupCommitter, Mockito.times(6)).remove(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
+ Mockito.verify(flowCommitter, Mockito.times(6)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
+ Mockito.verify(flowCommitter, Mockito.times(3)).update(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
+ Mockito.verify(flowCommitter, Mockito.times(6)).remove(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
+ Mockito.verify(meterCommitter, Mockito.times(3)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
+ Mockito.verify(meterCommitter, Mockito.times(3)).update(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
+ Mockito.verify(meterCommitter, Mockito.times(3)).remove(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
Assert.assertTrue(rpcResult.isDone());
Assert.assertTrue(rpcResult.get().isSuccessful());
@Before
public void setUp() throws Exception {
- Mockito.when(flowCapableTxService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
+ Mockito.when(flowCapableTxService.sendBarrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success((SendBarrierOutput) null).buildFuture());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(groupCommitter).add(
- ArgumentMatchers.<InstanceIdentifier<Group>>any(), ArgumentMatchers.<Group>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(groupCommitter).update(
- ArgumentMatchers.<InstanceIdentifier<Group>>any(), ArgumentMatchers.<Group>any(),
- ArgumentMatchers.<Group>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any(),
+ ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(groupCommitter).remove(
- ArgumentMatchers.<InstanceIdentifier<Group>>any(), ArgumentMatchers.<Group>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(flowCommitter).add(
- ArgumentMatchers.<InstanceIdentifier<Flow>>any(), ArgumentMatchers.<Flow>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(flowCommitter).update(
- ArgumentMatchers.<InstanceIdentifier<Flow>>any(), ArgumentMatchers.<Flow>any(),
- ArgumentMatchers.<Flow>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(flowCommitter).remove(
- ArgumentMatchers.<InstanceIdentifier<Flow>>any(), ArgumentMatchers.<Flow>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(meterCommitter).add(
- ArgumentMatchers.<InstanceIdentifier<Meter>>any(), ArgumentMatchers.<Meter>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(meterCommitter).update(
- ArgumentMatchers.<InstanceIdentifier<Meter>>any(), ArgumentMatchers.<Meter>any(),
- ArgumentMatchers.<Meter>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(meterCommitter).remove(
- ArgumentMatchers.<InstanceIdentifier<Meter>>any(), ArgumentMatchers.<Meter>any(),
- ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
Mockito.doAnswer(createSalServiceFutureAnswer()).when(tableCommitter).update(
- ArgumentMatchers.<InstanceIdentifier<TableFeatures>>any(), ArgumentMatchers.<TableFeatures>any(),
- ArgumentMatchers.<TableFeatures>any(), ArgumentMatchers.<InstanceIdentifier<FlowCapableNode>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any());
syncPlanPushStrategy = new SyncPlanPushStrategyIncrementalImpl()
.setMeterForwarder(meterCommitter)
@Test
public void testAddMissingFlows() throws Exception {
- Mockito.when(flowCommitter.add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
+ Mockito.when(flowCommitter.add(ArgumentMatchers.any(), flowCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
Assert.assertEquals("f4", flowCaptorAllValues.get(1).getId().getValue());
final InOrder inOrderFlow = Mockito.inOrder(flowCapableTxService, flowCommitter);
- inOrderFlow.verify(flowCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
- ArgumentMatchers.<Flow>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderFlow.verify(flowCommitter, Mockito.times(2)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderFlow.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
inOrderFlow.verifyNoMoreInteractions();
@Test
public void testRemoveRedundantFlows() throws Exception {
- Mockito.when(flowCommitter.remove(ArgumentMatchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
+ Mockito.when(flowCommitter.remove(ArgumentMatchers.any(), flowCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new RemoveFlowOutputBuilder().build()).buildFuture());
Assert.assertEquals("f4", flowCaptorAllValues.get(1).getId().getValue());
final InOrder inOrderFlow = Mockito.inOrder(flowCapableTxService, flowCommitter);
- inOrderFlow.verify(flowCommitter, Mockito.times(2)).remove(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
- ArgumentMatchers.<Flow>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderFlow.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderFlow.verify(flowCommitter, Mockito.times(2)).remove(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderFlow.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
inOrderFlow.verifyNoMoreInteractions();
}
@Test
public void testAddMissingFlows_withUpdate() throws Exception {
- Mockito.when(flowCommitter.add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(), flowCaptor.capture(),
+ Mockito.when(flowCommitter.add(ArgumentMatchers.any(), flowCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
- Mockito.when(flowCommitter.update(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
+ Mockito.when(flowCommitter.update(ArgumentMatchers.any(),
flowUpdateCaptor.capture(), flowUpdateCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new UpdateFlowOutputBuilder().build()).buildFuture());
final InOrder inOrderFlow = Mockito.inOrder(flowCapableTxService, flowCommitter);
// add f3, f4
- inOrderFlow.verify(flowCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
- ArgumentMatchers.<Flow>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderFlow.verify(flowCommitter, Mockito.times(2)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
// update f1
- inOrderFlow.verify(flowCommitter).update(ArgumentMatchers.<InstanceIdentifier<Flow>>any(),
- ArgumentMatchers.<Flow>any(), ArgumentMatchers.<Flow>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderFlow.verify(flowCommitter).update(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderFlow.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
@Test
public void testAddMissingMeters() throws Exception {
- Mockito.when(meterCommitter.add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
+ Mockito.when(meterCommitter.add(ArgumentMatchers.any(), meterCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddMeterOutputBuilder().build()).buildFuture());
Assert.assertEquals(4L, metercaptorAllValues.get(1).getMeterId().getValue().longValue());
final InOrder inOrderMeter = Mockito.inOrder(flowCapableTxService, meterCommitter);
- inOrderMeter.verify(meterCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
- ArgumentMatchers.<Meter>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderMeter.verify(meterCommitter, Mockito.times(2)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderMeter.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
inOrderMeter.verifyNoMoreInteractions();
@Test
public void testAddMissingMeters_withUpdate() throws Exception {
- Mockito.when(meterCommitter.add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
+ Mockito.when(meterCommitter.add(ArgumentMatchers.any(), meterCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddMeterOutputBuilder().build()).buildFuture());
- Mockito.when(meterCommitter.update(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
+ Mockito.when(meterCommitter.update(ArgumentMatchers.any(),
meterUpdateCaptor.capture(), meterUpdateCaptor.capture(), ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new UpdateMeterOutputBuilder().build()).buildFuture());
Assert.assertEquals(1L, meterUpdateCaptorAllValues.get(1).getMeterId().getValue().longValue());
final InOrder inOrderMeters = Mockito.inOrder(flowCapableTxService, meterCommitter);
- inOrderMeters.verify(meterCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
- ArgumentMatchers.<Meter>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderMeters.verify(meterCommitter).update(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
- ArgumentMatchers.<Meter>any(), ArgumentMatchers.<Meter>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderMeters.verify(meterCommitter, Mockito.times(2)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderMeters.verify(meterCommitter).update(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderMeters.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
@Test
public void testRemoveRedundantMeters() throws Exception {
- Mockito.when(meterCommitter.remove(ArgumentMatchers.<InstanceIdentifier<Meter>>any(), meterCaptor.capture(),
+ Mockito.when(meterCommitter.remove(ArgumentMatchers.any(), meterCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new RemoveMeterOutputBuilder().build()).buildFuture());
Assert.assertEquals(4L, metercaptorAllValues.get(1).getMeterId().getValue().longValue());
final InOrder inOrderMeter = Mockito.inOrder(flowCapableTxService, meterCommitter);
- inOrderMeter.verify(meterCommitter, Mockito.times(2)).remove(ArgumentMatchers.<InstanceIdentifier<Meter>>any(),
- ArgumentMatchers.<Meter>any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderMeter.verify(meterCommitter, Mockito.times(2)).remove(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
//TODO: uncomment when enabled in impl
// inOrderMeter.verify(flowCapableTxService).sendBarrier(Matchers.<SendBarrierInput>any());
inOrderMeter.verifyNoMoreInteractions();
@Test
public void testAddMissingGroups() throws Exception {
- Mockito.when(groupCommitter.add(ArgumentMatchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
+ Mockito.when(groupCommitter.add(ArgumentMatchers.any(), groupCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddGroupOutputBuilder().build()).buildFuture());
final InOrder inOrderGroups = Mockito.inOrder(flowCapableTxService, groupCommitter);
// add 2
- inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
// add 3, 4
- inOrderGroups.verify(groupCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter, Mockito.times(2)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
// add 5
- inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
inOrderGroups.verifyNoMoreInteractions();
}
@Test
public void testAddMissingGroups_withUpdate() throws Exception {
- Mockito.when(groupCommitter.add(ArgumentMatchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
+ Mockito.when(groupCommitter.add(ArgumentMatchers.any(), groupCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new AddGroupOutputBuilder().build()).buildFuture());
- Mockito.when(groupCommitter.update(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
+ Mockito.when(groupCommitter.update(ArgumentMatchers.any(),
groupUpdateCaptor.capture(), groupUpdateCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new UpdateGroupOutputBuilder().build()).buildFuture());
final InOrder inOrderGroups = Mockito.inOrder(flowCapableTxService, groupCommitter);
// add 2, update 1
- inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroups.verify(groupCommitter).update(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(groupCommitter).update(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
// add 3, 4
- inOrderGroups.verify(groupCommitter, Mockito.times(2)).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter, Mockito.times(2)).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
// add 5
- inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroups.verify(groupCommitter).add(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroups.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
inOrderGroups.verifyNoMoreInteractions();
}
@Test
public void testRemoveRedundantGroups() throws Exception {
- Mockito.when(groupCommitter.remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(), groupCaptor.capture(),
+ Mockito.when(groupCommitter.remove(ArgumentMatchers.any(), groupCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new RemoveGroupOutputBuilder().build()).buildFuture());
final InOrder inOrderGroup = Mockito.inOrder(flowCapableTxService, groupCommitter);
// remove 5
- inOrderGroup.verify(groupCommitter).remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroup.verify(groupCommitter).remove(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
// remove 3, 4
- inOrderGroup.verify(groupCommitter, Mockito.times(2)).remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroup.verify(groupCommitter, Mockito.times(2)).remove(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
// remove 2
- inOrderGroup.verify(groupCommitter).remove(ArgumentMatchers.<InstanceIdentifier<Group>>any(),
- ArgumentMatchers.<Group>any(), ArgumentMatchers.eq(NODE_IDENT));
- inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrderGroup.verify(groupCommitter).remove(ArgumentMatchers.any(),
+ ArgumentMatchers.any(), ArgumentMatchers.eq(NODE_IDENT));
+ inOrderGroup.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
inOrderGroup.verifyNoMoreInteractions();
}
@Test
public void testUpdateTableFeatures() throws Exception {
- Mockito.lenient().when(tableCommitter.update(ArgumentMatchers.<InstanceIdentifier<TableFeatures>>any(),
+ Mockito.lenient().when(tableCommitter.update(ArgumentMatchers.any(),
ArgumentMatchers.isNull(TableFeatures.class), tableFeaturesCaptor.capture(),
ArgumentMatchers.same(NODE_IDENT)))
.thenReturn(RpcResultBuilder.success(new UpdateTableOutputBuilder().build()).buildFuture());
// Assert.assertEquals("test table features", groupCaptorAllValues.get(0).getName());
// Assert.assertEquals(1, groupCaptorAllValues.get(0).getTableId().intValue());
- Mockito.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ Mockito.verify(flowCapableTxService).sendBarrier(ArgumentMatchers.any());
}
}
final Future<RpcResult<UpdateTableOutput>> updateResult = tableForwarder.update(
tableFeaturesPath, tableFeatures, tableFeaturesUpdate, flowCapableNodePath);
- Mockito.verify(salTableService).updateTable(ArgumentMatchers.<UpdateTableInput>any());
+ Mockito.verify(salTableService).updateTable(ArgumentMatchers.any());
Assert.assertTrue(updateResult.isDone());
final RpcResult<UpdateTableOutput> updateTableResult = updateResult.get(2, TimeUnit.SECONDS);
Mockito.when(flowCapableService.sendBarrier(barrierInputCaptor.capture()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
- Mockito.verify(flowCapableService, Mockito.never()).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ Mockito.verify(flowCapableService, Mockito.never()).sendBarrier(ArgumentMatchers.any());
Assert.assertFalse(vehicle.isDone());
testRabbit.set(RpcResultBuilder.<Void>success().build());
- Mockito.verify(flowCapableService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ Mockito.verify(flowCapableService).sendBarrier(ArgumentMatchers.any());
Assert.assertTrue(vehicle.isDone());
Assert.assertTrue(vehicle.get().isSuccessful());
}
private Group createGroup(final long groupIdValue) {
final Buckets buckets = new BucketsBuilder()
- .setBucket(Collections.<Bucket>emptyList())
+ .setBucket(Collections.emptyList())
.build();
return new GroupBuilder()
.setGroupId(new GroupId(groupIdValue))
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
// NOTE : fix if it needs, but we have to ask DataStore for the NodeConnector list
- builder.setNodeConnector(Collections.<NodeConnector>emptyList());
+ builder.setNodeConnector(Collections.emptyList());
builder.setFlowAndStatisticsMapList(Collections.singletonList(fsmlBuilder.build()));
return builder.build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMapBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMapKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.statistics.FlowTableStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
// NOTE : fix if it needs, but we have to ask DataStore for the NodeConnector list
- builder.setNodeConnector(Collections.<NodeConnector>emptyList());
+ builder.setNodeConnector(Collections.emptyList());
builder.setFlowTableAndStatisticsMap(Collections.singletonList(ftsmBuilder.build()));
return builder.build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.statistics.GroupStatistics;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
// TODO : fix if it needs, but we have to ask DataStore for the NodeConnector list
- builder.setNodeConnector(Collections.<NodeConnector>emptyList());
+ builder.setNodeConnector(Collections.emptyList());
builder.setGroupStats(Collections.singletonList(new GroupStatsBuilder(groupStatistics).build()));
return builder.build();
}
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterStatisticsUpdated;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterStatisticsUpdatedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterStatistics;
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
// TODO : fix if it needs, but we have to ask DataStore for the NodeConnector list
- builder.setNodeConnector(Collections.<NodeConnector>emptyList());
+ builder.setNodeConnector(Collections.emptyList());
builder.setMeterStats(Collections.singletonList(new MeterStatsBuilder(meterStatistics).build()));
return builder.build();
}
}
List<Link> linkList = topologyOptional.get().getLink() != null ? topologyOptional.get()
- .getLink() : Collections.<Link>emptyList();
+ .getLink() : Collections.emptyList();
for (Link link : linkList) {
if (id.equals(link.getSource().getSourceTp()) || id.equals(link.getDestination().getDestTp())) {
manager.addDeleteOperationToTxChain(LogicalDatastoreType.OPERATIONAL, linkPath(link, topology));
nxAugMatchRpcAddFlowBuilder.setNxmOfArpOp(nxmOfArpOpBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
final MatchEntry converted = arpOpConvertor.convert(extension);
.setNxmNxArpSha(nxmNxArpShaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
arpShaConvertor = new ArpShaConvertor();
nxAugMatchRpcAddFlowBuilder.setNxmOfArpSpa(nxmOfArpSpaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
final MatchEntry converted = arpSpaConvertor.convert(extension);
.setNxmNxArpTha(nxArpThaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
arpThaConvertor = new ArpThaConvertor();
nxAugMatchRpcAddFlowBuilder.setNxmOfArpTpa(nxmOfArpTpaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
arpTpaConvertor = new ArpTpaConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtState(nxmNxCtStateBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
ctStateConvertor = new CtStateConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtZone(nxmNxCtZoneBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
ctZoneConvertor = new CtZoneConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthDst(nxmOfEthDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
ethDstConvertor = new EthDstConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthSrc(nxmOfEthSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
ethSrcConvertor = new EthSrcConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthType(nxmOfEthTypeBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
ethTypeConvertor = new EthTypeConvertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshFlags(nxmNxNshFlags)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
convertor = new NshFlagsConvertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshMdtype(nxmNxNshMdtype)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
convertor = new NshMdtypeConvertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshNp(nxmNxNshNp)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
convertor = new NshNpConvertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshTtl(nxmNxNshTtl)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
convertor = new NshTtlConvertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc1(nxmNxNshc1)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nshc1Convertor = new Nshc1Convertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc2(nxmNxNshc2)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nshc2Convertor = new Nshc2Convertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc3(nxmNxNshc3)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nshc3Convertor = new Nshc3Convertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc4(nxmNxNshc4)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nshc4Convertor = new Nshc4Convertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNsi(nxmNxNsi)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nsiConvertor = new NsiConvertor();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNsp(nxmNxNsp)
.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(nxAugMatchNotifUpdateFlowStats);
nspConvertor = new NspConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpDst(nxmOfTcpDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
tcpDstConvertor = new TcpDstConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpSrc(nxmOfTcpSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
tcpSrcConvertor = new TcpSrcConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunIpv4Dst(nxmNxTunIpv4DstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
tunIPv4DstConvertor = new TunIPv4DstConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunIpv4Src(nxmNxTunIpv4SrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
tunIPv4DstConvertor = new TunIPv4SrcConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunId(nxmNxTunIdBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
tunIdConvertor = new TunIdConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfUdpDst(nxmOfUdpDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
udpDstConvertor = new UdpDstConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfUdpSrc(nxmOfUdpSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.augmentation(ArgumentMatchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(ArgumentMatchers.any()))
.thenReturn(extensionAugmentation);
udpSrcConvertor = new UdpSrcConvertor();
EthernetAddress ea1;
// Null input array
try {
- ea1 = new EthernetAddress((byte[]) null);
+ ea1 = new EthernetAddress(null);
// Exception is expected if NOT raised test will fail
fail("Expected NullPointerException");
outBuffer.writeShort(message.getHardTimeout());
outBuffer.writeLong(message.getPacketCount().longValue());
outBuffer.writeLong(message.getByteCount().longValue());
- OFSerializer<Match> matchSerializer = registry.<Match, OFSerializer<Match>>getSerializer(
+ OFSerializer<Match> matchSerializer = registry.getSerializer(
new MessageTypeKey<>(message.getVersion(), Match.class));
matchSerializer.serialize(message.getMatch(), outBuffer);
ByteBufUtils.updateOFHeaderLength(outBuffer, index);
flowStatsBuff.writeLong(flowStats.getCookie().longValue());
flowStatsBuff.writeLong(flowStats.getPacketCount().longValue());
flowStatsBuff.writeLong(flowStats.getByteCount().longValue());
- OFSerializer<Match> matchSerializer = registry.<Match, OFSerializer<Match>>getSerializer(
+ OFSerializer<Match> matchSerializer = registry.getSerializer(
new MessageTypeKey<>(message.getVersion(), Match.class));
matchSerializer.serialize(flowStats.getMatch(), flowStatsBuff);
ListSerializer.serializeList(flowStats.getInstruction(),
outBuffer.writeByte(message.getReason().getIntValue());
outBuffer.writeByte(message.getTableId().getValue().byteValue());
outBuffer.writeLong(message.getCookie().longValue());
- OFSerializer<Match> matchSerializer = registry.<Match, OFSerializer<Match>>getSerializer(
+ OFSerializer<Match> matchSerializer = registry.getSerializer(
new MessageTypeKey<>(message.getVersion(), Match.class));
matchSerializer.serialize(message.getMatch(), outBuffer);
outBuffer.writeZero(PADDING);
public void takeMessage() throws Exception {
outboundQueueEntry.commit(packetOutInput, futureCallback);
outboundQueueEntry.takeMessage();
- Mockito.verify(futureCallback).onSuccess(Mockito.<OfHeader>any());
+ Mockito.verify(futureCallback).onSuccess(Mockito.any());
}
@Test
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
-import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
import org.opendaylight.openflowjava.util.ByteBufUtils;
/**
*/
@Test
public void test() {
- Mockito.when(registry.getDeserializer(ArgumentMatchers.<MessageCodeKey>any())).thenReturn(deserializer);
+ Mockito.when(registry.getDeserializer(ArgumentMatchers.any())).thenReturn(deserializer);
ByteBuf buffer = ByteBufUtils.hexStringToByteBuf("01 02 03 04 FF FF FF FF 80 00 00 00");
VendorMessageFactory factory = new VendorMessageFactory();
factory.injectDeserializerRegistry(registry);
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.MultipartReplyMessageFactory;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
*/
@Test
public void testMultipartReplyExperimenter() {
- Mockito.when(registry.getDeserializer(ArgumentMatchers.<MessageCodeKey>any())).thenReturn(vendorDeserializer);
+ Mockito.when(registry.getDeserializer(ArgumentMatchers.any())).thenReturn(vendorDeserializer);
factory.injectDeserializerRegistry(registry);
ByteBuf bb = BufferHelper.buildBuffer("FF FF 00 01 00 00 00 00 "
+ "00 00 00 01 00 00 00 02"); // expID, expType
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.OF10StatsReplyMessageFactory;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
*/
@Test
public void test() {
- Mockito.when(registry.getDeserializer(ArgumentMatchers.<MessageCodeKey>any())).thenReturn(vendorDeserializer);
+ Mockito.when(registry.getDeserializer(ArgumentMatchers.any())).thenReturn(vendorDeserializer);
OF10StatsReplyMessageFactory factory = new OF10StatsReplyMessageFactory();
factory.injectDeserializerRegistry(registry);
registry.registerSerializer(key, serializerMock);
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
ser.serialize(actionBuilder.build(), out);
- Mockito.verify(serializerMock, Mockito.times(1)).serialize((MatchEntry)Mockito.anyObject(),
- (ByteBuf)Mockito.anyObject());
+ Mockito.verify(serializerMock, Mockito.times(1)).serialize(Mockito.anyObject(),
+ Mockito.anyObject());
int lenght = out.readableBytes();
Assert.assertEquals("Wrong - bad field code", ActionConstants.SET_FIELD_CODE, out.readUnsignedShort());
Assert.assertEquals("Wrong - bad lenght", lenght, out.readUnsignedShort());
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
-import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdSerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
ExperimenterInput input = builder.build();
Mockito.when(registry.getSerializer(
- (ExperimenterIdSerializerKey<?>) any())).thenReturn(serializer);
+ any())).thenReturn(serializer);
expFactory.serialize(input, out);
Mockito.verify(serializer, Mockito.times(1)).serialize(input.getExperimenterDataOfChoice(), out);
ExperimenterInput input = builder.build();
Mockito.when(registry.getSerializer(
- (ExperimenterIdSerializerKey<?>) any())).thenReturn(serializer);
+ any())).thenReturn(serializer);
expFactory.serialize(input, out);
Mockito.verify(serializer, Mockito.times(1)).serialize(input.getExperimenterDataOfChoice(), out);
*/
@Before
public void startUp() {
- Mockito.when(mockRegistry.getSerializer((MessageTypeKey<?>)any())).thenReturn(serializer);
+ Mockito.when(mockRegistry.getSerializer(any())).thenReturn(serializer);
registry = new SerializerRegistryImpl();
registry.init();
multipartFactory = registry.getSerializer(
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
// First process description reply, write data to DS and write consequent data if successful
return Futures.transformAsync(
requestMultipart(MultipartType.OFPMPDESC, deviceContext),
- (AsyncFunction<RpcResult<List<OfHeader>>, Void>) input -> {
+ input -> {
translateAndWriteResult(
MultipartType.OFPMPDESC,
input.getResult(),
convertFlowBatchFutureForChain(final Future<RpcResult<T>> resultUpdateFlowFuture,
final int currentOffset) {
return Futures.transform(JdkFutureAdapters.listenInPoolThread(resultUpdateFlowFuture),
- FlatBatchFlowAdapters.<T>convertBatchFlowResult(currentOffset),
+ FlatBatchFlowAdapters.convertBatchFlowResult(currentOffset),
MoreExecutors.directExecutor());
}
}
convertGroupBatchFutureForChain(final Future<RpcResult<T>> resultUpdateGroupFuture,
final int currentOffset) {
return Futures.transform(JdkFutureAdapters.listenInPoolThread(resultUpdateGroupFuture),
- FlatBatchGroupAdapters.<T>convertBatchGroupResult(currentOffset),
+ FlatBatchGroupAdapters.convertBatchGroupResult(currentOffset),
MoreExecutors.directExecutor());
}
}
convertMeterBatchFutureForChain(final Future<RpcResult<T>> resultUpdateMeterFuture,
final int currentOffset) {
return Futures.transform(JdkFutureAdapters.listenInPoolThread(resultUpdateMeterFuture),
- FlatBatchMeterAdapters.<T>convertBatchMeterResult(currentOffset),
+ FlatBatchMeterAdapters.convertBatchMeterResult(currentOffset),
MoreExecutors.directExecutor());
}
}
package org.opendaylight.openflowplugin.impl.services.multilayer;
-import com.google.common.base.Function;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.opendaylight.openflowplugin.api.OFConstants;
public ListenableFuture<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> handleAndReply(
final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
return Futures.transform(handleServiceCall(input),
- (Function<RpcResult<List<MultipartReply>>,
- RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>)
result -> {
if (Preconditions.checkNotNull(result).isSuccessful()) {
final MessageTranslator<MultipartReply, AggregatedFlowStatistics>
final ListenableFuture<RpcResult<List<BatchFailedFlowsOutput>>> commonResult =
Futures.transform(Futures.successfulAsList(resultsLot),
- FlowUtil.<RemoveFlowOutput>createCumulatingFunction(input.getBatchRemoveFlows()),
+ FlowUtil.createCumulatingFunction(input.getBatchRemoveFlows()),
MoreExecutors.directExecutor());
ListenableFuture<RpcResult<RemoveFlowsBatchOutput>> removeFlowsBulkFuture =
final ListenableFuture<RpcResult<List<BatchFailedFlowsOutput>>> commonResult =
Futures.transform(Futures.successfulAsList(resultsLot),
- FlowUtil.<AddFlowOutput>createCumulatingFunction(input.getBatchAddFlows()),
+ FlowUtil.createCumulatingFunction(input.getBatchAddFlows()),
MoreExecutors.directExecutor());
ListenableFuture<RpcResult<AddFlowsBatchOutput>> addFlowsBulkFuture =
final ListenableFuture<RpcResult<List<BatchFailedFlowsOutput>>> commonResult =
Futures.transform(Futures.successfulAsList(resultsLot),
- FlowUtil.<UpdateFlowOutput>createCumulatingFunction(input.getBatchUpdateFlows()),
+ FlowUtil.createCumulatingFunction(input.getBatchUpdateFlows()),
MoreExecutors.directExecutor());
ListenableFuture<RpcResult<UpdateFlowsBatchOutput>> updateFlowsBulkFuture =
final ListenableFuture<RpcResult<List<BatchFailedGroupsOutput>>> commonResult = Futures
.transform(Futures.allAsList(resultsLot),
- GroupUtil.<UpdateGroupOutput>createCumulatingFunction(groups, batchUpdateGroups.size()));
+ GroupUtil.createCumulatingFunction(groups, batchUpdateGroups.size()));
ListenableFuture<RpcResult<UpdateGroupsBatchOutput>> updateGroupsBulkFuture = Futures
.transform(commonResult, GroupUtil.GROUP_UPDATE_TRANSFORM);
final ListenableFuture<RpcResult<List<BatchFailedGroupsOutput>>> commonResult = Futures
.transform(Futures.allAsList(resultsLot),
- GroupUtil.<AddGroupOutput>createCumulatingFunction(input.getBatchAddGroups()));
+ GroupUtil.createCumulatingFunction(input.getBatchAddGroups()));
ListenableFuture<RpcResult<AddGroupsBatchOutput>> addGroupsBulkFuture = Futures
.transform(commonResult, GroupUtil.GROUP_ADD_TRANSFORM);
final ListenableFuture<RpcResult<List<BatchFailedGroupsOutput>>> commonResult = Futures
.transform(Futures.allAsList(resultsLot),
- GroupUtil.<RemoveGroupOutput>createCumulatingFunction(input.getBatchRemoveGroups()));
+ GroupUtil.createCumulatingFunction(input.getBatchRemoveGroups()));
ListenableFuture<RpcResult<RemoveGroupsBatchOutput>> removeGroupsBulkFuture = Futures
.transform(commonResult, GroupUtil.GROUP_REMOVE_TRANSFORM);
final ListenableFuture<RpcResult<List<BatchFailedMetersOutput>>> commonResult =
Futures.transform(Futures.allAsList(resultsLot),
- MeterUtil.<UpdateMeterOutput>createCumulativeFunction(meters, batchUpdateMeters.size()),
+ MeterUtil.createCumulativeFunction(meters, batchUpdateMeters.size()),
MoreExecutors.directExecutor());
ListenableFuture<RpcResult<UpdateMetersBatchOutput>> updateMetersBulkFuture =
final ListenableFuture<RpcResult<List<BatchFailedMetersOutput>>> commonResult =
Futures.transform(Futures.allAsList(resultsLot),
- MeterUtil.<AddMeterOutput>createCumulativeFunction(input.getBatchAddMeters()),
+ MeterUtil.createCumulativeFunction(input.getBatchAddMeters()),
MoreExecutors.directExecutor());
ListenableFuture<RpcResult<AddMetersBatchOutput>> addMetersBulkFuture =
final ListenableFuture<RpcResult<List<BatchFailedMetersOutput>>> commonResult =
Futures.transform(Futures.allAsList(resultsLot),
- MeterUtil.<RemoveMeterOutput>createCumulativeFunction(input.getBatchRemoveMeters()),
+ MeterUtil.createCumulativeFunction(input.getBatchRemoveMeters()),
MoreExecutors.directExecutor());
ListenableFuture<RpcResult<RemoveMetersBatchOutput>> removeMetersBulkFuture =
}
}, MoreExecutors.directExecutor());
- return RpcResultBuilder.<O>success(buildTxCapableResult(emulatedTxId)).buildFuture();
+ return RpcResultBuilder.success(buildTxCapableResult(emulatedTxId)).buildFuture();
}
public abstract O buildTxCapableResult(TransactionId emulatedTxId);
builder.setState(PortTranslatorUtil.translatePortState(input.getState()));
builder.setSupported(PortTranslatorUtil.translatePortFeatures(input.getSupportedFeatures()));
builder.setQueue(Collections
- .<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue>emptyList());
+ .emptyList());
}
if (input instanceof PortStatusMessage) {
if (((PortStatusMessage) input).getReason() != null) {
public final class FlowUtil {
private static final RpcResultBuilder<List<BatchFailedFlowsOutput>> SUCCESSFUL_FLOW_OUTPUT_RPC_RESULT =
- RpcResultBuilder.success(Collections.<BatchFailedFlowsOutput>emptyList());
+ RpcResultBuilder.success(Collections.emptyList());
/**
* Attach barrier response to given {@link RpcResult}<RemoveFlowsBatchOutput>.
public final class GroupUtil {
private static final RpcResultBuilder<List<BatchFailedGroupsOutput>> SUCCESSFUL_GROUP_OUTPUT_RPC_RESULT =
- RpcResultBuilder.success(Collections.<BatchFailedGroupsOutput>emptyList());
+ RpcResultBuilder.success(Collections.emptyList());
public static final Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<AddGroupsBatchOutput>>
GROUP_ADD_TRANSFORM = batchGroupsCumulatedResult -> {
public final class MeterUtil {
private static final RpcResultBuilder<List<BatchFailedMetersOutput>> SUCCESSFUL_METER_OUTPUT_RPC_RESULT =
- RpcResultBuilder.success(Collections.<BatchFailedMetersOutput>emptyList());
+ RpcResultBuilder.success(Collections.emptyList());
public static final Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<AddMetersBatchOutput>>
METER_ADD_TRANSFORM = batchMetersCumulatedResult -> {
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
import org.opendaylight.openflowplugin.impl.util.ThreadPoolLoggingExecutor;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
final InetSocketAddress deviceAddress = InetSocketAddress.createUnresolved("yahoo", 42);
Mockito.when(connection.getRemoteAddress()).thenReturn(deviceAddress);
Mockito.when(connection.isAlive()).thenReturn(true);
- Mockito.when(connection.barrier(ArgumentMatchers.<BarrierInput>any()))
+ Mockito.when(connection.barrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new BarrierOutputBuilder().build()).buildFuture());
}
Mockito.when(connection.hello(any(HelloInput.class))).thenReturn(voidResponseFx);
// prepare getFeature reply (getFeture rpc output)
final SettableFuture<RpcResult<GetFeaturesOutput>> featureResponseFx =
- SettableFuture.<RpcResult<GetFeaturesOutput>>create();
+ SettableFuture.create();
Mockito.when(connection.getFeatures(any(GetFeaturesInput.class))).thenReturn(featureResponseFx);
Mockito.when(connection.hello(any(HelloInput.class))).thenReturn(voidResponseFx);
// prepare getFeature reply (getFeture rpc output)
final SettableFuture<RpcResult<GetFeaturesOutput>> featureResponseFx =
- SettableFuture.<RpcResult<GetFeaturesOutput>>create();
+ SettableFuture.create();
Mockito.when(connection.getFeatures(any(GetFeaturesInput.class))).thenReturn(featureResponseFx);
public void testCreateBarrierRequest() {
final BarrierInput barrierRequest = outboundQueueProvider.createBarrierRequest(DUMMY_XID);
assertNotNull(barrierRequest);
- assertEquals((short)OFConstants.OFP_VERSION_1_3, (short)barrierRequest.getVersion());
+ assertEquals(OFConstants.OFP_VERSION_1_3, (short)barrierRequest.getVersion());
assertEquals(DUMMY_XID, barrierRequest.getXid());
}
}
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
import org.opendaylight.openflowplugin.impl.connection.ConnectionContextImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
@Before
public void setUp() throws Exception {
- Mockito.when(connectionAdapter.barrier(ArgumentMatchers.<BarrierInput>any()))
+ Mockito.when(connectionAdapter.barrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new BarrierOutputBuilder().build()).buildFuture());
connectionContextSpy = Mockito.spy(new ConnectionContextImpl(connectionAdapter));
Mockito.when(connectionContextSpy.getConnectionAdapter()).thenReturn(connectionAdapter);
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.connection.HandshakeContext;
import org.opendaylight.openflowplugin.api.openflow.md.core.HandshakeManager;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessageBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessageBuilder;
/**
.setVersion(OFConstants.OFP_VERSION_1_3);
openflowProtocolListenerInitial.onEchoRequestMessage(echoRequestMessageBld.build());
- Mockito.verify(connectionAdapter).echoReply(ArgumentMatchers.<EchoReplyInput>any());
+ Mockito.verify(connectionAdapter).echoReply(ArgumentMatchers.any());
}
@Test
.setVersion(OFConstants.OFP_VERSION_1_3);
openflowProtocolListenerInitial.onHelloMessage(helloMessageBld.build());
- Mockito.verify(handshakeManager).shake(ArgumentMatchers.<HelloMessage>any());
+ Mockito.verify(handshakeManager).shake(ArgumentMatchers.any());
}
@Test
Mockito.when(connectionAdapter.echo(any(EchoInput.class))).thenReturn(echoReply);
Mockito.when(connectionAdapter.isAlive()).thenReturn(true);
Mockito.when(connectionAdapter.disconnect())
- .thenReturn(Futures.<Boolean>immediateFailedFuture(new Exception("unit exception")));
+ .thenReturn(Futures.immediateFailedFuture(new Exception("unit exception")));
SwitchIdleEvent notification = new SwitchIdleEventBuilder().setInfo("wake up, device sleeps").build();
systemNotificationsListener.onSwitchIdleEvent(notification);
.build())
.build();
- Mockito.when(messageTranslatorPacketReceived.translate(Mockito.<Object>any(), Mockito.<DeviceInfo>any(),
- Mockito.<Object>any())).thenReturn(packetReceived);
- Mockito.when(messageTranslatorFlowCapableNodeConnector.translate(Mockito.<Object>any(),
- Mockito.<DeviceInfo>any(),
- Mockito.<Object>any())).thenReturn(mock(FlowCapableNodeConnector.class));
+ Mockito.when(messageTranslatorPacketReceived.translate(Mockito.any(), Mockito.any(),
+ Mockito.any())).thenReturn(packetReceived);
+ Mockito.when(messageTranslatorFlowCapableNodeConnector.translate(Mockito.any(),
+ Mockito.any(),
+ Mockito.any())).thenReturn(mock(FlowCapableNodeConnector.class));
Mockito.when(translatorLibrary.lookupTranslator(eq(new TranslatorKey(OFConstants.OFP_VERSION_1_3,
PacketIn.class.getName())))).thenReturn(messageTranslatorPacketReceived);
Mockito.when(translatorLibrary.lookupTranslator(eq(new TranslatorKey(OFConstants.OFP_VERSION_1_3,
.setVersion(OFConstants.OFP_VERSION_1_3).setXid(xid).build();
ofProtocolListener.onExperimenterMessage(experimenterMessage);
- Mockito.verify(deviceReplyProcessor).processExperimenterMessage(ArgumentMatchers.<ExperimenterMessage>any());
+ Mockito.verify(deviceReplyProcessor).processExperimenterMessage(ArgumentMatchers.any());
}
/**
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.MultiMsgCollector;
-import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerMultipartRequestCallback;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutputBuilder;
@Test
public void testOnSuccess1() throws Exception {
multipartRequestCallback.onSuccess(null);
- Mockito.verify(multiMsgCollector).endCollecting(ArgumentMatchers.<EventIdentifier>any());
+ Mockito.verify(multiMsgCollector).endCollecting(ArgumentMatchers.any());
}
/**
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyFlowCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.flow._case.MultipartReplyFlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.flow._case.multipart.reply.flow.FlowStatsBuilder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcError;
final InstanceIdentifier<FlowCapableNode> nodePath =
mockedDeviceInfo.getNodeInstanceIdentifier().augmentation(FlowCapableNode.class);
final FlowCapableNodeBuilder flowNodeBuilder = new FlowCapableNodeBuilder();
- flowNodeBuilder.setTable(Collections.<Table>emptyList());
+ flowNodeBuilder.setTable(Collections.emptyList());
final Optional<FlowCapableNode> flowNodeOpt = Optional.of(flowNodeBuilder.build());
dummyRequestContext = new AbstractRequestContext<List<MultipartReply>>(DUMMY_XID) {
Mockito.verify(mockedDeviceContext, Mockito.never())
.writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
- ArgumentMatchers.<InstanceIdentifier>any(), ArgumentMatchers.<DataObject>any());
+ ArgumentMatchers.<InstanceIdentifier>any(), ArgumentMatchers.any());
Mockito.verify(mockedDeviceContext).submitTransaction();
}
@Test
public void testOnSuccessWithValidMultipart1() throws Exception {
final MatchBuilder matchBuilder = new MatchBuilder()
- .setMatchEntry(Collections.<MatchEntry>emptyList());
+ .setMatchEntry(Collections.emptyList());
final FlowStatsBuilder flowStatsBuilder = new FlowStatsBuilder()
.setTableId(tableId)
.setPriority(2)
Mockito.verify(mockedFlowRegistry, Mockito.never()).store(any());
Mockito.verify(mockedDeviceContext, Mockito.never())
.writeToTransaction(eq(LogicalDatastoreType.OPERATIONAL),
- ArgumentMatchers.<InstanceIdentifier>any(), ArgumentMatchers.<DataObject>any());
+ ArgumentMatchers.<InstanceIdentifier>any(), ArgumentMatchers.any());
}
}
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
-import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.Future;
import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.GetAsyncOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
Assert.assertTrue(getAsyncResult.get().isSuccessful());
verify(mockedRequestContextStack).createRequestContext();
verify(mockedOutboundQueue).commitEntry(eq(ServiceMocking.DUMMY_XID_VALUE),
- ArgumentMatchers.<OfHeader>any(), ArgumentMatchers.<FutureCallback<OfHeader>>any());
+ ArgumentMatchers.any(), ArgumentMatchers.any());
}
}
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
-import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.Future;
import org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
Assert.assertTrue(echoOutput.get().isSuccessful());
verify(mockedRequestContextStack).createRequestContext();
verify(mockedOutboundQueue)
- .commitEntry(eq(2121L), ArgumentMatchers.<OfHeader>any(),
- ArgumentMatchers.<FutureCallback<OfHeader>>any());
+ .commitEntry(eq(2121L), ArgumentMatchers.any(),
+ ArgumentMatchers.any());
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.RemoveFlowsBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.RemoveFlowsBatchOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.RemoveFlowsBatchOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.SalFlowsBatchService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.UpdateFlowsBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.UpdateFlowsBatchOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.batch.flow.output.list.grouping.BatchFailedFlowsOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.AddGroupsBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.AddGroupsBatchOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.RemoveGroupsBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.RemoveGroupsBatchOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.SalGroupsBatchService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.UpdateGroupsBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.UpdateGroupsBatchOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.input.update.grouping.OriginalBatchedGroupBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.input.update.grouping.UpdatedBatchedGroupBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.AddMetersBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.AddMetersBatchOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.RemoveMetersBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.RemoveMetersBatchOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.SalMetersBatchService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.UpdateMetersBatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.UpdateMetersBatchOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.input.update.grouping.OriginalBatchedMeterBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.input.update.grouping.UpdatedBatchedMeterBuilder;
@Test
public void testProcessFlatBatch_allSuccessFinished() throws Exception {
- Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new RemoveFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salFlowsBatchService.updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.updateFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new UpdateFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.addGroupsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.removeGroupsBatch(ArgumentMatchers.<RemoveGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.removeGroupsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new RemoveGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.updateGroupsBatch(ArgumentMatchers.<UpdateGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.updateGroupsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new UpdateGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.addMetersBatch(ArgumentMatchers.<AddMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.addMetersBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddMetersBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.removeMetersBatch(ArgumentMatchers.<RemoveMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.removeMetersBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new RemoveMetersBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.updateMetersBatch(ArgumentMatchers.<UpdateMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.updateMetersBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new UpdateMetersBatchOutputBuilder().build()).buildFuture());
Assert.assertTrue(rpcResult.getResult().getBatchFailure().isEmpty());
final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
- inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.any());
+ inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.any());
+ inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.any());
- inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any());
- inOrder.verify(salGroupsBatchService).removeGroupsBatch(ArgumentMatchers.<RemoveGroupsBatchInput>any());
- inOrder.verify(salGroupsBatchService).updateGroupsBatch(ArgumentMatchers.<UpdateGroupsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.any());
+ inOrder.verify(salGroupsBatchService).removeGroupsBatch(ArgumentMatchers.any());
+ inOrder.verify(salGroupsBatchService).updateGroupsBatch(ArgumentMatchers.any());
- inOrder.verify(salMetersBatchService).addMetersBatch(ArgumentMatchers.<AddMetersBatchInput>any());
- inOrder.verify(salMetersBatchService).removeMetersBatch(ArgumentMatchers.<RemoveMetersBatchInput>any());
- inOrder.verify(salMetersBatchService).updateMetersBatch(ArgumentMatchers.<UpdateMetersBatchInput>any());
+ inOrder.verify(salMetersBatchService).addMetersBatch(ArgumentMatchers.any());
+ inOrder.verify(salMetersBatchService).removeMetersBatch(ArgumentMatchers.any());
+ inOrder.verify(salMetersBatchService).updateMetersBatch(ArgumentMatchers.any());
}
@Test
Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
- inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any());
- inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.any());
+ inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.any());
+ inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.any());
+ inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.any());
}
@Test
Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
- inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any());
- inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any());
+ inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.any());
+ inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.any());
+ inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.any());
- inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any());
- inOrder.verify(salGroupsBatchService).removeGroupsBatch(ArgumentMatchers.<RemoveGroupsBatchInput>any());
- inOrder.verify(salGroupsBatchService).updateGroupsBatch(ArgumentMatchers.<UpdateGroupsBatchInput>any());
+ inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.any());
+ inOrder.verify(salGroupsBatchService).removeGroupsBatch(ArgumentMatchers.any());
+ inOrder.verify(salGroupsBatchService).updateGroupsBatch(ArgumentMatchers.any());
- inOrder.verify(salMetersBatchService).addMetersBatch(ArgumentMatchers.<AddMetersBatchInput>any());
- inOrder.verify(salMetersBatchService).removeMetersBatch(ArgumentMatchers.<RemoveMetersBatchInput>any());
- inOrder.verify(salMetersBatchService).updateMetersBatch(ArgumentMatchers.<UpdateMetersBatchInput>any());
+ inOrder.verify(salMetersBatchService).addMetersBatch(ArgumentMatchers.any());
+ inOrder.verify(salMetersBatchService).removeMetersBatch(ArgumentMatchers.any());
+ inOrder.verify(salMetersBatchService).updateMetersBatch(ArgumentMatchers.any());
}
private void prepareFirstFailingMockService() {
- Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.<RemoveFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<RemoveFlowsBatchOutput>failed()
.withResult(new RemoveFlowsBatchOutputBuilder()
.setBatchFailedFlowsOutput(Lists.newArrayList(
.build())
.withError(RpcError.ErrorType.APPLICATION, "ut-firstFlowAddError")
.buildFuture());
- Mockito.when(salFlowsBatchService.updateFlowsBatch(ArgumentMatchers.<UpdateFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.updateFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new UpdateFlowsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.addGroupsBatch(ArgumentMatchers.<AddGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.addGroupsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.removeGroupsBatch(ArgumentMatchers.<RemoveGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.removeGroupsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new RemoveGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salGroupsBatchService.updateGroupsBatch(ArgumentMatchers.<UpdateGroupsBatchInput>any()))
+ Mockito.when(salGroupsBatchService.updateGroupsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new UpdateGroupsBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.addMetersBatch(ArgumentMatchers.<AddMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.addMetersBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddMetersBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.removeMetersBatch(ArgumentMatchers.<RemoveMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.removeMetersBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new RemoveMetersBatchOutputBuilder().build()).buildFuture());
- Mockito.when(salMetersBatchService.updateMetersBatch(ArgumentMatchers.<UpdateMetersBatchInput>any()))
+ Mockito.when(salMetersBatchService.updateMetersBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new UpdateMetersBatchOutputBuilder().build()).buildFuture());
}
createFlowBatchFailure(1, "f2")))
.buildFuture();
- Mockito.when(batchStepJob1.getStepFunction().apply(ArgumentMatchers.<RpcResult<ProcessFlatBatchOutput>>any()))
+ Mockito.when(batchStepJob1.getStepFunction().apply(ArgumentMatchers.any()))
.thenReturn(succeededChainOutput);
- Mockito.when(batchStepJob2.getStepFunction().apply(ArgumentMatchers.<RpcResult<ProcessFlatBatchOutput>>any()))
+ Mockito.when(batchStepJob2.getStepFunction().apply(ArgumentMatchers.any()))
.thenReturn(failedChainOutput);
final List<BatchStepJob> batchChainElements = Lists.newArrayList(batchStepJob1, batchStepJob2);
Assert.assertEquals(1, batchChain.size());
- Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder
.success(new AddFlowsBatchOutputBuilder().build())
.buildFuture());
Assert.assertEquals(0, rpcResult.getErrors().size());
Assert.assertEquals(0, rpcResult.getResult().getBatchFailure().size());
- Mockito.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any());
+ Mockito.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.any());
}
@Test
Assert.assertEquals(2, batchChain.size());
- Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.<AddFlowsBatchInput>any()))
+ Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder
.<AddFlowsBatchOutput>failed()
.withResult(new AddFlowsBatchOutputBuilder()
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchInput;
public void setUp() throws Exception {
salFlowsBatchService = new SalFlowsBatchServiceImpl(salFlowService, transactionService);
- Mockito.when(transactionService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
+ Mockito.when(transactionService.sendBarrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
}
@Test
public void testRemoveFlowsBatch_success() throws Exception {
- Mockito.when(salFlowService.removeFlow(ArgumentMatchers.<RemoveFlowInput>any()))
+ Mockito.when(salFlowService.removeFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new RemoveFlowOutputBuilder().build())
.buildFuture());
Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testRemoveFlowsBatch_failed() throws Exception {
- Mockito.when(salFlowService.removeFlow(ArgumentMatchers.<RemoveFlowInput>any()))
+ Mockito.when(salFlowService.removeFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<RemoveFlowOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "flow-remove-fail-1")
.buildFuture());
Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
private static BatchAddFlows createEmptyBatchAddFlow(final String flowIdValue, final int priority) {
@Test
public void testAddFlowsBatch_success() throws Exception {
- Mockito.when(salFlowService.addFlow(ArgumentMatchers.<AddFlowInput>any()))
+ Mockito.when(salFlowService.addFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
final AddFlowsBatchInput input = new AddFlowsBatchInputBuilder()
Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testAddFlowsBatch_failed() throws Exception {
- Mockito.when(salFlowService.addFlow(ArgumentMatchers.<AddFlowInput>any()))
+ Mockito.when(salFlowService.addFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder
.<AddFlowOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
.buildFuture());
Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testUpdateFlowsBatch_success() throws Exception {
- Mockito.when(salFlowService.updateFlow(ArgumentMatchers.<UpdateFlowInput>any()))
+ Mockito.when(salFlowService.updateFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new UpdateFlowOutputBuilder().build()).buildFuture());
final UpdateFlowsBatchInput input = new UpdateFlowsBatchInputBuilder()
Assert.assertEquals(44, allValues.get(1).getOriginalFlow().getPriority().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedFlow().getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testUpdateFlowsBatch_failure() throws Exception {
- Mockito.when(salFlowService.updateFlow(ArgumentMatchers.<UpdateFlowInput>any()))
+ Mockito.when(salFlowService.updateFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<UpdateFlowOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-flowUpdateError")
.buildFuture());
Assert.assertEquals(44, allValues.get(1).getOriginalFlow().getPriority().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedFlow().getPriority().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
}
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput;
public void setUp() throws Exception {
salGroupsBatchService = new SalGroupsBatchServiceImpl(salGroupService, transactionService);
- Mockito.when(transactionService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
+ Mockito.when(transactionService.sendBarrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
}
@Test
public void testUpdateGroupsBatch_success() throws Exception {
- Mockito.when(salGroupService.updateGroup(Mockito.<UpdateGroupInput>any()))
+ Mockito.when(salGroupService.updateGroup(Mockito.any()))
.thenReturn(RpcResultBuilder.success(new UpdateGroupOutputBuilder().build()).buildFuture());
final UpdateGroupsBatchInput input = new UpdateGroupsBatchInputBuilder()
Assert.assertEquals(44, allValues.get(1).getOriginalGroup().getGroupId().getValue().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedGroup().getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testUpdateGroupsBatch_failure() throws Exception {
- Mockito.when(salGroupService.updateGroup(Mockito.<UpdateGroupInput>any()))
+ Mockito.when(salGroupService.updateGroup(Mockito.any()))
.thenReturn(RpcResultBuilder.<UpdateGroupOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ur-groupUpdateError")
.buildFuture());
Assert.assertEquals(44, allValues.get(1).getOriginalGroup().getGroupId().getValue().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedGroup().getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testAddGroupsBatch_success() throws Exception {
- Mockito.when(salGroupService.addGroup(Mockito.<AddGroupInput>any()))
+ Mockito.when(salGroupService.addGroup(Mockito.any()))
.thenReturn(RpcResultBuilder.success(new AddGroupOutputBuilder().build()).buildFuture());
final AddGroupsBatchInput input = new AddGroupsBatchInputBuilder()
Assert.assertEquals(42L, allValues.get(0).getGroupId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testAddGroupsBatch_failure() throws Exception {
- Mockito.when(salGroupService.addGroup(Mockito.<AddGroupInput>any()))
+ Mockito.when(salGroupService.addGroup(Mockito.any()))
.thenReturn(RpcResultBuilder.<AddGroupOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
.buildFuture());
Assert.assertEquals(42L, allValues.get(0).getGroupId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testRemoveGroupsBatch_success() throws Exception {
- Mockito.when(salGroupService.removeGroup(Mockito.<RemoveGroupInput>any()))
+ Mockito.when(salGroupService.removeGroup(Mockito.any()))
.thenReturn(RpcResultBuilder.success(new RemoveGroupOutputBuilder().build()).buildFuture());
final RemoveGroupsBatchInput input = new RemoveGroupsBatchInputBuilder()
Assert.assertEquals(42L, allValues.get(0).getGroupId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testRemoveGroupsBatch_failure() throws Exception {
- Mockito.when(salGroupService.removeGroup(Mockito.<RemoveGroupInput>any()))
+ Mockito.when(salGroupService.removeGroup(Mockito.any()))
.thenReturn(RpcResultBuilder.<RemoveGroupOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-groupRemoveError")
.buildFuture());
Assert.assertEquals(42L, allValues.get(0).getGroupId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getGroupId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
private static BatchAddGroups createEmptyBatchAddGroup(final long groupIdValue) {
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
@Test
public void testUpdateMetersBatch_success() throws Exception {
- Mockito.when(salMeterService.updateMeter(Mockito.<UpdateMeterInput>any()))
+ Mockito.when(salMeterService.updateMeter(Mockito.any()))
.thenReturn(RpcResultBuilder.success(new UpdateMeterOutputBuilder().build()).buildFuture());
final UpdateMetersBatchInput input = new UpdateMetersBatchInputBuilder()
Assert.assertEquals(44, allValues.get(1).getOriginalMeter().getMeterId().getValue().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedMeter().getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testUpdateMetersBatch_failure() throws Exception {
- Mockito.when(salMeterService.updateMeter(Mockito.<UpdateMeterInput>any()))
+ Mockito.when(salMeterService.updateMeter(Mockito.any()))
.thenReturn(RpcResultBuilder.<UpdateMeterOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ur-groupUpdateError")
.buildFuture());
Assert.assertEquals(44, allValues.get(1).getOriginalMeter().getMeterId().getValue().longValue());
Assert.assertEquals(45, allValues.get(1).getUpdatedMeter().getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testAddMetersBatch_success() throws Exception {
- Mockito.when(salMeterService.addMeter(Mockito.<AddMeterInput>any()))
+ Mockito.when(salMeterService.addMeter(Mockito.any()))
.thenReturn(RpcResultBuilder.success(new AddMeterOutputBuilder().build()).buildFuture());
final AddMetersBatchInput input = new AddMetersBatchInputBuilder()
Assert.assertEquals(42L, allValues.get(0).getMeterId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testAddMetersBatch_failure() throws Exception {
- Mockito.when(salMeterService.addMeter(Mockito.<AddMeterInput>any()))
+ Mockito.when(salMeterService.addMeter(Mockito.any()))
.thenReturn(RpcResultBuilder.<AddMeterOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
.buildFuture());
Assert.assertEquals(42L, allValues.get(0).getMeterId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testRemoveMetersBatch_success() throws Exception {
- Mockito.when(salMeterService.removeMeter(Mockito.<RemoveMeterInput>any()))
+ Mockito.when(salMeterService.removeMeter(Mockito.any()))
.thenReturn(RpcResultBuilder.success(new RemoveMeterOutputBuilder().build()).buildFuture());
final RemoveMetersBatchInput input = new RemoveMetersBatchInputBuilder()
Assert.assertEquals(42L, allValues.get(0).getMeterId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
@Test
public void testRemoveMetersBatch_failure() throws Exception {
- Mockito.when(salMeterService.removeMeter(Mockito.<RemoveMeterInput>any()))
+ Mockito.when(salMeterService.removeMeter(Mockito.any()))
.thenReturn(RpcResultBuilder.<RemoveMeterOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-groupRemoveError")
.buildFuture());
Assert.assertEquals(42L, allValues.get(0).getMeterId().getValue().longValue());
Assert.assertEquals(43L, allValues.get(1).getMeterId().getValue().longValue());
- inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.any());
}
private static BatchAddMeters createEmptyBatchAddMeter(final long groupIdValue) {
.thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
NodeKey key = new NodeKey(testNodeId);
- InstanceIdentifier<Node> path = InstanceIdentifier.<Nodes>builder(Nodes.class)
- .<Node, NodeKey>child(Node.class, key)
+ InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class)
+ .child(Node.class, key)
.build();
nodeRef = new NodeRef(path);
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
-import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProviderFactory;
import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.MultipartReplyTableFeaturesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.multipart.reply.table.features.TableFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.UpdatedTableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
return null;
})
.when(mockedOutboundQueue).commitEntry(
- anyLong(), ArgumentMatchers.<OfHeader>any(), ArgumentMatchers.<FutureCallback<OfHeader>>any());
+ anyLong(), ArgumentMatchers.any(), ArgumentMatchers.any());
final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
salTableService = new SalTableServiceImpl(mockedRequestContextStack, mockedDeviceContext,
RpcResultBuilder.<List<MultipartReply>>failed().build();
handleResultFuture.set(rpcResult);
return null;
- }).when(multiMessageCollector).endCollecting(ArgumentMatchers.<EventIdentifier>any());
+ }).when(multiMessageCollector).endCollecting(ArgumentMatchers.any());
final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
Assert.assertNotNull(rpcResultFuture);
.build();
handleResultFuture.set(rpcResult);
return null;
- }).when(multiMessageCollector).endCollecting(ArgumentMatchers.<EventIdentifier>any());
+ }).when(multiMessageCollector).endCollecting(ArgumentMatchers.any());
final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
Assert.assertNotNull(rpcResultFuture);
.setTableId((short) 0)
.setName("Zafod")
.setMaxEntries(42L)
- .setTableFeatureProperties(Collections.<TableFeatureProperties>emptyList());
+ .setTableFeatureProperties(Collections.emptyList());
MultipartReplyTableFeaturesBuilder mpTableFeaturesBld = new MultipartReplyTableFeaturesBuilder()
.setTableFeatures(Collections.singletonList(tableFeaturesBld.build()));
MultipartReplyTableFeaturesCaseBuilder mpBodyBld = new MultipartReplyTableFeaturesCaseBuilder()
.build();
handleResultFuture.set(rpcResult);
return null;
- }).when(multiMessageCollector).endCollecting(ArgumentMatchers.<EventIdentifier>any());
+ }).when(multiMessageCollector).endCollecting(ArgumentMatchers.any());
final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
Assert.assertNotNull(rpcResultFuture);
private UpdateTableInput prepareUpdateTable() {
UpdateTableInputBuilder updateTableInputBuilder = new UpdateTableInputBuilder();
UpdatedTableBuilder updatedTableBuilder = new UpdatedTableBuilder();
- updatedTableBuilder.setTableFeatures(Collections.<TableFeatures>emptyList());
+ updatedTableBuilder.setTableFeatures(Collections.emptyList());
updateTableInputBuilder.setUpdatedTable(updatedTableBuilder.build());
return updateTableInputBuilder.build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.MultipartReplyBody;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregateCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyFlowCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyPortStatsCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.aggregate._case.MultipartReplyAggregateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.flow._case.MultipartReplyFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.flow._case.multipart.reply.flow.FlowStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.MultipartReplyGroupBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.group.stats.BucketStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDescBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.stats._case.MultipartReplyPortStatsBuilder;
private MultipartReplyBody prepareMultipartReplyGroupDesc() {
GroupDescBuilder groupDescBuilder = new GroupDescBuilder();
groupDescBuilder.setGroupId(DUMMY_GROUP_ID);
- groupDescBuilder.setBucketsList(Collections.<BucketsList>emptyList());
+ groupDescBuilder.setBucketsList(Collections.emptyList());
groupDescBuilder.setType(DUMMY_GROUP_TYPE);
MultipartReplyGroupDescBuilder multipartReplyGroupDescBuilder = new MultipartReplyGroupDescBuilder();
multipartReplyGroupDescBuilder.setGroupDesc(Lists.newArrayList(groupDescBuilder.build()));
private MultipartReplyBody prepareMultipartReplyGroup() {
GroupStatsBuilder groupStatsBuilder = new GroupStatsBuilder();
groupStatsBuilder.setByteCount(DUMMY_BYTE_COUNT);
- groupStatsBuilder.setBucketStats(Collections.<BucketStats>emptyList());
+ groupStatsBuilder.setBucketStats(Collections.emptyList());
groupStatsBuilder.setDurationSec(DUMMY_DURATION_SEC);
groupStatsBuilder.setDurationNsec(DUMMY_DURATION_NSEC);
groupStatsBuilder.setGroupId(DUMMY_GROUP_ID);
private MultipartReplyBody prepareMultipartReplyFlow() {
MultipartReplyFlowCaseBuilder multipartReplyFlowCaseBuilder = new MultipartReplyFlowCaseBuilder();
MultipartReplyFlowBuilder multipartReplyFlowBuilder = new MultipartReplyFlowBuilder();
- multipartReplyFlowBuilder.setFlowStats(Collections.<FlowStats>emptyList());
+ multipartReplyFlowBuilder.setFlowStats(Collections.emptyList());
multipartReplyFlowCaseBuilder.setMultipartReplyFlow(multipartReplyFlowBuilder.build());
return multipartReplyFlowCaseBuilder.build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter._case.multipart.reply.meter.meter.stats.MeterBandStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.config._case.MultipartReplyMeterConfigBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.config._case.multipart.reply.meter.config.MeterConfigBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.config._case.multipart.reply.meter.config.meter.config.Bands;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.stats._case.MultipartReplyPortStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.stats._case.multipart.reply.port.stats.PortStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.queue._case.MultipartReplyQueueBuilder;
final org.opendaylight.yang.gen.v1.urn
.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder matchBld =
new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder()
- .setMatchEntry(Collections.<MatchEntry>emptyList());
+ .setMatchEntry(Collections.emptyList());
final FlowStatsBuilder flowStatsBld = new FlowStatsBuilder()
.setByteCount(BigInteger.valueOf(55L))
.setPacketCount(BigInteger.valueOf(56L))
final MeterConfigBuilder meterConfigBld = new MeterConfigBuilder()
.setMeterId(new MeterId(meterIdValue))
.setFlags(new MeterFlags(false, true, false, true))
- .setBands(Collections.<Bands>emptyList());
+ .setBands(Collections.emptyList());
final MultipartReplyMeterConfigBuilder mpReplyMeterConfigBld = new MultipartReplyMeterConfigBuilder();
mpReplyMeterConfigBld.setMeterConfig(Lists.newArrayList(meterConfigBld.build()));
return null;
};
- Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
+ Mockito.when(rqContextStack.createRequestContext()).thenReturn(rqContext);
Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(null);
}
}
import org.mockito.stubbing.Answer;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
-import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
-import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
import org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
};
Mockito.when(rqContextStack.<List<MultipartReply>>createRequestContext()).thenReturn(rqContextMp);
Mockito.when(translatorLibrary
- .<MultipartReply, AggregatedFlowStatistics>lookupTranslator(Mockito.<TranslatorKey>any()))
+ .<MultipartReply, AggregatedFlowStatistics>lookupTranslator(Mockito.any()))
.thenReturn(translator);
}
.success(Collections.<MultipartReply>singletonList(messageBuilder.build()))
.build());
return null;
- }).when(multiMsgCollector).endCollecting(Mockito.<EventIdentifier>any());
+ }).when(multiMsgCollector).endCollecting(Mockito.any());
Mockito.when(translator.translate(
- Mockito.<MultipartReply>any(), same(deviceInfo), isNull())
+ Mockito.any(), same(deviceInfo), isNull())
).thenReturn(new AggregatedFlowStatisticsBuilder().build());
GetAggregateFlowStatisticsFromFlowTableForGivenMatchInputBuilder input =
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.MultipartReplyTableBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.multipart.reply.table.TableStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestTableCase;
-import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
Assert.assertTrue(rpcResult.isSuccessful());
Assert.assertEquals(MultipartType.OFPMPTABLE, requestInput.getValue().getType());
- Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
@Test
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.MultipartReplyGroupDescBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDescBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.features._case.MultipartReplyGroupFeaturesBuilder;
-import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
@After
public void tearDown() throws Exception {
- Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
@Test
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.config._case.multipart.reply.meter.config.MeterConfigBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.config._case.multipart.reply.meter.config.meter.config.BandsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.features._case.MultipartReplyMeterFeaturesBuilder;
-import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
@After
public void tearDown() throws Exception {
- Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
@Test
import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsOutput;
-import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
@After
public void tearDown() throws Exception {
- Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
@Test
import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromGivenPortOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortOutput;
-import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
@After
public void tearDown() throws Exception {
- Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.<Notification>any());
+ Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
@Test
};
Mockito.lenient().when(featuresOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
- Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
+ Mockito.when(rqContextStack.createRequestContext()).thenReturn(rqContext);
Mockito.lenient().when(deviceContext.getDeviceState()).thenReturn(deviceState);
Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
Mockito.when(deviceInfo.getNodeId()).thenReturn(NODE_ID);
import org.mockito.Mockito;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
-import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
import org.opendaylight.openflowplugin.impl.statistics.services.AbstractSingleStatsServiceTest;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder;
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider)
.commitEntry(eq(42L), requestInput.capture(), any(FutureCallback.class));
- Mockito.when(translatorLibrary.lookupTranslator(ArgumentMatchers.<TranslatorKey>any())).thenReturn(translator);
+ Mockito.when(translatorLibrary.lookupTranslator(ArgumentMatchers.any())).thenReturn(translator);
}
@Test(expected = IllegalAccessError.class)
.setCookie(BigInteger.ZERO)
.setPriority(14)
.setMatch(new MatchBuilder()
- .setMatchEntry(Collections.<MatchEntry>emptyList())
+ .setMatchEntry(Collections.emptyList())
.build())
.setHardTimeout(15)
.setIdleTimeout(16)
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessageBuilder;
if (isV10) {
builder.setMatchV10(new MatchV10Builder().setWildcards(flowWildcards).build());
} else {
- builder.setMatch(new MatchBuilder().setMatchEntry(Collections.<MatchEntry>emptyList()).build())
+ builder.setMatch(new MatchBuilder().setMatchEntry(Collections.emptyList()).build())
.setTableId(new TableId(42L));
}
@Before
public void setUp() throws Exception {
- Mockito.when(transactionService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
+ Mockito.when(transactionService.sendBarrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
}
final ListenableFuture<RpcResult<String>> chainResult =
BarrierUtil.chainBarrier(input, NODE_REF, transactionService, compositeTransform);
- Mockito.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
+ Mockito.verify(transactionService).sendBarrier(ArgumentMatchers.any());
Mockito.verify(compositeTransform).apply(pairCpt.capture());
final Pair<RpcResult<String>, RpcResult<SendBarrierOutput>> value = pairCpt.getValue();
final FlowModFlags none = new FlowModFlags(null, null, null, null, null);
for (final FlowModFlags f : defaults) {
- assertTrue(FlowCreatorUtil.equalsFlowModFlags(f, (FlowModFlags) null));
- assertTrue(FlowCreatorUtil.equalsFlowModFlags((FlowModFlags) null, f));
- assertFalse(FlowCreatorUtil.equalsFlowModFlags((FlowModFlags) null, all));
- assertFalse(FlowCreatorUtil.equalsFlowModFlags(all, (FlowModFlags) null));
- assertTrue(FlowCreatorUtil.equalsFlowModFlags((FlowModFlags) null, none));
- assertTrue(FlowCreatorUtil.equalsFlowModFlags(none, (FlowModFlags) null));
+ assertTrue(FlowCreatorUtil.equalsFlowModFlags(f, null));
+ assertTrue(FlowCreatorUtil.equalsFlowModFlags(null, f));
+ assertFalse(FlowCreatorUtil.equalsFlowModFlags(null, all));
+ assertFalse(FlowCreatorUtil.equalsFlowModFlags(all, null));
+ assertTrue(FlowCreatorUtil.equalsFlowModFlags(null, none));
+ assertTrue(FlowCreatorUtil.equalsFlowModFlags(none, null));
}
final String[] bitNames = {"cHECKOVERLAP", "nOBYTCOUNTS", "nOPKTCOUNTS", "rESETCOUNTS", "sENDFLOWREM"};
private RpcResult<List<BatchFailedFlowsOutput>> createEmptyBatchOutcome() {
return RpcResultBuilder
- .<List<BatchFailedFlowsOutput>>success(Collections.<BatchFailedFlowsOutput>emptyList())
+ .success(Collections.<BatchFailedFlowsOutput>emptyList())
.build();
}
private RpcResult<AddFlowsBatchOutput> createAddFlowsBatchSuccessOutput() {
return RpcResultBuilder
.success(new AddFlowsBatchOutputBuilder()
- .setBatchFailedFlowsOutput(Collections.<BatchFailedFlowsOutput>emptyList())
+ .setBatchFailedFlowsOutput(Collections.emptyList())
.build())
.build();
}
private RpcResult<List<BatchFailedGroupsOutput>> createEmptyBatchOutcome() {
return RpcResultBuilder
- .<List<BatchFailedGroupsOutput>>success(Collections.<BatchFailedGroupsOutput>emptyList())
+ .success(Collections.<BatchFailedGroupsOutput>emptyList())
.build();
}
private RpcResult<AddGroupsBatchOutput> createAddGroupsBatchSuccessOutput() {
return RpcResultBuilder
.success(new AddGroupsBatchOutputBuilder()
- .setBatchFailedGroupsOutput(Collections.<BatchFailedGroupsOutput>emptyList())
+ .setBatchFailedGroupsOutput(Collections.emptyList())
.build())
.build();
}
private RpcResult<List<BatchFailedMetersOutput>> createEmptyBatchOutcome() {
return RpcResultBuilder
- .<List<BatchFailedMetersOutput>>success(Collections.<BatchFailedMetersOutput>emptyList())
+ .success(Collections.<BatchFailedMetersOutput>emptyList())
.build();
}
private RpcResult<AddMetersBatchOutput> createAddMetersBatchSuccessOutput() {
return RpcResultBuilder
.success(new AddMetersBatchOutputBuilder()
- .setBatchFailedMetersOutput(Collections.<BatchFailedMetersOutput>emptyList())
+ .setBatchFailedMetersOutput(Collections.emptyList())
.build())
.build();
}
private static final Logger LOG = LoggerFactory.getLogger(TableFeaturesConvertor.class);
private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features
.table.features.table.properties.TableFeatureProperties> TABLE_FEATURE_PROPS_ORDERING =
- Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
- .features.table.features.table.properties.TableFeatureProperties>build());
+ Ordering.from(OrderComparator.build());
private static final Map<Class<?>, Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm
.rev150225.MatchField>> SAL_TO_OF_TABLE_FEATURES;
private static final List<Class<?>> TYPES = Arrays.asList(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
private static final Set<Class<?>> TYPES = Collections.singleton(org.opendaylight.yang.gen.v1.urn.opendaylight
.action.types.rev131112.action.list.Action.class);
private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
- .action.list.Action> ACTION_ORDERING = Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn
- .opendaylight.action.types.rev131112.action.list.Action>build());
+ .action.list.Action> ACTION_ORDERING = Ordering.from(OrderComparator.build());
@Override
public Collection<Class<?>> getTypes() {
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
-import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
-import org.opendaylight.openflowplugin.extension.api.path.AugmentationPath;
import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCaseBuilder;
public void setup() {
OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterProvider);
when(extensionConverterProvider.getActionConverter(any(MessageTypeKey.class)))
- .thenReturn((ConvertorActionFromOFJava<DataContainer, AugmentationPath>) (input, path) -> new MockAction());
+ .thenReturn((input, path) -> new MockAction());
}
@Test
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.extension.api.AugmentTuple;
-import org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava;
import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
-import org.opendaylight.openflowplugin.extension.api.path.AugmentationPath;
import org.opendaylight.openflowplugin.extension.api.path.MatchPath;
import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.ExtensionKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
* Created by Martin Bobak mbobak@cisco.com on 9/19/14.
public void setup() {
OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterProvider);
when(extensionConverterProvider.getConverter(KEY))
- .thenReturn((ConvertorFromOFJava<DataContainer, AugmentationPath>) (input, path) -> {
+ .thenReturn((input, path) -> {
MockAugmentation mockAugmentation = new MockAugmentation();
return new ExtensionAugment<>(MockAugmentation.class, mockAugmentation, MockExtensionKey.class);
});
private static NodeConnectorRef createNodeConnRef(final String nodeId, final NodeConnectorKey nodeConKey) {
InstanceIdentifier<NodeConnector> path = InstanceIdentifier
- .<Nodes>builder(Nodes.class)
- .<Node, NodeKey>child(Node.class,
+ .builder(Nodes.class)
+ .child(Node.class,
new NodeKey(new NodeId(nodeId)))
- .<NodeConnector, NodeConnectorKey>child(NodeConnector.class,
+ .child(NodeConnector.class,
nodeConKey).build();
return new NodeConnectorRef(path);
private static NodeRef createNodeRef(final String nodeId) {
NodeKey key = new NodeKey(new NodeId(nodeId));
InstanceIdentifier<Node> path = InstanceIdentifier
- .<Nodes>builder(Nodes.class)
- .<Node, NodeKey>child(Node.class, key).build();
+ .builder(Nodes.class)
+ .child(Node.class, key).build();
return new NodeRef(path);
}