This allows callers to be simplified.
JIRA: OPNFLWPLUG-1045
Change-Id: I8ed5eecc20bb66c0b322ef3716612cad24bd8ff1
Signed-off-by: Stephen Kitt <skitt@redhat.com>
private static final String FLOW_ID = "1";
@Test
- public void testIpIntToStr() throws Exception {
+ public void testIpIntToStr() {
Assert.assertEquals("255.255.255.255/32", BulkOMaticUtils.ipIntToStr(0xffffffff));
Assert.assertEquals("255.255.255.255/32", BulkOMaticUtils.ipIntToStr(-1));
Assert.assertEquals("0.0.0.0/32", BulkOMaticUtils.ipIntToStr(0));
}
@Test
- public void testGetMatch() throws Exception {
+ public void testGetMatch() {
final Match match = BulkOMaticUtils.getMatch(0xffffffff);
Assert.assertNotNull(match);
}
@Test
- public void testBuildFlow() throws Exception {
+ public void testBuildFlow() {
final Match match = BulkOMaticUtils.getMatch(0xffffffff);
final Flow flow = BulkOMaticUtils.buildFlow((short)1, FLOW_ID, match);
Assert.assertEquals(FLOW_ID,flow.getId().getValue());
}
@Test
- public void testGetFlowInstanceIdentifier() throws Exception {
+ public void testGetFlowInstanceIdentifier() {
Assert.assertNotNull(BulkOMaticUtils.getFlowInstanceIdentifier((short)1, "1", "1"));
}
@Test
- public void testGetFlowCapableNodeId() throws Exception {
+ public void testGetFlowCapableNodeId() {
Assert.assertNotNull(BulkOMaticUtils.getFlowCapableNodeId("1"));
}
@Test
- public void testGetTableId() throws Exception {
+ public void testGetTableId() {
Assert.assertNotNull(BulkOMaticUtils.getTableId((short)1, "1"));
}
@Test
- public void testGetFlowId() throws Exception {
+ public void testGetFlowId() {
Assert.assertNotNull(BulkOMaticUtils.getFlowId(BulkOMaticUtils.getTableId((short)1, "1"), "1"));
}
private FlowReader flowReader;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
doReturn(FluentFutures.immediateFluentFuture(Optional.of(node))).when(readOnlyTransaction)
.read(any(LogicalDatastoreType.class), any());
when(mockDataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction);
}
@Test
- public void testRun() throws Exception {
+ public void testRun() {
flowReader.run();
Assert.assertEquals(10, flowReader.getFlowCount());
Assert.assertEquals(FlowCounter.OperationStatus.SUCCESS.status(), flowReader.getReadOpStatus());
private FlowWriterConcurrent flowWriterConcurrent;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
doReturn(writeTransaction).when(mockDataBroker).newWriteOnlyTransaction();
doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit();
}
@Test
- public void testAddFlows() throws Exception {
+ public void testAddFlows() {
flowWriterConcurrent.addFlows(1, FLOWS_PER_DPN, 10, 10, 10, (short) 0, (short) 1, true);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.any(),
ArgumentMatchers.any(), ArgumentMatchers.any(),
}
@Test
- public void testDeleteFlows() throws Exception {
+ public void testDeleteFlows() {
flowWriterConcurrent.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
.delete(ArgumentMatchers.any(),
private FlowWriterDirectOFRpc flowWriterDirectOFRpc;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
doReturn(RpcResultBuilder.success().buildFuture()).when(mockSalFlowService).addFlow(any());
when(mockDataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction);
}
@Test
- public void testRpcFlowAdd() throws Exception {
+ public void testRpcFlowAdd() {
flowWriterDirectOFRpc.rpcFlowAdd("1", FLOWS_PER_DPN, 10);
Mockito.verify(mockSalFlowService, Mockito.times(FLOWS_PER_DPN)).addFlow(Mockito.any());
}
@Test
- public void testRpcFlowAddAll() throws Exception {
+ public void testRpcFlowAddAll() {
flowWriterDirectOFRpc.rpcFlowAddAll(FLOWS_PER_DPN, 10);
Mockito.verify(mockSalFlowService, Mockito.times(FLOWS_PER_DPN)).addFlow(Mockito.any());
}
private FlowWriterSequential flowWriterSequential;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
doReturn(writeTransaction).when(mockDataBroker).newWriteOnlyTransaction();
doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit();
}
@Test
- public void testAddFlows() throws Exception {
+ public void testAddFlows() {
flowWriterSequential.addFlows(1, FLOWS_PER_DPN, 10, 10, (short) 0, (short) 1, true);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.any(),
ArgumentMatchers.any(), ArgumentMatchers.any(),
}
@Test
- public void testDeleteFlows() throws Exception {
+ public void testDeleteFlows() {
flowWriterSequential.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
.delete(ArgumentMatchers.any(),
private FlowWriterTxChain flowWriterTxChain;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
}
@Test
- public void testAddFlows() throws Exception {
+ public void testAddFlows() {
flowWriterTxChain.addFlows(1, FLOWS_PER_DPN, 10, 10, 10, (short) 0, (short) 1, true);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN)).put(ArgumentMatchers.any(),
ArgumentMatchers.any(), ArgumentMatchers.any(),
}
@Test
- public void testDeleteFlows() throws Exception {
+ public void testDeleteFlows() {
flowWriterTxChain.deleteFlows(1, FLOWS_PER_DPN, 10, (short) 0, (short) 1);
Mockito.verify(writeTransaction, Mockito.times(FLOWS_PER_DPN))
.delete(ArgumentMatchers.any(),
private SalBulkFlowServiceImpl salBulkFlowService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(mockDataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
when(mockDataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction);
}
@Test
- public void testAddRemoveFlowsDs() throws Exception {
+ public void testAddRemoveFlowsDs() {
doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit();
final BulkFlowDsItemBuilder bulkFlowDsItemBuilder = new BulkFlowDsItemBuilder().setFlowId(new FlowId("1"))
}
@Test
- public void testAddRemoveFlowsRpc() throws Exception {
+ public void testAddRemoveFlowsRpc() {
Mockito.when(mockSalFlowService.addFlow(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
private TableWriter tableWriter;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
doReturn(writeTransaction).when(mockDataBroker).newWriteOnlyTransaction();
doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit();
}
@Test
- public void testAddTables() throws Exception {
+ public void testAddTables() {
tableWriter.addTables(DPN_COUNT, START_TABLE_ID, END_TABLE_ID);
Mockito.verify(writeTransaction, Mockito.times(TABLES_PER_DPN))
.put(ArgumentMatchers.any(),
}
@Test
- public void testDeleteTables() throws Exception {
+ public void testDeleteTables() {
tableWriter.deleteTables(DPN_COUNT, START_TABLE_ID, END_TABLE_ID);
Mockito.verify(writeTransaction, Mockito.times(TABLES_PER_DPN))
.delete(ArgumentMatchers.any(),
private FrmReconciliationService reconciliationService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
deviceMastershipManager = new DeviceMastershipManager(clusterSingletonService, reconciliationAgent, dataBroker,
mastershipChangeServiceManager, rpcProviderService, reconciliationService);
Mockito.lenient().when(clusterSingletonService
}
@Test
- public void testOnDeviceConnectedAndDisconnected() throws Exception {
+ public void testOnDeviceConnectedAndDisconnected() {
// no context
Assert.assertNull(deviceMastershipManager.getDeviceMasterships().get(deviceInfo.getNodeId()));
deviceMastershipManager.onBecomeOwner(deviceInfo);
private DeviceMastership deviceMastership;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
deviceMastership = new DeviceMastership(NODE_ID);
}
}
@Test
- public void addTwoFlowsTest() throws Exception {
+ public void addTwoFlowsTest() {
addFlowCapableNode(NODE_KEY);
FlowKey flowKey = new FlowKey(new FlowId("test_Flow"));
}
@Test
- public void updateFlowTest() throws Exception {
+ public void updateFlowTest() {
addFlowCapableNode(NODE_KEY);
FlowKey flowKey = new FlowKey(new FlowId("test_Flow"));
}
@Test
- public void updateFlowScopeTest() throws Exception {
+ public void updateFlowScopeTest() {
addFlowCapableNode(NODE_KEY);
FlowKey flowKey = new FlowKey(new FlowId("test_Flow"));
}
@Test
- public void deleteFlowTest() throws Exception {
+ public void deleteFlowTest() {
addFlowCapableNode(NODE_KEY);
FlowKey flowKey = new FlowKey(new FlowId("test_Flow"));
}
@Test
- public void staleMarkedFlowCreationTest() throws Exception {
+ public void staleMarkedFlowCreationTest() {
addFlowCapableNode(NODE_KEY);
}
@Test
- public void addTwoGroupsTest() throws Exception {
+ public void addTwoGroupsTest() {
addFlowCapableNode(NODE_KEY);
GroupKey groupKey = new GroupKey(new GroupId((long) 255));
}
@Test
- public void updateGroupTest() throws Exception {
+ public void updateGroupTest() {
addFlowCapableNode(NODE_KEY);
GroupKey groupKey = new GroupKey(new GroupId((long) 255));
}
@Test
- public void removeGroupTest() throws Exception {
+ public void removeGroupTest() {
addFlowCapableNode(NODE_KEY);
GroupKey groupKey = new GroupKey(new GroupId((long) 255));
}
@Test
- public void staleGroupCreationTest() throws Exception {
+ public void staleGroupCreationTest() {
addFlowCapableNode(NODE_KEY);
StaleGroupKey groupKey = new StaleGroupKey(new GroupId((long) 255));
}
@Test
- public void addTwoMetersTest() throws Exception {
+ public void addTwoMetersTest() {
addFlowCapableNode(NODE_KEY);
MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
}
@Test
- public void updateMeterTest() throws Exception {
+ public void updateMeterTest() {
addFlowCapableNode(NODE_KEY);
MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
}
@Test
- public void removeMeterTest() throws Exception {
+ public void removeMeterTest() {
addFlowCapableNode(NODE_KEY);
MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
}
@Test
- public void staleMeterCreationTest() throws Exception {
+ public void staleMeterCreationTest() {
addFlowCapableNode(NODE_KEY);
StaleMeterKey meterKey = new StaleMeterKey(new MeterId((long) 2000));
.weakValues()
.build(new CacheLoader<K, Semaphore>() {
@Override
- public Semaphore load(final K key) throws Exception {
+ public Semaphore load(final K key) {
return new Semaphore(permits, fair);
}
});
private ClusterSingletonServiceProvider clusterSingletonService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.when(rpcRegistry.getRpcService(ArgumentMatchers.<Class<? extends RpcService>>any()))
.thenAnswer(invocation -> {
Class<? extends RpcService> serviceType =
}
@Test
- public void testInit() throws Exception {
+ public void testInit() {
provider.init();
Mockito.verify(dataBroker, Mockito.times(2)).registerDataTreeChangeListener(
private FlowCapableNode dataAfter;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final DataBroker db = Mockito.mock(DataBroker.class);
final FlowCapableNodeSnapshotDao configSnapshot = new FlowCapableNodeSnapshotDao();
final FlowCapableNodeSnapshotDao operationalSnapshot = new FlowCapableNodeSnapshotDao();
}
@Test
- public void testDSLogicalType() throws Exception {
+ public void testDSLogicalType() {
Assert.assertEquals(LogicalDatastoreType.CONFIGURATION, nodeListenerConfig.dsType());
}
private Node operationalNodeEmpty;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final DataBroker db = Mockito.mock(DataBroker.class);
final FlowCapableNodeSnapshotDao configSnapshot = new FlowCapableNodeSnapshotDao();
final FlowCapableNodeSnapshotDao operationalSnapshot = new FlowCapableNodeSnapshotDao();
}
@Test
- public void testDSLogicalType() throws Exception {
+ public void testDSLogicalType() {
Assert.assertEquals(LogicalDatastoreType.OPERATIONAL, nodeListenerOperational.dsType());
}
}
@Test
- public void testOnDataTreeChangedDeletePhysical() throws Exception {
+ public void testOnDataTreeChangedDeletePhysical() {
Mockito.when(operationalModification.getDataBefore()).thenReturn(operationalNode);
Mockito.when(operationalModification.getDataAfter()).thenReturn(null);
private SyncupEntry syncupEntry;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
reactor = new SyncReactorGuardDecorator(delegate);
InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class)
.child(Node.class, new NodeKey(NODE_ID));
private ArgumentCaptor<SynchronizationDiffInput> syncDiffInputCaptor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
reactor = new SyncReactorImpl(syncPlanPushStrategy);
}
private ClusterSingletonServiceProvider clusterSingletonService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
deviceMastershipManager = new DeviceMastershipManager(clusterSingletonService, new ReconciliationRegistry());
Mockito.when(clusterSingletonService
.registerClusterSingletonService(ArgumentMatchers.any()))
}
@Test
- public void testOnDeviceConnectedAndDisconnected() throws Exception {
+ public void testOnDeviceConnectedAndDisconnected() {
// no context
Assert.assertNull(deviceMastershipManager.getDeviceMasterships().get(NODE_ID));
// create context - register
private ReconciliationRegistry reconciliationRegistry;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
deviceMastership = new DeviceMastership(NODE_ID, reconciliationRegistry,
Mockito.mock(ClusterSingletonServiceProvider.class));
}
@Before
- public void setUp() throws Exception {
+ public void setUp() {
flowForwarder = new FlowForwarder(salFlowService);
}
private GroupForwarder groupForwarder;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
groupForwarder = new GroupForwarder(salGroupService);
txId = new TransactionId(BigInteger.ONE);
}
private MeterForwarder meterForwarder;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
meterForwarder = new MeterForwarder(salMeterService);
txId = new TransactionId(BigInteger.ONE);
}
@Before
- public void setUp() throws Exception {
+ public void setUp() {
syncPlanPushStrategy = new SyncPlanPushStrategyFlatBatchImpl();
syncPlanPushStrategy.setFlatBatchService(flatBatchService);
syncPlanPushStrategy.setTableForwarder(tableForwarder);
}
@Test
- public void testAssembleRemoveFlows() throws Exception {
+ public void testAssembleRemoveFlows() {
final int lastOrder = SyncPlanPushStrategyFlatBatchImpl.assembleRemoveFlows(batchBag, 0, flowsToRemove);
Assert.assertEquals(6, lastOrder);
}
@Test
- public void testAssembleAddOrUpdateGroups() throws Exception {
+ public void testAssembleAddOrUpdateGroups() {
final int lastOrder = SyncPlanPushStrategyFlatBatchImpl.assembleAddOrUpdateGroups(
batchBag, 0, groupsToAddOrUpdate);
}
@Test
- public void testAssembleRemoveGroups() throws Exception {
+ public void testAssembleRemoveGroups() {
final int lastOrder = SyncPlanPushStrategyFlatBatchImpl.assembleRemoveGroups(batchBag, 0, groupsToRemove);
Assert.assertEquals(6, lastOrder);
}
@Test
- public void testAssembleAddOrUpdateMeters() throws Exception {
+ public void testAssembleAddOrUpdateMeters() {
final int lastOrder = SyncPlanPushStrategyFlatBatchImpl.assembleAddOrUpdateMeters(
batchBag, 0, metersToAddOrUpdate);
}
@Test
- public void testAssembleRemoveMeters() throws Exception {
+ public void testAssembleRemoveMeters() {
final int lastOrder = SyncPlanPushStrategyFlatBatchImpl.assembleRemoveMeters(batchBag, 0, metersToRemove);
Assert.assertEquals(3, lastOrder);
}
@Test
- public void testAssembleAddOrUpdateFlows() throws Exception {
+ public void testAssembleAddOrUpdateFlows() {
final int lastOrder = SyncPlanPushStrategyFlatBatchImpl.assembleAddOrUpdateFlows(
batchBag, 0, flowsToAddOrUpdate);
}
@Test
- public void testDecrementCounters() throws Exception {
+ public void testDecrementCounters() {
final SyncCrudCounters counters = new SyncCrudCounters();
counters.getFlowCrudCounts().setAdded(100);
counters.getFlowCrudCounts().setUpdated(100);
}
@Test
- public void testMapBatchesToRanges() throws Exception {
+ public void testMapBatchesToRanges() {
final List<Batch> inputBatchBag = Lists.newArrayList(
new BatchBuilder().setBatchOrder(0).build(),
new BatchBuilder().setBatchOrder(5).build(),
}
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.when(flowCapableTxService.sendBarrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success((SendBarrierOutput) null).buildFuture());
@Before
- public void setUp() throws Exception {
+ public void setUp() {
tableForwarder = new TableForwarder(salTableService);
txId = new TransactionId(BigInteger.ONE);
}
* add one missing group.
*/
@Test
- public void testResolveAndDivideGroupDiffs1() throws Exception {
+ public void testResolveAndDivideGroupDiffs1() {
final Map<Long, Group> installedGroups = new HashMap<>();
installedGroups.put(1L, createGroup(1L));
installedGroups.put(2L, createGroup(2L));
* add 3 groups with dependencies - 3 steps involved.
*/
@Test
- public void testResolveAndDivideGroupDiffs2() throws Exception {
+ public void testResolveAndDivideGroupDiffs2() {
final Map<Long, Group> installedGroups = new HashMap<>();
installedGroups.put(1L, createGroup(1L));
* no actions taken - installed and pending groups are the same.
*/
@Test
- public void testResolveAndDivideGroupDiffs3() throws Exception {
+ public void testResolveAndDivideGroupDiffs3() {
final Map<Long, Group> installedGroups = new HashMap<>();
installedGroups.put(1L, createGroup(1L));
installedGroups.put(2L, createGroupWithPreconditions(2L, 1L));
* update 1 group.
*/
@Test
- public void testResolveAndDivideGroupDiffs4() throws Exception {
+ public void testResolveAndDivideGroupDiffs4() {
final Map<Long, Group> installedGroups = new HashMap<>();
installedGroups.put(1L, createGroup(1L));
installedGroups.put(2L, createGroup(2L));
* no action taken - update 1 group will be ignored.
*/
@Test
- public void testResolveAndDivideGroupDiffs5() throws Exception {
+ public void testResolveAndDivideGroupDiffs5() {
final Map<Long, Group> installedGroups = new HashMap<>();
installedGroups.put(1L, createGroup(1L));
installedGroups.put(2L, createGroup(2L));
* should add 1 group but preconditions are not met.
*/
@Test
- public void testResolveAndDivideGroupDiffs_negative1() throws Exception {
+ public void testResolveAndDivideGroupDiffs_negative1() {
final Map<Long, Group> installedGroups = new HashMap<>();
installedGroups.put(1L, createGroup(1L));
installedGroups.put(2L, createGroup(2L));
* should update 1 group but preconditions are not met.
*/
@Test
- public void testResolveAndDivideGroupDiffs_negative2() throws Exception {
+ public void testResolveAndDivideGroupDiffs_negative2() {
final Map<Long, Group> installedGroups = new HashMap<>();
installedGroups.put(1L, createGroup(1L));
installedGroups.put(2L, createGroup(2L));
}
@Test
- public void testCheckGroupPrecondition() throws Exception {
+ public void testCheckGroupPrecondition() {
final Set<Long> installedGroups = new HashSet<>(Arrays.asList(new Long[]{1L, 2L}));
final Group pendingGroup1 = createGroupWithPreconditions(3L, 2L, 4L);
* covers {@link ReconcileUtil#countTotalUpdated(Iterable)} too.
*/
@Test
- public void testCountTotalAdds() throws Exception {
+ public void testCountTotalAdds() {
List<ItemSyncBox<String>> syncPlan = new ArrayList<>();
ItemSyncBox<String> syncBox1 = createSyncBox("a,b", "x,y,z");
syncPlan.add(syncBox1);
private ReconciliationRegistry reconciliationRegistry;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
reconciliationRegistry = new ReconciliationRegistry();
}
private final String key = "11";
@Before
- public void setUp() throws Exception {
+ public void setUp() {
semaphoreKeeper = new SemaphoreKeeperGuavaImpl<>(1, true);
}
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import java.security.NoSuchAlgorithmException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;
.setEgress(new NodeConnectorRef(nodeConnectorInstanceId))
.setNode(new NodeRef(nodeInstanceId)).setPayload(LLDPUtil.buildLldpFrame(nodeId,
nodeConnectorId, srcMacAddress, outputPortNo, addressDestination)).build();
- } catch (NoSuchAlgorithmException | PacketException e) {
+ } catch (PacketException e) {
LOG.error("Error building LLDP frame", e);
return;
}
import com.google.common.base.Strings;
import java.math.BigInteger;
-import java.security.NoSuchAlgorithmException;
import javax.annotation.Nonnull;
import org.opendaylight.openflowplugin.libraries.liblldp.EtherTypes;
import org.opendaylight.openflowplugin.libraries.liblldp.Ethernet;
@Nonnull
static byte[] buildLldpFrame(final NodeId nodeId, final NodeConnectorId nodeConnectorId, final MacAddress src,
final Long outPortNo, final MacAddress destinationAddress)
- throws NoSuchAlgorithmException, PacketException {
+ throws PacketException {
// Create discovery pkt
LLDP discoveryPkt = new LLDP();
@Nonnull
static byte[] buildLldpFrame(final NodeId nodeId, final NodeConnectorId nodeConnectorId,
- final MacAddress srcMacAddress, final Long outputPortNo) throws NoSuchAlgorithmException, PacketException {
+ final MacAddress srcMacAddress, final Long outputPortNo) throws PacketException {
return buildLldpFrame(nodeId, nodeConnectorId, srcMacAddress, outputPortNo, null);
}
* observers are registered for notifications.
*/
@Test
- public void testMultipleObserversNotified() throws Exception {
+ public void testMultipleObserversNotified() {
// Create prerequisites
InstanceIdentifier<NodeConnector> id2 = TestUtils.createNodeConnectorId("openflow:1", "openflow:1:2");
InstanceIdentifier<FlowCapableNodeConnector> iiToConnector2 = id2.augmentation(FlowCapableNodeConnector.class);
}
@Test
- public void tearDown() throws Exception {
+ public void tearDown() {
translator.close();
}
}
@Override
- public void close() throws Exception {
+ public void close() {
if (listenerRegistration != null) {
listenerRegistration.close();
listenerRegistration = null;
private ArgumentCaptor<SetConfigInput> setConfigInputCaptor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
doReturn(RpcResultBuilder.success().buildFuture()).when(nodeConfigService).setConfig(any());
defaultConfigPusher = new DefaultConfigPusher(nodeConfigService, Mockito.mock(DataBroker.class),
deviceOwnershipService);
}
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
LOG.debug("Executing getRegisteredServices to Reconciliation Framework command");
if (reconciliationManager.getRegisteredServices().isEmpty()) {
session.getConsole().println("No Services have registered to Reconciliation Framework");
@Override
@PreDestroy
- public void close() throws Exception {
+ public void close() {
}
@Override
}
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
List<OFNode> ofNodeList = ShellUtil.getAllNodes(dataBroker);
if (ofNodeList.isEmpty()) {
session.getConsole().println("No node is connected yet");
}
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
List<ReconcileCounter> result = ShellUtil.getReconcileCount(dataBroker);
if (result.isEmpty()) {
session.getConsole().println("Reconciliation count not yet available for openflow nodes.");
}
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
if (nodeId == null) {
session.getConsole().println("NodeID not specified");
return null;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
-import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import org.opendaylight.mdsal.eos.common.api.EntityOwnershipState;
import org.opendaylight.openflowplugin.applications.topology.lldp.LLDPActivator;
-import org.opendaylight.openflowplugin.libraries.liblldp.BufferException;
import org.opendaylight.openflowplugin.libraries.liblldp.Ethernet;
import org.opendaylight.openflowplugin.libraries.liblldp.LLDP;
import org.opendaylight.openflowplugin.libraries.liblldp.LLDPTLV;
* @param nodeConnectorId the NodeConnectorId
* @return extra authenticator for lldp security
*/
- public static byte[] getValueForLLDPPacketIntegrityEnsuring(final NodeConnectorId nodeConnectorId)
- throws NoSuchAlgorithmException {
+ public static byte[] getValueForLLDPPacketIntegrityEnsuring(final NodeConnectorId nodeConnectorId) {
String finalKey;
if (LLDPActivator.getLldpSecureKey() != null && !LLDPActivator.getLldpSecureKey().isEmpty()) {
finalKey = LLDPActivator.getLldpSecureKey();
return hashedValue.asBytes();
}
- private static boolean checkExtraAuthenticator(LLDP lldp, NodeConnectorId srcNodeConnectorId)
- throws NoSuchAlgorithmException, BufferException {
+ private static boolean checkExtraAuthenticator(LLDP lldp, NodeConnectorId srcNodeConnectorId) {
final LLDPTLV hashLldptlv = lldp.getCustomTLV(LLDPTLV.createSecSubTypeCustomTLVKey());
boolean secAuthenticatorOk = false;
if (hashLldptlv != null) {
private LinkRemoved linkRemoved;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
lldpLinkAger = new LLDPLinkAger(getConfig(), notificationService, getConfigurationService(), eos);
Mockito.when(link.getDestination()).thenReturn(new NodeConnectorRef(
InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(new NodeId("openflow:1")))));
private static final Logger LOG = LoggerFactory.getLogger(LLDPDiscoveryUtilsTest.class);
@Test
- public void testLldpToNodeConnectorRefLLDP() throws Exception {
+ public void testLldpToNodeConnectorRefLLDP() {
byte[] packetLLDP = {
0x01, 0x23, 0x00, 0x00, 0x00, 0x01, (byte) 0x8a, (byte) 0x8e,
(byte) 0xcc, (byte) 0x85, (byte) 0xeb, 0x27,
}
@Test
- public void testLldpToNodeConnectorRefNotLLDP() throws Exception {
+ public void testLldpToNodeConnectorRefNotLLDP() {
byte[] packetNotLLDP = {
0x01, 0x23, 0x00, 0x00, 0x00, 0x01, (byte) 0x8a, (byte) 0x8e,
(byte) 0xcc, (byte) 0x85, (byte) 0xeb, 0x27,
}
@Override
- public void close() throws Exception {
+ public void close() {
listenerRegistration.close();
}
@Override
@PreDestroy
- public void close() throws Exception {
+ public void close() {
super.close();
}
@Override
@PreDestroy
- public void close() throws Exception {
+ public void close() {
super.close();
}
public class ClearDropStatsCommandProvider extends OsgiCommandSupport {
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
final DropTestRpcProvider rpcProvider = DropTestProviderImpl.getDropRpcProvider();
final DropTestDsProvider provider = DropTestProviderImpl.getDropDsProvider();
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
final DropTestDsProvider provider = DropTestProviderImpl.getDropDsProvider();
String targetStateArg;
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
final DropTestRpcProvider provider = DropTestProviderImpl.getDropRpcProvider();
}
@Override
- public void close() throws Exception {
+ public void close() {
dropDsProvider.close();
dropRpcProvider.close();
}
public class ShowDropStatsCommandProvider extends OsgiCommandSupport {
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
final DropTestRpcProvider rpcProvider = DropTestProviderImpl.getDropRpcProvider();
final DropTestDsProvider provider = DropTestProviderImpl.getDropDsProvider();
}
@Override
- public void close() throws Exception {
+ public void close() {
// TODO Auto-generated method stub
}
}
@Override
- public void close() throws Exception {
+ public void close() {
registrator.unregisterActionDeserializer(RegLoadCodec.DESERIALIZER_KEY);
registrator.unregisterActionSerializer(RegLoadCodec.SERIALIZER_KEY);
registrator.unregisterActionDeserializer(RegLoad2Codec.DESERIALIZER_KEY);
}
@Test
- public void unregisterExtensionsTest() throws Exception {
+ public void unregisterExtensionsTest() {
niciraExtensionsRegistrator.close();
Mockito.verify(registrator)
*/
package org.opendaylight.openflowplugin.extension.api;
-import org.opendaylight.openflowplugin.extension.api.exception.ConversionException;
import org.opendaylight.openflowplugin.extension.api.path.AugmentationPath;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.experimenter.core.message.ExperimenterMessageOfChoice;
import org.opendaylight.yangtools.yang.binding.DataContainer;
* @param path in yang schema where a converted value has to be augmented
* @return message converted to MD-SAL and its type
*/
- ExperimenterMessageOfChoice convert(F input, P path) throws ConversionException;
+ ExperimenterMessageOfChoice convert(F input, P path);
}
private NiciraExtensionProvider niciraExtensionProvider;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.when(openFlowPluginExtensionRegistratorProvider.getExtensionConverterRegistrator())
.thenReturn(extensionConverterRegistrator);
niciraExtensionProvider = new NiciraExtensionProvider(openFlowPluginExtensionRegistratorProvider);
}
@Test
- public void testRegisterConverters() throws Exception {
+ public void testRegisterConverters() {
Mockito.verify(extensionConverterRegistrator, Mockito.atLeastOnce()).registerActionConvertor(
ArgumentMatchers.<TypeVersionKey<? extends Action>>any(),
ArgumentMatchers.<ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
- .common.action.rev150203.actions.grouping.Action>>any());
+ .common.action.rev150203.actions.grouping.Action>>any());
}
}
private ConntrackConvertor conntrackConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
conntrackConvertor = new ConntrackConvertor();
}
@Test
- public void testConvertToOfJava() throws Exception {
+ public void testConvertToOfJava() {
final NxActionNatBuilder nxActionNatBuilder = new NxActionNatBuilder()
.setFlags(1)
}
@Test
- public void testConvertFromOfJava() throws Exception {
+ public void testConvertFromOfJava() {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions
.nx.action.nat._case.NxActionNatBuilder nxActionNatBuilder = new org.opendaylight.yang.gen.v1.urn
private CtClearConvertor ctClearConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxCtClear nxCtClear = Mockito.mock(NxCtClear.class);
final ActionCtClear actionCtClear = Mockito.mock(ActionCtClear.class);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final ActionCtClear actionCtClear = (ActionCtClear) ctClearConvertor.convert(actionsCase).getActionChoice();
Assert.assertNotNull(actionCtClear);
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
= ctClearConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
Assert.assertNotNull(actionResult);
private DecNshTtlConvertor decNshTtlConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxDecNshTtl nxDecNshTtl = Mockito.mock(NxDecNshTtl.class);
NxActionDecNshTtl nxActionDecNshTtl = Mockito.mock(NxActionDecNshTtl.class);
private DecapConvertor decapConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxDecap nxDecap = Mockito.mock(NxDecap.class);
when(nxDecap.getPacketType()).thenReturn(PACKET_TYPE);
when(actionsCase.getNxDecap()).thenReturn(nxDecap);
private EncapConvertor encapConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxEncap nxEncap = Mockito.mock(NxEncap.class);
when(nxEncap.getPacketType()).thenReturn(PACKET_TYPE);
when(actionsCase.getNxEncap()).thenReturn(nxEncap);
private FinTimeoutConvertor finTimeoutConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action
.fin.timeout.grouping.NxActionFinTimeout nxFinTimeout = Mockito.mock(org.opendaylight.yang.gen.v1.urn
.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.fin.timeout.grouping
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final ActionFinTimeout actionFinTimeout =
(ActionFinTimeout) finTimeoutConvertor.convert(actionsCase).getActionChoice();
Assert.assertEquals(1, actionFinTimeout.getNxActionFinTimeout().getFinIdleTimeout().intValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult =
finTimeoutConvertor.convert(action,
ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
private MultipathConvertor multipathConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxMultipath nxMultipath = Mockito.mock(NxMultipath.class);
when(bucketActionsCase.getNxMultipath()).thenReturn(nxMultipath);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final ActionMultipath actionMultipath =
(ActionMultipath) multipathConvertor.convert(bucketActionsCase).getActionChoice();
Assert.assertEquals(OfjNxHashFields.NXHASHFIELDSETHSRC, actionMultipath.getNxActionMultipath().getFields());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
= multipathConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
private OutputReg2Convertor outputReg2Convertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxOutputReg nxOutputReg = Mockito.mock(NxOutputReg.class);
final Src src = Mockito.mock(Src.class);
private OutputRegConvertor outputRegConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxOutputReg nxOutputReg = Mockito.mock(NxOutputReg.class);
final Src src = Mockito.mock(Src.class);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final ActionOutputReg actionOutputReg =
(ActionOutputReg) outputRegConvertor.convert(actionsCase).getActionChoice();
Assert.assertEquals(Integer.valueOf(1), actionOutputReg.getNxActionOutputReg().getNBits());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
= outputRegConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
private RegLoadConvertor regLoadConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxRegLoad nxRegLoad = Mockito.mock(NxRegLoad.class);
final Dst dst = Mockito.mock(Dst.class);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final ActionRegLoad actionRegLoad = (ActionRegLoad)regLoadConvertor.convert(actionsCase).getActionChoice();
Assert.assertEquals(Integer.valueOf(65), actionRegLoad.getNxActionRegLoad().getOfsNbits());
Assert.assertEquals(BigInteger.valueOf(3), actionRegLoad.getNxActionRegLoad().getValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
= regLoadConvertor.convert(action, ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final Src src = Mockito.mock(Src.class);
final Dst dst = Mockito.mock(Dst.class);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final ActionRegMove actionRegMove = (ActionRegMove) regMoveConvertor.convert(actionsCase).getActionChoice();
Assert.assertEquals(Integer.valueOf(3) ,actionRegMove.getNxActionRegMove().getDstOfs());
Assert.assertEquals(Integer.valueOf(2) ,actionRegMove.getNxActionRegMove().getNBits());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
= regMoveConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
private ResubmitConvertor resubmitConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxResubmit nxResubmit = Mockito.mock(NxResubmit.class);
when(actionsCase.getNxResubmit()).thenReturn(nxResubmit);
when(nxResubmit.getInPort()).thenReturn(1);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final ActionResubmit actionResubmit = (ActionResubmit) resubmitConvertor.convert(actionsCase).getActionChoice();
Assert.assertEquals(1, actionResubmit.getNxActionResubmit().getInPort().intValue());
Assert.assertEquals(2, actionResubmit.getNxActionResubmit().getTable().intValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
= resubmitConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
private ArpOpConvertor arpOpConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
arpOpConvertor = new ArpOpConvertor();
}
@Test
- public void testConvertToOFJava() throws Exception {
+ public void testConvertToOFJava() {
final NxmOfArpOpBuilder nxmOfArpOpBuilder = new NxmOfArpOpBuilder()
.setValue(2);
final NxAugMatchRpcAddFlowBuilder nxAugMatchRpcAddFlowBuilder = new NxAugMatchRpcAddFlowBuilder();
}
@Test
- public void testConvertFromOFJava() throws Exception {
+ public void testConvertFromOFJava() {
final ArpOpBuilder arpOpBuilder = new ArpOpBuilder()
.setOpCode(2);
final ArpOpCaseBuilder arpOpCaseBuilder = new ArpOpCaseBuilder()
private static final Logger LOG = LoggerFactory.getLogger(ArpShaConvertorTest.class);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmNxArpShaBuilder nxmNxArpShaBuilder = new NxmNxArpShaBuilder()
.setMacAddress(MAC_ADDRESS);
final NxAugMatchRpcAddFlowBuilder nxAugMatchRpcAddFlowBuilder = new NxAugMatchRpcAddFlowBuilder()
}
@Test
- public void testConvertToOFJava() throws Exception {
+ public void testConvertToOFJava() {
final MatchEntry converted = arpShaConvertor.convert(extension);
Assert.assertEquals(MAC_ADDRESS.getValue(),
((ArpShaCaseValue) converted.getMatchEntryValue()).getArpShaValues().getMacAddress().getValue());
}
@Test
- public void testConvertFromOFJava() throws Exception {
+ public void testConvertFromOFJava() {
final ArpShaValuesBuilder arpShaValuesBuilder = new ArpShaValuesBuilder()
.setMacAddress(MAC_ADDRESS);
final ArpShaCaseValueBuilder arpShaCaseValueBuilder = new ArpShaCaseValueBuilder()
private ArpSpaConvertor arpSpaConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
arpSpaConvertor = new ArpSpaConvertor();
}
@Test
- public void testConvertToOFJava() throws Exception {
+ public void testConvertToOFJava() {
final NxmOfArpSpaBuilder nxmOfArpSpaBuilder = new NxmOfArpSpaBuilder()
.setIpv4Address(IPV4_ADDRESS);
final NxAugMatchRpcAddFlowBuilder nxAugMatchRpcAddFlowBuilder = new NxAugMatchRpcAddFlowBuilder();
}
@Test
- public void testConvertFromOFJava() throws Exception {
+ public void testConvertFromOFJava() {
final ArpSpaValuesBuilder arpSpaValuesBuilder = new ArpSpaValuesBuilder()
.setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
final ArpSpaCaseValueBuilder arpSpaCaseValueBuilder = new ArpSpaCaseValueBuilder()
private ArpThaConvertor arpThaConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmNxArpThaBuilder nxArpThaBuilder = new NxmNxArpThaBuilder()
.setMacAddress(MAC_ADDRESS);
}
@Test
- public void testConvertToOFJava() throws Exception {
+ public void testConvertToOFJava() {
final MatchEntry converted = arpThaConvertor.convert(extension);
Assert.assertEquals(MAC_ADDRESS.getValue(),
((ArpThaCaseValue) converted.getMatchEntryValue()).getArpThaValues().getMacAddress().getValue());
}
@Test
- public void testConvertFromOFJava() throws Exception {
+ public void testConvertFromOFJava() {
final ArpThaValuesBuilder arpThaValuesBuilder = new ArpThaValuesBuilder()
.setMacAddress(MAC_ADDRESS);
final ArpThaCaseValueBuilder arpThaCaseValueBuilder = new ArpThaCaseValueBuilder()
private ArpTpaConvertor arpTpaConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmOfArpTpaBuilder nxmOfArpTpaBuilder = new NxmOfArpTpaBuilder()
.setIpv4Address(IPV4_ADDRESS);
}
@Test
- public void testConvertFromOFJava() throws Exception {
+ public void testConvertFromOFJava() {
final MatchEntry converted = arpTpaConvertor.convert(extension);
Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS),
((ArpTpaCaseValue)converted.getMatchEntryValue()).getArpTpaValues().getValue().longValue());
}
@Test
- public void testConvertToOFJava() throws Exception {
+ public void testConvertToOFJava() {
final ArpTpaValuesBuilder arpTpaValuesBuilder = new ArpTpaValuesBuilder()
.setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
final ArpTpaCaseValueBuilder arpTpaCaseValueBuilder = new ArpTpaCaseValueBuilder()
private CtStateConvertor ctStateConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmNxCtStateBuilder nxmNxCtStateBuilder = new NxmNxCtStateBuilder()
.setCtState(1L)
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = ctStateConvertor.convert(extension);
Assert.assertEquals(1L,
((CtStateCaseValue) converted.getMatchEntryValue()).getCtStateValues().getCtState().longValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final CtStateValuesBuilder ctStateValuesBuilder = new CtStateValuesBuilder()
.setCtState(3L)
private CtZoneConvertor ctZoneConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmNxCtZoneBuilder nxmNxCtZoneBuilder = new NxmNxCtZoneBuilder()
.setCtZone(1);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = ctZoneConvertor.convert(extension);
Assert.assertEquals(1L,
((CtZoneCaseValue) converted.getMatchEntryValue()).getCtZoneValues().getCtZone().longValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final CtZoneValuesBuilder ctZoneValuesBuilder = new CtZoneValuesBuilder()
.setCtZone(2);
final CtZoneCaseValueBuilder ctZoneCaseValueBuilder = new CtZoneCaseValueBuilder()
private EthDstConvertor ethDstConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmOfEthDstBuilder nxmOfEthDstBuilder = new NxmOfEthDstBuilder()
.setMacAddress(MAC_ADDRESS);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = ethDstConvertor.convert(extension);
Assert.assertEquals(MAC_ADDRESS, ((EthDstCaseValue)converted.getMatchEntryValue())
.getEthDstValues().getMacAddress());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final EthDstValuesBuilder ethDstValuesBuilder = new EthDstValuesBuilder()
.setMacAddress(MAC_ADDRESS);
final EthDstCaseValueBuilder ethDstCaseValueBuilder = new EthDstCaseValueBuilder()
private EthSrcConvertor ethSrcConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmOfEthSrcBuilder nxmOfEthSrcBuilder = new NxmOfEthSrcBuilder()
.setMacAddress(MAC_ADDRESS);
final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = ethSrcConvertor.convert(extension);
Assert.assertEquals(MAC_ADDRESS, ((EthSrcCaseValue)converted.getMatchEntryValue())
.getEthSrcValues().getMacAddress());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final EthSrcValuesBuilder ethSrcValuesBuilder = new EthSrcValuesBuilder()
.setMacAddress(MAC_ADDRESS);
final EthSrcCaseValueBuilder ethSrcCaseValueBuilder = new EthSrcCaseValueBuilder()
private EthTypeConvertor ethTypeConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmOfEthTypeBuilder nxmOfEthTypeBuilder = new NxmOfEthTypeBuilder()
.setValue(1);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = ethTypeConvertor.convert(extension);
Assert.assertEquals(1, ((EthTypeCaseValue)converted.getMatchEntryValue())
.getEthTypeValues().getValue().intValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final EthTypeValuesBuilder ethTypeValuesBuilder = new EthTypeValuesBuilder()
.setValue(Integer.valueOf(1));
final EthTypeCaseValueBuilder ethTypeCaseValueBuilder = new EthTypeCaseValueBuilder()
private static final Short MASK_VALUE = (short) 0xFF;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNshFlags nxmNxNshFlags = new NxmNxNshFlagsBuilder()
.setNshFlags(FLAGS_VALUE)
.setMask(MASK_VALUE)
private static final Short MDTYPE_VALUE = (short) 0x7B;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNshMdtype nxmNxNshMdtype = new NxmNxNshMdtypeBuilder()
.setValue(MDTYPE_VALUE)
.build();
private static final Short NP_VALUE = (short) 0x7B;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNshNp nxmNxNshNp = new NxmNxNshNpBuilder()
.setValue(NP_VALUE)
.build();
private static final Short TTL_VALUE = (short) 0x13;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNshTtl nxmNxNshTtl = new NxmNxNshTtlBuilder()
.setNshTtl(TTL_VALUE)
.build();
private static final Long MASK_VALUE = 0xFFFFFFFFL;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNshc1 nxmNxNshc1 = new NxmNxNshc1Builder().setValue(NSHC1_VALUE).setMask(MASK_VALUE).build();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc1(nxmNxNshc1)
private static final Long MASK_VALUE = 0xFFFFFFFFL;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNshc2 nxmNxNshc2 = new NxmNxNshc2Builder().setValue(NSHC2_VALUE).setMask(MASK_VALUE).build();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc2(nxmNxNshc2)
private static final Long MASK_VALUE = 0xFFFFFFFFL;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNshc3 nxmNxNshc3 = new NxmNxNshc3Builder().setValue(NSHC3_VALUE).setMask(MASK_VALUE).build();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc3(nxmNxNshc3)
private static final Long MASK_VALUE = 0xFFFFFFFFL;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNshc4 nxmNxNshc4 = new NxmNxNshc4Builder().setValue(NSHC4_VALUE).setMask(MASK_VALUE).build();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNshc4(nxmNxNshc4)
private static final Short NSI_VALUE = (short) 255;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNsi nxmNxNsi = new NxmNxNsiBuilder().setNsi(NSI_VALUE).build();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNsi(nxmNxNsi)
private static final Long NSP_VALUE = 0xFFL;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
NxmNxNsp nxmNxNsp = new NxmNxNspBuilder().setValue(NSP_VALUE).build();
NxAugMatchNodesNodeTableFlow nxAugMatchNotifUpdateFlowStats = new NxAugMatchNodesNodeTableFlowBuilder()
.setNxmNxNsp(nxmNxNsp)
private TcpDstConvertor tcpDstConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmOfTcpDstBuilder nxmOfTcpDstBuilder = new NxmOfTcpDstBuilder()
.setMask(1)
.setPort(DEFAULT_PORT);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = tcpDstConvertor.convert(extension);
Assert.assertEquals(1,
((TcpDstCaseValue) converted.getMatchEntryValue()).getTcpDstValues().getMask().intValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final TcpDstValuesBuilder tcpDstValuesBuilder = new TcpDstValuesBuilder()
.setMask(2)
.setPort(DEFAULT_PORT);
private TcpSrcConvertor tcpSrcConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmOfTcpSrcBuilder nxmOfTcpSrcBuilder = new NxmOfTcpSrcBuilder()
.setMask(1)
.setPort(DEFAULT_PORT);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = tcpSrcConvertor.convert(extension);
Assert.assertEquals(1,
((TcpSrcCaseValue) converted.getMatchEntryValue()).getTcpSrcValues().getMask().intValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final TcpSrcValuesBuilder tcpSrcValuesBuilder = new TcpSrcValuesBuilder()
.setMask(2)
.setPort(DEFAULT_PORT);
private TunIPv4DstConvertor tunIPv4DstConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmNxTunIpv4DstBuilder nxmNxTunIpv4DstBuilder = new NxmNxTunIpv4DstBuilder()
.setIpv4Address(IPV4_ADDRESS);
final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = tunIPv4DstConvertor.convert(extension);
Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS),
((TunIpv4DstCaseValue)converted.getMatchEntryValue()).getTunIpv4DstValues().getValue().longValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final TunIpv4DstValuesBuilder tunIpv4DstValuesBuilder = new TunIpv4DstValuesBuilder()
.setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
final TunIpv4DstCaseValueBuilder tunIpv4DstCaseValueBuilder = new TunIpv4DstCaseValueBuilder()
private TunIPv4SrcConvertor tunIPv4DstConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmNxTunIpv4SrcBuilder nxmNxTunIpv4SrcBuilder = new NxmNxTunIpv4SrcBuilder()
.setIpv4Address(IPV4_ADDRESS);
final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = tunIPv4DstConvertor.convert(extension);
Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS),
((TunIpv4SrcCaseValue) converted.getMatchEntryValue()).getTunIpv4SrcValues().getValue().longValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final TunIpv4SrcValuesBuilder tunIpv4SrcValuesBuilder = new TunIpv4SrcValuesBuilder()
.setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
final TunIpv4SrcCaseValueBuilder tunIpv4SrcCaseValueBuilder = new TunIpv4SrcCaseValueBuilder()
private TunIdConvertor tunIdConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmNxTunIdBuilder nxmNxTunIdBuilder = new NxmNxTunIdBuilder()
.setValue(BigInteger.ONE);
final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = tunIdConvertor.convert(extension);
Assert.assertEquals(BigInteger.ONE, ((TunIdCaseValue)converted.getMatchEntryValue())
.getTunIdValues().getValue());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final TunIdValuesBuilder tunIdValuesBuilder = new TunIdValuesBuilder()
.setValue(BigInteger.TEN);
final TunIdCaseValueBuilder tunIdCaseValueBuilder = new TunIdCaseValueBuilder()
private UdpDstConvertor udpDstConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmOfUdpDstBuilder nxmOfUdpDstBuilder = new NxmOfUdpDstBuilder()
.setMask(1)
.setPort(DEFAULT_PORT);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = udpDstConvertor.convert(extension);
Assert.assertEquals(Integer.valueOf(1),
((UdpDstCaseValue) converted.getMatchEntryValue()).getUdpDstValues().getMask());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final UdpDstValuesBuilder udpDstValuesBuilder = new UdpDstValuesBuilder()
.setMask(2)
.setPort(DEFAULT_PORT);
private UdpSrcConvertor udpSrcConvertor;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final NxmOfUdpSrcBuilder nxmOfUdpSrcBuilder = new NxmOfUdpSrcBuilder()
.setMask(1)
.setPort(DEFAULT_PORT);
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final MatchEntry converted = udpSrcConvertor.convert(extension);
Assert.assertEquals(Integer.valueOf(1),
((UdpSrcCaseValue) converted.getMatchEntryValue()).getUdpSrcValues().getMask());
}
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final UdpSrcValuesBuilder udpSrcValuesBuilder = new UdpSrcValuesBuilder()
.setMask(2)
.setPort(DEFAULT_PORT);
}
@Override
- public BundleAddMessageSal convert(final BundleAddMessageOnf input, final MessagePath path)
- throws ConversionException {
+ public BundleAddMessageSal convert(final BundleAddMessageOnf input, final MessagePath path) {
return new BundleAddMessageSalBuilder()
.setSalAddMessageData(new SalAddMessageDataBuilder(input.getOnfAddMessageGroupingData())
.build())
import org.opendaylight.openflowplugin.extension.api.ConverterMessageToOFJava;
import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
import org.opendaylight.openflowplugin.extension.api.ExtensionConvertorData;
-import org.opendaylight.openflowplugin.extension.api.exception.ConversionException;
import org.opendaylight.openflowplugin.extension.api.path.MessagePath;
import org.opendaylight.openflowplugin.extension.onf.OnfConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
ConvertorMessageFromOFJava<BundleControlOnf, MessagePath> {
@Override
- public BundleControlOnf convert(final BundleControlSal experimenterMessageCase, final ExtensionConvertorData data)
- throws ConversionException {
+ public BundleControlOnf convert(final BundleControlSal experimenterMessageCase, final ExtensionConvertorData data) {
return new BundleControlOnfBuilder().setOnfControlGroupingData(
new OnfControlGroupingDataBuilder(experimenterMessageCase.getSalControlData()).build()).build();
}
private OnfExtensionProvider onfExtensionProvider;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito
.when(openFlowPluginExtensionRegistratorProvider.getExtensionConverterRegistrator())
.thenReturn(extensionConverterRegistrator);
}
@Test
- public void init() throws Exception {
+ public void init() {
onfExtensionProvider.init();
Mockito.verify(switchConnectionProvider, Mockito.times(2))
.registerExperimenterMessageSerializer(Mockito.any(), Mockito.any());
private static final GroupId GROUP_ID = new GroupId(1L);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
}
@Test
}
@Test
- public void testConvertDownWithProperty() throws Exception {
+ public void testConvertDownWithProperty() {
testConvertDown(true);
}
@Test
- public void testConvertDownWithoutProperty() throws Exception {
+ public void testConvertDownWithoutProperty() {
testConvertDown(false);
}
testConvertUp(true);
}
- private void testConvertDown(final boolean withProperty) throws Exception {
+ private void testConvertDown(final boolean withProperty) {
final BundleControlSal original = createOFPMessage(withProperty);
final BundleControlOnf converted = converter.convert(original, null);
testConvert(original, converted, withProperty);
return BitBufferHelper.getByte(ArrayUtils.subarray(value, 3, 4));
}
- public static CustomTLVKey createPortSubTypeCustomTLVKey() throws BufferException {
+ public static CustomTLVKey createPortSubTypeCustomTLVKey() {
return new CustomTLVKey(BitBufferHelper.getInt(OFOUI), CUSTOM_TLV_SUB_TYPE_NODE_CONNECTOR_ID[0]);
}
- public static CustomTLVKey createSecSubTypeCustomTLVKey() throws BufferException {
+ public static CustomTLVKey createSecSubTypeCustomTLVKey() {
return new CustomTLVKey(BitBufferHelper.getInt(LLDPTLV.OFOUI), LLDPTLV.CUSTOM_TLV_SUB_TYPE_CUSTOM_SEC[0]);
}
}
* {@link org.opendaylight.openflowplugin.libraries.liblldp.LLDPTLV#getCustomString(byte[], int)}.
*/
@Test
- public void testGetCustomString() throws Exception {
+ public void testGetCustomString() {
byte[] inputCustomTlv = Bytes.concat(new byte[] {
// custom type (7b) + length (9b) = 16b = 2B (skipped)
// 0x7f, 24,
}
@Override
- protected void readTimedOut(final ChannelHandlerContext ctx) throws Exception {
+ protected void readTimedOut(final ChannelHandlerContext ctx) {
if (first) {
LOG.debug("Switch idle");
SwitchIdleEventBuilder builder = new SwitchIdleEventBuilder();
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
- public void channelRead0(final ChannelHandlerContext ctx, final VersionMessageUdpWrapper msg)
- throws Exception {
+ public void channelRead0(final ChannelHandlerContext ctx, final VersionMessageUdpWrapper msg) {
if (LOG.isDebugEnabled()) {
LOG.debug("UdpVersionMessageWrapper received: {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
}
}
@Override
- public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
LOG.warn("Unexpected exception from downstream.", cause);
LOG.warn("Closing connection.");
ctx.close();
@Override
protected void decode(ChannelHandlerContext ctx, DatagramPacket msg,
- List<Object> out) throws Exception {
+ List<Object> out) {
LOG.debug("OFDatagramPacketFramer");
MessageConsumer consumer = UdpConnectionMap.getMessageConsumer(msg.sender());
if (consumer == null) {
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
- protected void decode(ChannelHandlerContext ctx, VersionMessageWrapper msg, List<Object> out) throws Exception {
+ protected void decode(ChannelHandlerContext ctx, VersionMessageWrapper msg, List<Object> out) {
statisticsCounter.incrementCounter(CounterEventTypes.US_RECEIVED_IN_OFJAVA);
if (LOG.isDebugEnabled()) {
LOG.debug("VersionMessageWrapper received: {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
}
@Override
- public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
if (cause instanceof io.netty.handler.ssl.NotSslRecordException) {
LOG.warn("Not an TLS record exception - please verify TLS configuration.");
} else {
}
@Override
- protected void decode(ChannelHandlerContext chc, ByteBuf bb, List<Object> list) throws Exception {
+ protected void decode(ChannelHandlerContext chc, ByteBuf bb, List<Object> list) {
if (firstTlsPass) {
connectionFacade.fireConnectionReadyNotification();
firstTlsPass = false;
}
@Override
- public void close() throws Exception {
+ public void close() {
shutdown();
}
public class UdpChannelInitializer extends ProtocolChannelInitializer<DatagramChannel> {
@Override
- protected void initChannel(DatagramChannel ch) throws Exception {
+ protected void initChannel(DatagramChannel ch) {
ch.pipeline().addLast(PipelineHandlers.OF_DATAGRAMPACKET_HANDLER.name(),
new OFDatagramPacketHandler(getSwitchConnectionHandler(), getChannelOutboundQueueSize()));
OFDatagramPacketDecoder ofDatagramPacketDecoder = new OFDatagramPacketDecoder();
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in,
- List<Object> out) throws Exception {
+ List<Object> out) {
LOG.debug("decoding");
ctx.fireChannelReadComplete();
}
* Test channel read timeout.
*/
@Test
- public void testReadTimedOut() throws Exception {
+ public void testReadTimedOut() {
idleHandler.readTimedOut(mockChHndlrCtx);
// Verify a read was fired for the next handler to process ...
* Test only one timeout notification.
*/
@Test
- public void testReadTimedOutNoOpNotFirst() throws Exception {
+ public void testReadTimedOutNoOpNotFirst() {
idleHandler.readTimedOut(mockChHndlrCtx);
idleHandler.readTimedOut(mockChHndlrCtx);
}
@Test
- public void test() throws Exception {
+ public void test() {
OFDatagramPacketDecoder decoder = new OFDatagramPacketDecoder();
decoder.setDeserializationFactory(deserializationFactory);
msgWrapper = new VersionMessageUdpWrapper(EncodeConstants.OF13_VERSION_ID, messageBufferMock,
* Test {@link OFDatagramPacketHandler}.
*/
@Test
- public void test() throws Exception {
+ public void test() {
OFDatagramPacketHandler handler = new OFDatagramPacketHandler(switchConnHandler, CHANNEL_OUTBOUND_QUEUE_SIZE);
byte version = EncodeConstants.OF13_VERSION_ID;
ByteBuf messageBuffer = ByteBufUtils.hexStringToByteBuf("04 02 00 08 01 02 03 04");
* Test decode success counter.
*/
@Test
- public void testDecodeSuccesfullCounter() throws Exception {
+ public void testDecodeSuccesfullCounter() {
if (!statCounters.isCounterEnabled(CounterEventTypes.US_DECODE_SUCCESS)) {
Assert.fail("Counter " + CounterEventTypes.US_DECODE_SUCCESS + " is not enable");
}
* Test fail decode counter.
*/
@Test
- public void testDecodeFailCounter() throws Exception {
+ public void testDecodeFailCounter() {
if (!statCounters.isCounterEnabled(CounterEventTypes.US_DECODE_SUCCESS)) {
Assert.fail("Counter " + CounterEventTypes.US_DECODE_SUCCESS + " is not enable");
}
}
@Test
- public void testDecode() throws Exception {
+ public void testDecode() {
when(mockDeserializationFactory.deserialize(any(ByteBuf.class), anyShort())).thenReturn(mockDataObject);
ofDecoder.decode(mockChHndlrCtx, inMsg, outList);
}
@Test
- public void testDecodeDeserializeException() throws Exception {
+ public void testDecodeDeserializeException() {
when(mockDeserializationFactory.deserialize(any(ByteBuf.class), anyShort()))
.thenThrow(new IllegalArgumentException());
}
@Test
- public void testDecodeDeserializeNull() throws Exception {
+ public void testDecodeDeserializeNull() {
when(mockDeserializationFactory.deserialize(any(ByteBuf.class), anyShort())).thenReturn(null);
ofDecoder.decode(mockChHndlrCtx, inMsg, outList);
* {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}.
*/
@Test
- public void testDecode8BMessage() throws Exception {
+ public void testDecode8BMessage() {
decoder.decode(channelHandlerContext,
ByteBufUtils.hexStringToByteBuf("04 00 00 08 00 00 00 01"),
list);
* {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}.
*/
@Test
- public void testDecode16BMessage() throws Exception {
+ public void testDecode16BMessage() {
ByteBuf byteBuffer = ByteBufUtils
.hexStringToByteBuf("04 00 00 10 00 00 00 00 00 00 00 00 00 00 00 42");
* {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}.
*/
@Test
- public void testDecode5BIncompleteMessage() throws Exception {
+ public void testDecode5BIncompleteMessage() {
ByteBuf byteBuffer = ByteBufUtils.hexStringToByteBuf("04 00 00 08 00");
decoder.decode(channelHandlerContext, byteBuffer, list);
* {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}.
*/
@Test
- public void testDecode16BIncompleteMessage() throws Exception {
+ public void testDecode16BIncompleteMessage() {
ByteBuf byteBuffer = ByteBufUtils
.hexStringToByteBuf("04 00 00 11 00 00 00 00 00 00 00 00 00 00 00 42");
* {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}.
*/
@Test
- public void testDecodeCompleteAndPartialMessage() throws Exception {
+ public void testDecodeCompleteAndPartialMessage() {
ByteBuf byteBuffer = ByteBufUtils
.hexStringToByteBuf("04 00 00 08 00 00 00 01 04 00 00 08 00");
}
@Test
- public void testExceptionCaught() throws Exception {
+ public void testExceptionCaught() {
decoder.exceptionCaught(channelHandlerContext, new Throwable());
}
* {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}.
*/
@Test
- public void testDecode8BMessageWithTls() throws Exception {
+ public void testDecode8BMessageWithTls() {
decoder = new OFFrameDecoder(connectionFacade, true);
decoder.decode(channelHandlerContext,
}
@Test
- public void testGetServerContext() throws Exception {
+ public void testGetServerContext() {
SSLContext context = sslContextFactory.getServerContext() ;
assertNotNull(context);
assertEquals("shutdown failed", true, shutdownRet.get());
}
- private Boolean startupServer(boolean isEpollEnabled) throws InterruptedException, IOException, ExecutionException {
+ private Boolean startupServer(boolean isEpollEnabled) throws InterruptedException {
ListenableFuture<Boolean> online = tcpHandler.getIsOnlineFuture();
/**
* Test EPoll based native transport if isEpollEnabled is true.
private class EmbededChannelHandler extends ChannelOutboundHandlerAdapter {
@Override
public void write(final ChannelHandlerContext ctx, final Object msg,
- final ChannelPromise promise) throws Exception {
+ final ChannelPromise promise) {
if (msg instanceof MessageListenerWrapper) {
counter++;
}
private class EmbededChannelHandler extends ChannelOutboundHandlerAdapter {
@Override
public void write(final ChannelHandlerContext ctx, final Object msg,
- final ChannelPromise promise) throws Exception {
+ final ChannelPromise promise) {
responseOfCall = null;
if (msg instanceof MessageListenerWrapper) {
final MessageListenerWrapper listener = (MessageListenerWrapper) msg;
private class EmbededChannelHandler extends ChannelOutboundHandlerAdapter {
@Override
public void write(final ChannelHandlerContext ctx, final Object msg,
- final ChannelPromise promise) throws Exception {
+ final ChannelPromise promise) {
responseOfCall = null;
if (msg instanceof MessageListenerWrapper) {
final MessageListenerWrapper listener = (MessageListenerWrapper) msg;
private final OfHeader flowRemoved = new FlowRemovedMessageBuilder().setVersion(VERSION).setXid(VALUE).build();
@Test
- public void commit() throws Exception {
+ public void commit() {
outboundQueueEntry.commit(ofHeader, futureCallback);
Assert.assertTrue(outboundQueueEntry.isCommitted());
Assert.assertFalse(outboundQueueEntry.isCompleted());
}
@Test
- public void reset() throws Exception {
+ public void reset() {
outboundQueueEntry.commit(ofHeader, futureCallback);
Assert.assertTrue(outboundQueueEntry.isCommitted());
}
@Test
- public void isBarrier() throws Exception {
+ public void isBarrier() {
outboundQueueEntry.commit(barrierInput, futureCallback);
Assert.assertTrue(outboundQueueEntry.isBarrier());
}
@Test
- public void takeMessage() throws Exception {
+ public void takeMessage() {
outboundQueueEntry.commit(packetOutInput, futureCallback);
outboundQueueEntry.takeMessage();
Mockito.verify(futureCallback).onSuccess(Mockito.any());
}
@Test
- public void complete() throws Exception {
+ public void complete() {
final boolean result = outboundQueueEntry.complete(multipartReplyMessage);
Assert.assertTrue(result);
Assert.assertTrue(outboundQueueEntry.isCompleted());
}
@Test(expected = IllegalStateException.class)
- public void completeTwice() throws Exception {
+ public void completeTwice() {
outboundQueueEntry.complete(multipartReplyMessage);
outboundQueueEntry.complete(multipartReplyMessage);
}
@Test
- public void fail() throws Exception {
+ public void fail() {
outboundQueueEntry.commit(ofHeader, futureCallback);
outboundQueueEntry.fail(null);
Mockito.verify(futureCallback).onFailure(Mockito.<OutboundQueueException>any());
}
@Test
- public void test() throws Exception {
+ public void test() {
final FutureCallback<OfHeader> result = new FutureCallback<OfHeader>() {
@Override
package org.opendaylight.openflowjava.protocol.impl.core.connection;
import com.google.common.util.concurrent.ListenableFuture;
-import java.io.IOException;
import java.net.InetAddress;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
}
private Boolean startupServer(final boolean isEpollEnabled)
- throws InterruptedException, IOException, ExecutionException {
+ throws InterruptedException, ExecutionException {
ListenableFuture<Boolean> online = udpHandler.getIsOnlineFuture();
/**
* Test EPoll based native transport if isEpollEnabled is true.
}
@Test
- public void test() throws Exception {
+ public void test() {
ByteBuf bb = BufferHelper.buildBuffer(
"ff 01 04 01 06 00 07 01 ff 05 00 00 09 30 00 30 41 02 00 0c 00 00 00 7e 00 "
+ "00 00 02 00 00 11 46 00 00 00 62 00 0b 00 00 00 01 00 11 80 00 02 04 00 00 00 2a 80 00 12 01 04 00 "
private OFDeserializer<PortModInput> factory;
@Before
- public void startUp() throws Exception {
+ public void startUp() {
DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
desRegistry.init();
factory = desRegistry
}
@Test
- public void test() throws Exception {
+ public void test() {
ByteBuf bb = BufferHelper.buildBuffer(
"00 00 00 09 00 00 00 00 08 00 27 00 " + "b0 eb 00 00 00 00 00 24 00 00 00 41 00 00 01 10 00 00 00 00");
PortModInput deserializedMessage = BufferHelper.deserialize(factory, bb);
private OFSerializer<BarrierOutput> factory;
@Before
- public void startUp() throws Exception {
+ public void startUp() {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, BarrierOutput.class));
private OFSerializer<MultipartReplyMessage> factory;
@Before
- public void startUp() throws Exception {
+ public void startUp() {
SerializerRegistry registry = new SerializerRegistryImpl();
registry.init();
factory = registry
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
switchConnectionProvider.close();
LOGGER.debug("\n ending test -------------------------------");
}
import com.google.common.primitives.UnsignedBytes;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.UnpooledByteBufAllocator;
-import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.List;
return IetfYangUtil.INSTANCE.macAddressFor(tmp);
}
- public static byte[] serializeList(final List<Short> list) throws IOException {
+ public static byte[] serializeList(final List<Short> list) {
ByteBuffer byteBuffer = ByteBuffer.allocate(list.size() * 2);
for (Short shortValue : list) {
byteBuffer.putShort(shortValue);
import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.buffer.UnpooledByteBufAllocator;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
}
@Test
- public void testSerializeList() throws IOException {
+ public void testSerializeList() {
List<Short> shorts = new ArrayList<>();
shorts.add((short) 1);
}
@Test
- public void testUpdateHeader() throws IOException {
+ public void testUpdateHeader() {
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
buffer.writeInt(1);
final int start = buffer.writerIndex();
public class ExperimenterDeserializerKeyFactoryTest {
@Test
- public void testCreateExperimenterErrorDeserializerKey() throws Exception {
+ public void testCreateExperimenterErrorDeserializerKey() {
ExperimenterIdDeserializerKey createdKey;
ExperimenterIdDeserializerKey comparationKey;
}
@Test
- public void testCreateExperimenterMessageDeserializerKey() throws Exception {
+ public void testCreateExperimenterMessageDeserializerKey() {
ExperimenterIdDeserializerKey createdKey;
ExperimenterIdDeserializerKey comparationKey;
}
@Test
- public void testCreateMultipartReplyMessageDeserializerKey() throws Exception {
+ public void testCreateMultipartReplyMessageDeserializerKey() {
ExperimenterIdDeserializerKey createdKey;
ExperimenterIdDeserializerKey comparationKey;
}
@Test
- public void testCreateMultipartReplyTFDeserializerKey() throws Exception {
+ public void testCreateMultipartReplyTFDeserializerKey() {
ExperimenterIdDeserializerKey createdKey;
ExperimenterIdDeserializerKey comparationKey;
}
@Test
- public void testCreateQueuePropertyDeserializerKey() throws Exception {
+ public void testCreateQueuePropertyDeserializerKey() {
ExperimenterIdDeserializerKey createdKey;
ExperimenterIdDeserializerKey comparationKey;
}
@Test
- public void testCreateMeterBandDeserializerKey() throws Exception {
+ public void testCreateMeterBandDeserializerKey() {
ExperimenterIdDeserializerKey createdKey;
ExperimenterIdDeserializerKey comparationKey;
}
@Test
- public void testCreateVendorMessageDeserializerKey() throws Exception {
+ public void testCreateVendorMessageDeserializerKey() {
ExperimenterIdDeserializerKey createdKey;
ExperimenterIdDeserializerKey comparationKey;
}
@Test
- public void testCreateMultipartReplyVendorMessageDeserializerKey() throws Exception {
+ public void testCreateMultipartReplyVendorMessageDeserializerKey() {
ExperimenterIdDeserializerKey createdKey;
ExperimenterIdDeserializerKey comparationKey;
public class ExperimenterSerializerKeyFactoryTest {
@Test
- public void testCreateExperimenterMessageSerializerKey() throws Exception {
+ public void testCreateExperimenterMessageSerializerKey() {
ExperimenterIdSerializerKey<?> createdKey;
ExperimenterIdSerializerKey<?> comparationKey;
}
@Test
- public void testCreateMultipartRequestSerializerKey() throws Exception {
+ public void testCreateMultipartRequestSerializerKey() {
ExperimenterIdSerializerKey<?> createdKey;
ExperimenterIdSerializerKey<?> comparationKey;
}
@Test
- public void testCreateMultipartRequestTFSerializerKey() throws Exception {
+ public void testCreateMultipartRequestTFSerializerKey() {
ExperimenterIdSerializerKey<?> createdKey;
ExperimenterIdSerializerKey<?> comparationKey;
}
@Test
- public void testCreateMeterBandSerializerKey() throws Exception {
+ public void testCreateMeterBandSerializerKey() {
ExperimenterIdSerializerKey<?> createdKey;
ExperimenterIdSerializerKey<?> comparationKey;
}
@Test
- public void testCreateMeterBandSubTypeSerializerKey() throws Exception {
+ public void testCreateMeterBandSubTypeSerializerKey() {
final ExperimenterIdSerializerKey<?> createdKey;
final ExperimenterIdSerializerKey<?> comparationKey1;
final ExperimenterIdSerializerKey<?> comparationKey2;
* It propagates connected device's connection context.
*/
ConnectionStatus deviceConnected(ConnectionContext connectionContext)
- throws Exception;
+ ;
}
ContextChain getContextChain(DeviceInfo deviceInfo);
@Override
- void close() throws Exception;
+ void close();
}
private int counter = 0;
@Override
- public String call() throws Exception {
+ public String call() {
counter++;
if (counter < retryCountToSucceed) {
throw new IllegalStateException("service is not ready");
}
@Override
- public void close() throws Exception {
+ public void close() {
propertyMap.clear();
listeners.clear();
}
}
}
- private void stepByStepVersionSubStep(Short remoteVersion) throws Exception {
+ private void stepByStepVersionSubStep(Short remoteVersion) {
if (remoteVersion >= lastProposedVersion) {
postHandshake(lastProposedVersion, getNextXid());
LOG.trace("ret - OK - switch answered with lastProposedVersion");
* @param remoteVersion remote version
* @throws Exception exception
*/
- private void handleLowerVersionProposal(Short remoteVersion) throws Exception {
+ private void handleLowerVersionProposal(Short remoteVersion) {
Short proposedVersion;
// find the version from header version field
proposedVersion = proposeNextVersion(remoteVersion);
* @param elements version elements
* @throws Exception exception
*/
- private void handleVersionBitmapNegotiation(List<Elements> elements) throws Exception {
+ private void handleVersionBitmapNegotiation(List<Elements> elements) {
final Short proposedVersion = proposeCommonBitmapVersion(elements);
if (lastProposedVersion == null) {
// first hello has not been sent yet
* @param helloVersion initial hello version for openflow connection negotiation
* @param helloXid transaction id
*/
- private ListenableFuture<Void> sendHelloMessage(Short helloVersion, final Long helloXid) throws Exception {
+ private ListenableFuture<Void> sendHelloMessage(Short helloVersion, final Long helloXid) {
HelloInput helloInput = MessageFactory.createHelloInput(helloVersion, helloXid, versionOrder);
import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
import org.opendaylight.openflowplugin.extension.api.ExtensionConverterProviderKeeper;
import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
-import org.opendaylight.openflowplugin.extension.api.exception.ConversionException;
import org.opendaylight.openflowplugin.extension.api.path.MessagePath;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProviderFactory;
}
// build notification
final ExperimenterMessageOfChoice messageOfChoice;
- try {
- messageOfChoice = messageConverter.convert(vendorData, MessagePath.MESSAGE_NOTIFICATION);
- final ExperimenterMessageFromDevBuilder experimenterMessageFromDevBld = new
- ExperimenterMessageFromDevBuilder()
- .setNode(new NodeRef(getDeviceInfo().getNodeInstanceIdentifier()))
- .setExperimenterMessageOfChoice(messageOfChoice);
- // publish
- notificationPublishService.offerNotification(experimenterMessageFromDevBld.build());
- } catch (final ConversionException e) {
- LOG.error("Conversion of experimenter notification failed", e);
- }
+ messageOfChoice = messageConverter.convert(vendorData, MessagePath.MESSAGE_NOTIFICATION);
+ final ExperimenterMessageFromDevBuilder experimenterMessageFromDevBld = new
+ ExperimenterMessageFromDevBuilder()
+ .setNode(new NodeRef(getDeviceInfo().getNodeInstanceIdentifier()))
+ .setExperimenterMessageOfChoice(messageOfChoice);
+ // publish
+ notificationPublishService.offerNotification(experimenterMessageFromDevBld.build());
} else {
LOG.debug("Controller is not owner of the device {}, skipping experimenter message",
deviceInfo.getLOGValue());
public class ClearStatsCommandProvider extends OsgiCommandSupport {
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
final MessageIntelligenceAgency messageIntelligenceAgency =
OpenFlowPluginProviderImpl.getMessageIntelligenceAgency();
messageIntelligenceAgency.resetStatistics();
public class ResetEventTimesComandProvider extends OsgiCommandSupport {
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
EventsTimeCounter.resetAllCounters();
out.print("Events time counters reset.\n");
public class ResetSessionStatsComandProvider extends OsgiCommandSupport {
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
SessionStatistics.resetAllCounters();
out.print("Session statistics counters reset.\n");
public class ShowEventTimesComandProvider extends OsgiCommandSupport {
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
final List<String> statistics = EventsTimeCounter.provideTimes();
final StringBuilder result = new StringBuilder();
public class ShowSessionStatsCommandProvider extends OsgiCommandSupport {
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
final List<String> statistics = SessionStatistics.provideStatistics();
final StringBuilder result = new StringBuilder();
public class ShowStatsCommandProvider extends OsgiCommandSupport {
@Override
- protected Object doExecute() throws Exception {
+ protected Object doExecute() {
PrintStream out = session.getConsole();
final MessageIntelligenceAgency messageIntelligenceAgency =
OpenFlowPluginProviderImpl.getMessageIntelligenceAgency();
}
@Override
- public ConnectionStatus deviceConnected(final ConnectionContext connectionContext) throws Exception {
+ public ConnectionStatus deviceConnected(final ConnectionContext connectionContext) {
final DeviceInfo deviceInfo = connectionContext.getDeviceInfo();
final ContextChain contextChain = contextChainMap.get(deviceInfo);
final FeaturesReply featuresReply = connectionContext.getFeatures();
}
@Override
- public void close() throws Exception {
+ public void close() {
Map<DeviceInfo, ContextChain> copyOfChains = new HashMap<>(contextChainMap);
copyOfChains.keySet().forEach(this::destroyContextChain);
copyOfChains.clear();
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.util.ExperimenterDeserializerKeyFactory;
import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
-import org.opendaylight.openflowplugin.extension.api.exception.ConversionException;
import org.opendaylight.openflowplugin.extension.api.path.MessagePath;
import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.reply.MultipartReplyBody;
.getExtensionConvertorProvider()
.getMessageConverter(key);
- try {
- builder.setExperimenterMessageOfChoice(convertor.convert(data, MessagePath.MPMESSAGE_RPC_OUTPUT));
- } catch (ConversionException ce) {
- LOG.debug("Failed to deserialize multipart reply experimenter for key: {}", key);
- }
+ builder.setExperimenterMessageOfChoice(convertor.convert(data, MessagePath.MPMESSAGE_RPC_OUTPUT));
}
return builder.build();
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final EchoInputBuilder input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final EchoInputBuilder input) {
return input
.setXid(xid.getValue())
.setVersion(getVersion())
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.role.RoleChangeException;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.util.ErrorUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ControllerRole;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final RoleRequestInputBuilder input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final RoleRequestInputBuilder input) {
input.setXid(xid.getValue());
return input.build();
}
import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
import org.opendaylight.openflowplugin.impl.services.AbstractAggregateFlowMultipartService;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.util.FlowCreatorUtil;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) throws
- ServiceException {
+ final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
final MultipartRequestAggregateCaseBuilder multipartRequestAggregateCaseBuilder
= new MultipartRequestAggregateCaseBuilder();
final MultipartRequestAggregateBuilder mprAggregateRequestBuilder = new MultipartRequestAggregateBuilder();
.withError(ErrorType.RPC, "Custom converter not found.").build());
return;
}
- try {
- final ExperimenterMessageOfChoice messageOfChoice =
- messageConverter.convert(vendorData, MessagePath.MPMESSAGE_RPC_OUTPUT);
- final ExperimenterCoreMessageItemBuilder expCoreMessageItemBuilder =
- new ExperimenterCoreMessageItemBuilder();
- expCoreMessageItemBuilder.setExperimenterMessageOfChoice(messageOfChoice);
- expCoreMessageItem.add(expCoreMessageItemBuilder.build());
- } catch (final ConversionException e) {
- LOG.error("Conversion of experimenter message reply failed. Exception: {}", e);
- finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed()
- .withError(ErrorType.RPC,
- "Conversion of experimenter rpc output failed.").build());
- return;
- }
+ final ExperimenterMessageOfChoice messageOfChoice =
+ messageConverter.convert(vendorData, MessagePath.MPMESSAGE_RPC_OUTPUT);
+ final ExperimenterCoreMessageItemBuilder expCoreMessageItemBuilder =
+ new ExperimenterCoreMessageItemBuilder();
+ expCoreMessageItemBuilder.setExperimenterMessageOfChoice(messageOfChoice);
+ expCoreMessageItem.add(expCoreMessageItemBuilder.build());
}
sendExpMpReqOutputBuilder.setExperimenterCoreMessageItem(expCoreMessageItem);
finalFuture.set(RpcResultBuilder.success(sendExpMpReqOutputBuilder.build()).build());
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final FlowModInputBuilder input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final FlowModInputBuilder input) {
input.setXid(xid.getValue());
return input.build();
}
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.GroupConvertor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final I input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final I input) {
final Optional<GroupModInputBuilder> ofGroupModInput = convertorExecutor.convert(input, data);
final GroupModInputBuilder groupModInputBuilder = ofGroupModInput
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.MeterConvertor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final I input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final I input) {
final Optional<MeterModInputBuilder> ofMeterModInput = convertorExecutor.convert(input, data);
final MeterModInputBuilder meterModInputBuilder = ofMeterModInput
.orElse(MeterConvertor.defaultResult(getVersion()));
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
import org.opendaylight.openflowplugin.impl.services.AbstractTableMultipartService;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final UpdateTableInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final UpdateTableInput input) {
final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart
.request.multipart.request.body.multipart.request.table.features._case.multipart.request
.table.features.TableFeatures>> tableFeatures =
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
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;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final SendBarrierInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final SendBarrierInput input) {
final BarrierInputBuilder barrierInputOFJavaBuilder = new BarrierInputBuilder();
barrierInputOFJavaBuilder.setVersion(getVersion());
barrierInputOFJavaBuilder.setXid(xid.getValue());
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.NodeConfigService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigOutput;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final SetConfigInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final SetConfigInput input) {
SetConfigInputBuilder builder = new SetConfigInputBuilder();
SwitchConfigFlag flag = SwitchConfigFlag.valueOf(input.getFlag());
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.PacketOutConvertor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.XidConvertorData;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final TransmitPacketInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final TransmitPacketInput input) {
final XidConvertorData data = new XidConvertorData(getVersion());
data.setDatapathId(getDatapathId());
data.setXid(xid.getValue());
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerPortService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.PortConvertor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final UpdatePortInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final UpdatePortInput input) {
final Optional<PortModInput> ofPortModInput = convertorExecutor
.convert(getPortFromInput(input), data);
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
import org.opendaylight.openflowplugin.impl.services.RoleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.role.service.rev150727.OfpRole;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final SetRoleInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final SetRoleInput input) {
return null;
}
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractAggregateFlowMultipartService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutputBuilder;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input)
- throws ServiceException {
+ final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
return new MultipartRequestBuilder()
.setXid(xid.getValue())
.setVersion(getVersion())
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
import org.opendaylight.openflowplugin.impl.services.AbstractExperimenterMultipartService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestOutputBuilder;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final SendExperimenterMpRequestInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final SendExperimenterMpRequestInput input) {
return new MultipartRequestBuilder()
.setXid(xid.getValue())
.setVersion(getVersion())
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSilentErrorService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.OriginalFlow;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final Flow input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final Flow input) {
final FlowMessageBuilder flowMessageBuilder = new FlowMessageBuilder(input);
final Class<? extends DataContainer> clazz = input.getImplementedInterface();
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.AsyncConfigMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.GetAsyncInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInputBuilder;
}
@Override
- protected OfHeader buildRequest(Xid xid, GetAsyncInput input) throws ServiceException {
+ protected OfHeader buildRequest(Xid xid, GetAsyncInput input) {
return new GetAsyncInputBuilder().setVersion(getVersion()).setXid(xid.getValue()).build();
}
}
\ No newline at end of file
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.OriginalGroup;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final Group input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final Group input) {
final GroupMessageBuilder groupMessageBuilder = new GroupMessageBuilder(input);
final Class<? extends DataContainer> clazz = input.getImplementedInterface();
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSilentErrorService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.meter.update.OriginalMeter;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final Meter input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final Meter input) {
final MeterMessageBuilder meterMessageBuilder = new MeterMessageBuilder(input);
final Class<? extends DataContainer> clazz = input.getImplementedInterface();
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.CommonPortWithMask;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final CommonPortWithMask input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final CommonPortWithMask input) {
return new PortMessageBuilder(input)
.setVersion(getVersion())
.setXid(xid.getValue())
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.AbstractSimpleService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.AsyncConfigMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.async.config.service.rev170619.SetAsyncOutput;
}
@Override
- protected OfHeader buildRequest(Xid xid, SetAsyncInput input) throws ServiceException {
+ protected OfHeader buildRequest(Xid xid, SetAsyncInput input) {
return new AsyncConfigMessageBuilder(input)
.setVersion(getVersion())
.setXid(xid.getValue())
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
import org.opendaylight.openflowplugin.impl.services.AbstractTableMultipartService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartRequestBuilder;
@Override
- protected OfHeader buildRequest(final Xid xid, final UpdateTableInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final UpdateTableInput input) {
return new MultipartRequestBuilder()
.setXid(xid.getValue())
.setVersion(getVersion())
}
@Override
- protected void startUp() throws Exception {
+ protected void startUp() {
counter.markStart();
}
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.util.FlowCreatorUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdate;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input)
- throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid,
+ final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
// Create multipart request body for fetch all the group stats
final MultipartRequestAggregateCaseBuilder multipartRequestAggregateCaseBuilder =
new MultipartRequestAggregateCaseBuilder();
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.FlowStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.impl.util.FlowCreatorUtil;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetAllFlowsStatisticsFromAllFlowTablesInput input) throws ServiceException {
+ final GetAllFlowsStatisticsFromAllFlowTablesInput input) {
final MultipartRequestInputBuilder mprInput = RequestInputUtils
.createMultipartHeader(MultipartType.OFPMPFLOW, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(flowCase);
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.FlowStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.impl.util.FlowCreatorUtil;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetAllFlowStatisticsFromFlowTableInput input) throws ServiceException {
+ final GetAllFlowStatisticsFromFlowTableInput input) {
final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
mprFlowRequestBuilder.setTableId(input.getTableId().getValue());
mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.GroupStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetAllGroupStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetAllGroupStatisticsInput input) {
// Create multipart request header
final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
MultipartType.OFPMPGROUP, xid.getValue(), getVersion());
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetAllMeterConfigStatisticsInput input) throws ServiceException {
+ final GetAllMeterConfigStatisticsInput input) {
MultipartRequestInputBuilder mprInput = RequestInputUtils
.createMultipartHeader(MultipartType.OFPMPMETERCONFIG, xid.getValue(), getVersion());
return mprInput.setMultipartRequestBody(METER_CONFIG_CASE).build();
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.MeterStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetAllMeterStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetAllMeterStatisticsInput input) {
MultipartRequestInputBuilder mprInput = RequestInputUtils
.createMultipartHeader(MultipartType.OFPMPMETER, xid.getValue(), getVersion());
return mprInput.setMultipartRequestBody(METER_CASE).build();
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.NodeConnectorStatisticsToNotificationTransformer;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetAllNodeConnectorsStatisticsInput input) throws ServiceException {
+ final GetAllNodeConnectorsStatisticsInput input) {
MultipartRequestInputBuilder mprInput = RequestInputUtils
.createMultipartHeader(MultipartType.OFPMPPORTSTATS, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(PORT_STATS_CASE);
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.QueueStatisticsToNotificationTransformer;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetAllQueuesStatisticsFromAllPortsInput input) throws ServiceException {
+ final GetAllQueuesStatisticsFromAllPortsInput input) {
// Set request body to main multipart request
MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
MultipartType.OFPMPQUEUE, xid.getValue(), getVersion());
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.QueueStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetAllQueuesStatisticsFromGivenPortInput input) throws ServiceException {
+ final GetAllQueuesStatisticsFromGivenPortInput input) {
MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder();
// Select all queues
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.FlowStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetFlowStatisticsFromFlowTableInput input) throws ServiceException {
+ final GetFlowStatisticsFromFlowTableInput input) {
final MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder();
final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetGroupDescriptionInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetGroupDescriptionInput input) {
final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
MultipartType.OFPMPGROUPDESC, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(GROUP_DESC_CASE);
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.util.GroupUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetGroupFeaturesInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetGroupFeaturesInput input) {
final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
MultipartType.OFPMPGROUPFEATURES, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(GROUP_FEAT_CASE);
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.GroupStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetGroupStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetGroupStatisticsInput input) {
final MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
final MultipartRequestGroupBuilder mprGroupBuild = new MultipartRequestGroupBuilder();
mprGroupBuild.setGroupId(new GroupId(input.getGroupId().getValue()));
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetMeterFeaturesInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetMeterFeaturesInput input) {
MultipartRequestInputBuilder mprInput =
RequestInputUtils.createMultipartHeader(MultipartType.OFPMPMETERFEATURES, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(METER_FEATURES_CASE);
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.MeterStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetMeterStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetMeterStatisticsInput input) {
MultipartRequestMeterCaseBuilder caseBuilder =
new MultipartRequestMeterCaseBuilder();
MultipartRequestMeterBuilder mprMeterBuild =
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.QueueStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetQueueStatisticsFromGivenPortInput input) throws ServiceException {
+ final GetQueueStatisticsFromGivenPortInput input) {
MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder();
// Select specific queue
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetFlowTablesStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetFlowTablesStatisticsInput input) {
// Create multipart request body for fetch all the group stats
final MultipartRequestTableCaseBuilder multipartRequestTableCaseBuilder =
new MultipartRequestTableCaseBuilder();
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.NodeConnectorStatisticsToNotificationTransformer;
import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetNodeConnectorStatisticsInput input) throws ServiceException {
+ final GetNodeConnectorStatisticsInput input) {
MultipartRequestPortStatsCaseBuilder caseBuilder =
new MultipartRequestPortStatsCaseBuilder();
MultipartRequestPortStatsBuilder mprPortStatsBuilder =
import org.opendaylight.openflowplugin.impl.common.MultipartRequestInputFactory;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
import org.opendaylight.openflowplugin.impl.services.AbstractMultipartOnTheFlyService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final MultipartType input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final MultipartType input) {
return MultipartRequestInputFactory.makeMultipartRequest(xid.getValue(),
getVersion(),
input,
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.StatisticsGatherer;
import org.opendaylight.openflowplugin.impl.common.MultipartRequestInputFactory;
import org.opendaylight.openflowplugin.impl.services.AbstractMultipartService;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final MultipartType input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final MultipartType input) {
return MultipartRequestInputFactory.makeMultipartRequest(xid.getValue(),
getVersion(),
input,
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractFlowDirectStatisticsService;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetFlowStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetFlowStatisticsInput input) {
return new MultipartRequestBuilder()
.setXid(xid.getValue())
.setVersion(getVersion())
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractGroupDirectStatisticsService;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetGroupStatisticsInput;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetGroupStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetGroupStatisticsInput input) {
return new MultipartRequestBuilder()
.setXid(xid.getValue())
.setVersion(getVersion())
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractMeterDirectStatisticsService;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetMeterStatisticsInput;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetMeterStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetMeterStatisticsInput input) {
return new MultipartRequestBuilder()
.setXid(xid.getValue())
.setVersion(getVersion())
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractPortDirectStatisticsService;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsInput;
@Override
protected OfHeader buildRequest(final Xid xid,
- final GetNodeConnectorStatisticsInput input) throws ServiceException {
+ final GetNodeConnectorStatisticsInput input) {
return new MultipartRequestBuilder()
.setXid(xid.getValue())
.setVersion(getVersion())
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
-import org.opendaylight.openflowplugin.impl.services.util.ServiceException;
import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractQueueDirectStatisticsService;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetQueueStatisticsInput;
}
@Override
- protected OfHeader buildRequest(final Xid xid, final GetQueueStatisticsInput input) throws ServiceException {
+ protected OfHeader buildRequest(final Xid xid, final GetQueueStatisticsInput input) {
return new MultipartRequestBuilder()
.setXid(xid.getValue())
.setVersion(getVersion())
private static final int DEVICE_CONNECTION_RATE_LIMIT_PER_MIN = 0;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit();
when(entityOwnershipService.registerListener(any(), any())).thenReturn(entityOwnershipListenerRegistration);
}
@Test
- public void testInitializeAndClose() throws Exception {
+ public void testInitializeAndClose() {
final OpenFlowPluginProviderImpl provider = new OpenFlowPluginProviderImpl(
configurationService,
new SwitchConnectionProviderList(Lists.newArrayList(switchConnectionProvider)),
private TranslatorLibrarian translatorLibrarian;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
translatorLibrarian = new TranslatorLibrarian() {
@Before
- public void setUp() throws Exception {
+ public void setUp() {
ofVersion = OFConstants.OFP_VERSION_1_3;
}
@Test
- public void testMakeMultipartRequestInput_DESC() throws Exception {
+ public void testMakeMultipartRequestInput_DESC() {
MultipartType mpType = MultipartType.OFPMPDESC;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInput_FLOW_13() throws Exception {
+ public void testMakeMultipartRequestInput_FLOW_13() {
final MultipartType mpType = MultipartType.OFPMPFLOW;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInput_FLOW_10() throws Exception {
+ public void testMakeMultipartRequestInput_FLOW_10() {
final MultipartType mpType = MultipartType.OFPMPFLOW;
ofVersion = OFConstants.OFP_VERSION_1_0;
final MultipartRequestInput mpRqInput =
}
@Test
- public void testMakeMultipartRequestInputAggregate() throws Exception {
+ public void testMakeMultipartRequestInputAggregate() {
MultipartType mpType = MultipartType.OFPMPAGGREGATE;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputTable() throws Exception {
+ public void testMakeMultipartRequestInputTable() {
MultipartType mpType = MultipartType.OFPMPTABLE;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputPortStats() throws Exception {
+ public void testMakeMultipartRequestInputPortStats() {
final MultipartType mpType = MultipartType.OFPMPPORTSTATS;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputQueue() throws Exception {
+ public void testMakeMultipartRequestInputQueue() {
final MultipartType mpType = MultipartType.OFPMPQUEUE;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputGroup() throws Exception {
+ public void testMakeMultipartRequestInputGroup() {
final MultipartType mpType = MultipartType.OFPMPGROUP;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputGroupDesc() throws Exception {
+ public void testMakeMultipartRequestInputGroupDesc() {
MultipartType mpType = MultipartType.OFPMPGROUPDESC;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputGroupFeatures() throws Exception {
+ public void testMakeMultipartRequestInputGroupFeatures() {
MultipartType mpType = MultipartType.OFPMPGROUPFEATURES;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputMeter() throws Exception {
+ public void testMakeMultipartRequestInputMeter() {
final MultipartType mpType = MultipartType.OFPMPMETER;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputMeterConfig() throws Exception {
+ public void testMakeMultipartRequestInputMeterConfig() {
final MultipartType mpType = MultipartType.OFPMPMETERCONFIG;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputMeterFeatures() throws Exception {
+ public void testMakeMultipartRequestInputMeterFeatures() {
MultipartType mpType = MultipartType.OFPMPMETERFEATURES;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputTableFeatures() throws Exception {
+ public void testMakeMultipartRequestInputTableFeatures() {
final MultipartType mpType = MultipartType.OFPMPTABLEFEATURES;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputPortDesc() throws Exception {
+ public void testMakeMultipartRequestInputPortDesc() {
MultipartType mpType = MultipartType.OFPMPPORTDESC;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
@Test
- public void testMakeMultipartRequestInputExperimenter() throws Exception {
+ public void testMakeMultipartRequestInputExperimenter() {
MultipartType mpType = MultipartType.OFPMPEXPERIMENTER;
final MultipartRequestInput mpRqInput =
(MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
}
private void checkEmptyBody(Class<? extends DataContainer> mpRqBody, Class<? extends
- MultipartRequestBody> expectedMpRqBodyClass) throws Exception {
+ MultipartRequestBody> expectedMpRqBodyClass) {
Assert.assertTrue(expectedMpRqBodyClass.isAssignableFrom(mpRqBody));
Assert.assertEquals(expectedMpRqBodyClass, mpRqBody);
}
private ConfigurationService configurationService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(config.isIsStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsFlowStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsTableStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
}
@Test
- public void update() throws Exception {
+ public void update() {
final int tpMinThreads = configurationService
.getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Integer::valueOf);
}
@Test
- public void getProperty() throws Exception {
+ public void getProperty() {
final int tpMaxThreads = configurationService
.getProperty(ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(), Integer::valueOf);
}
@Test
- public void registerListener() throws Exception {
+ public void registerListener() {
configurationService.registerListener(configurationListener);
verify(configurationListener, times(CONFIG_PROP_COUNT)).onPropertyChanged(any(), any());
}
private OpenflowProviderConfig openflowProviderConfig;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(configurationService.getProperty(eq(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString()), any()))
.thenReturn(IS_STATISTICS_POLLING_ON);
when(configurationService.getProperty(eq(ConfigurationProperty.BARRIER_COUNT_LIMIT.toString()), any()))
}
@Test
- public void getRpcRequestsQuota() throws Exception {
+ public void getRpcRequestsQuota() {
assertEquals(RPC_REQUESTS_QUOTA, openflowProviderConfig.getRpcRequestsQuota().getValue());
}
@Test
- public void isSwitchFeaturesMandatory() throws Exception {
+ public void isSwitchFeaturesMandatory() {
assertEquals(SWITCH_FEATURES_MANDATORY, openflowProviderConfig.isSwitchFeaturesMandatory());
}
@Test
- public void getGlobalNotificationQuota() throws Exception {
+ public void getGlobalNotificationQuota() {
assertEquals(GLOBAL_NOTIFICATION_QUOTA, openflowProviderConfig.getGlobalNotificationQuota());
}
@Test
- public void isIsStatisticsPollingOn() throws Exception {
+ public void isIsStatisticsPollingOn() {
assertEquals(IS_STATISTICS_POLLING_ON, openflowProviderConfig.isIsStatisticsPollingOn());
}
@Test
- public void isIsStatisticsRpcEnabled() throws Exception {
+ public void isIsStatisticsRpcEnabled() {
assertEquals(IS_STATISTICS_RPC_ENABLED, openflowProviderConfig.isIsStatisticsRpcEnabled());
}
@Test
- public void getBarrierIntervalTimeoutLimit() throws Exception {
+ public void getBarrierIntervalTimeoutLimit() {
assertEquals(BARRIER_INTERVAL_TIMEOUT_LIMIT, openflowProviderConfig.getBarrierIntervalTimeoutLimit()
.getValue());
}
@Test
- public void getBarrierCountLimit() throws Exception {
+ public void getBarrierCountLimit() {
assertEquals(BARRIER_COUNT_LIMIT, openflowProviderConfig.getBarrierCountLimit().getValue());
}
@Test
- public void getEchoReplyTimeout() throws Exception {
+ public void getEchoReplyTimeout() {
assertEquals(ECHO_REPLY_TIMEOUT, openflowProviderConfig.getEchoReplyTimeout().getValue());
}
@Test
- public void getThreadPoolMinThreads() throws Exception {
+ public void getThreadPoolMinThreads() {
assertEquals(THREAD_POOL_MIN_THREADS, openflowProviderConfig.getThreadPoolMinThreads());
}
@Test
- public void getThreadPoolMaxThreads() throws Exception {
+ public void getThreadPoolMaxThreads() {
assertEquals(THREAD_POOL_MAX_THREADS, openflowProviderConfig.getThreadPoolMaxThreads().getValue());
}
@Test
- public void getThreadPoolTimeout() throws Exception {
+ public void getThreadPoolTimeout() {
assertEquals(THREAD_POOL_TIMEOUT, openflowProviderConfig.getThreadPoolTimeout());
}
@Test
- public void isEnableFlowRemovedNotification() throws Exception {
+ public void isEnableFlowRemovedNotification() {
assertEquals(ENABLE_FLOW_REMOVED_NOTIFICATION, openflowProviderConfig.isEnableFlowRemovedNotification());
}
@Test
- public void isSkipTableFeatures() throws Exception {
+ public void isSkipTableFeatures() {
assertEquals(SKIP_TABLE_FEATURES, openflowProviderConfig.isSkipTableFeatures());
}
@Test
- public void getBasicTimerDelay() throws Exception {
+ public void getBasicTimerDelay() {
assertEquals(BASIC_TIMER_DELAY, openflowProviderConfig.getBasicTimerDelay().getValue());
}
@Test
- public void getMaximumTimerDelay() throws Exception {
+ public void getMaximumTimerDelay() {
assertEquals(MAXIMUM_TIMER_DELAY, openflowProviderConfig.getMaximumTimerDelay().getValue());
}
@Test
- public void isUseSingleLayerSerialization() throws Exception {
+ public void isUseSingleLayerSerialization() {
assertEquals(USE_SINGLE_LAYER_SERIALIZATION, openflowProviderConfig.isUseSingleLayerSerialization());
}
@Test
- public void getDeviceConnectionRateLimitPerMin() throws Exception {
+ public void getDeviceConnectionRateLimitPerMin() {
assertEquals(DEVICE_CONNECTION_RATE_LIMIT_PER_MIN, openflowProviderConfig.getDeviceConnectionRateLimitPerMin());
}
private ConnectionContextImpl connectionContext;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.when(connetionAdapter.getRemoteAddress())
.thenReturn(InetSocketAddress.createUnresolved("ofp-ut.example.org", 4242));
Mockito.when(connetionAdapter.isAlive()).thenReturn(true);
}
@Test
- public void testCloseConnection1() throws Exception {
+ public void testCloseConnection1() {
connectionContext.closeConnection(true);
Mockito.verify(outboundQueueRegistration).close();
Mockito.verify(handshakeContext).close();
}
@Test
- public void testCloseConnection2() throws Exception {
+ public void testCloseConnection2() {
connectionContext.closeConnection(false);
Mockito.verify(outboundQueueRegistration).close();
Mockito.verify(handshakeContext).close();
}
@Test
- public void testOnConnectionClosed() throws Exception {
+ public void testOnConnectionClosed() {
connectionContext.onConnectionClosed();
Assert.assertEquals(ConnectionContext.CONNECTION_STATE.RIP, connectionContext.getConnectionState());
Mockito.verify(outboundQueueRegistration).close();
}
@Test
- public void testChangeStateToHandshaking() throws Exception {
+ public void testChangeStateToHandshaking() {
connectionContext.changeStateToHandshaking();
Assert.assertEquals(ConnectionContext.CONNECTION_STATE.HANDSHAKING, connectionContext.getConnectionState());
}
@Test
- public void testChangeStateToTimeouting() throws Exception {
+ public void testChangeStateToTimeouting() {
connectionContext.changeStateToTimeouting();
Assert.assertEquals(ConnectionContext.CONNECTION_STATE.TIMEOUTING, connectionContext.getConnectionState());
}
@Test
- public void testChangeStateToWorking() throws Exception {
+ public void testChangeStateToWorking() {
connectionContext.changeStateToWorking();
Assert.assertEquals(ConnectionContext.CONNECTION_STATE.WORKING, connectionContext.getConnectionState());
}
ErrorHandler errorHandler = new ErrorHandlerSimpleImpl();
@Test
- public void testHandleException() throws Exception {
+ public void testHandleException() {
ConnectionException connectionException = new ConnectionException("Exception for testing purpose only.");
errorHandler.handleException(connectionException);
*
*/
@Test
- public void testVersionNegotiation10() throws Exception {
+ public void testVersionNegotiation10() {
LOG.debug("testVersionNegotiation10");
Short version = OFConstants.OFP_VERSION_1_0;
*
*/
@Test
- public void testVersionNegotiation10SwitchStarts() throws Exception {
+ public void testVersionNegotiation10SwitchStarts() {
LOG.debug("testVersionNegotiation10-ss");
Short version = OFConstants.OFP_VERSION_1_0;
* Switch delivers first helloMessage with version 0x00 = negotiation unsuccessful
*/
@Test
- public void testVersionNegotiation00() throws Exception {
+ public void testVersionNegotiation00() {
LOG.debug("testVersionNegotiation00");
expectedErrors = 1;
Short version = (short) 0x00;
* Switch delivers first helloMessage with version 0x00 = negotiation unsuccessful
*/
@Test
- public void testVersionNegotiation00SwitchStarts() throws Exception {
+ public void testVersionNegotiation00SwitchStarts() {
LOG.debug("testVersionNegotiation00-ss");
expectedErrors = 1;
Short version = (short) 0x00;
*
*/
@Test
- public void testVersionNegotiation11() throws Exception {
+ public void testVersionNegotiation11() {
LOG.debug("testVersionNegotiation11");
Short version = (short) 0x02;
Short expVersion = (short) 0x01;
* Test of version negotiation Where 1.0 < switch version < 1.3.
*/
@Test
- public void testVersionNegotiation11SwitchStarts() throws Exception {
+ public void testVersionNegotiation11SwitchStarts() {
LOG.debug("testVersionNegotiation11-ss");
final Short version = (short) 0x02;
final Short expVersion = (short) 0x01;
*
*/
@Test
- public void testVersionNegotiation13() throws Exception {
+ public void testVersionNegotiation13() {
LOG.debug("testVersionNegotiation13");
Short version = OFConstants.OFP_VERSION_1_3;
*
*/
@Test
- public void testVersionNegotiation13SwitchStarts() throws Exception {
+ public void testVersionNegotiation13SwitchStarts() {
LOG.debug("testVersionNegotiation13-ss");
Short version = OFConstants.OFP_VERSION_1_3;
*
*/
@Test
- public void testVersionNegotiation15() throws Exception {
+ public void testVersionNegotiation15() {
LOG.debug("testVersionNegotiation15");
Short version = (short) 0x06;
Short expVersion = OFConstants.OFP_VERSION_1_3;
*
*/
@Test
- public void testVersionNegotiation15SwitchStart() throws Exception {
+ public void testVersionNegotiation15SwitchStart() {
LOG.debug("testVersionNegotiation15-ss");
Short version = (short) 0x06;
Short expVersion = OFConstants.OFP_VERSION_1_3;
*
*/
@Test
- public void testVersionNegotiation15_MultipleCall() throws Exception {
+ public void testVersionNegotiation15_MultipleCall() {
LOG.debug("testVersionNegotiation15_MultipleCall");
Short version = (short) 0x06;
expectedErrors = 1;
*
*/
@Test
- public void testVersionNegotiation15_MultipleCallSwitchStarts() throws Exception {
+ public void testVersionNegotiation15_MultipleCallSwitchStarts() {
LOG.debug("testVersionNegotiation15_MultipleCall-ss");
Short version = (short) 0x06;
expectedErrors = 1;
*
*/
@Test
- public void testVersionNegotiation10InBitmap() throws Exception {
+ public void testVersionNegotiation10InBitmap() {
LOG.debug("testVersionNegotiation10InBitmap");
Short version = OFConstants.OFP_VERSION_1_0;
handshakeManager.setUseVersionBitmap(true);
*
*/
@Test
- public void testVersionNegotiation10InBitmapSwitchStarts() throws Exception {
+ public void testVersionNegotiation10InBitmapSwitchStarts() {
LOG.debug("testVersionNegotiation10InBitmap-ss");
Short version = OFConstants.OFP_VERSION_1_0;
handshakeManager.setUseVersionBitmap(true);
*
*/
@Test
- public void testVersionNegotiation13InBitmap() throws Exception {
+ public void testVersionNegotiation13InBitmap() {
LOG.debug("testVersionNegotiation13InBitmap");
Short version = OFConstants.OFP_VERSION_1_3;
handshakeManager.setUseVersionBitmap(true);
*
*/
@Test
- public void testVersionNegotiation13InBitmapSwitchFirst() throws Exception {
+ public void testVersionNegotiation13InBitmapSwitchFirst() {
LOG.debug("testVersionNegotiation13InBitmap-ss");
Short version = OFConstants.OFP_VERSION_1_3;
handshakeManager.setUseVersionBitmap(true);
*
*/
@Test
- public void testVersionNegotiationNoCommonVersionInBitmap() throws Exception {
+ public void testVersionNegotiationNoCommonVersionInBitmap() {
LOG.debug("testVersionNegotiationNoCommonVersionInBitmap");
Short version = (short) 0x05;
expectedErrors = 1;
*
*/
@Test
- public void testVersionNegotiationNoCommonVersionInBitmapSwitchStarts() throws Exception {
+ public void testVersionNegotiationNoCommonVersionInBitmapSwitchStarts() {
LOG.debug("testVersionNegotiationNoCommonVersionInBitmap-ss");
Short version = (short) 0x05;
expectedErrors = 1;
new OutboundQueueProviderImpl(OFConstants.OFP_VERSION_1_3);
@Test
- public void testReserveEntry() throws Exception {
+ public void testReserveEntry() {
outboundQueueProvider.onConnectionQueueChanged(null);
Long returnValue = outboundQueueProvider.reserveEntry();
private HandshakeListenerImpl handshakeListener;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.when(connectionAdapter.barrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.success(new BarrierOutputBuilder().build()).buildFuture());
connectionContextSpy = Mockito.spy(new ConnectionContextImpl(connectionAdapter));
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verify(handshakeContext).close();
}
@Test
- public void testOnHandshakeSuccessfull() throws Exception {
+ public void testOnHandshakeSuccessfull() {
handshakeListener.onHandshakeSuccessful(features, OFConstants.OFP_VERSION_1_3);
Mockito.verify(connectionContextSpy).changeStateToWorking();
Mockito.verify(connectionContextSpy).setFeatures(any(FeaturesReply.class));
}
@Test
- public void testOnHandshakeFailure1() throws Exception {
+ public void testOnHandshakeFailure1() {
connectionContextSpy.setNodeId(new NodeId("ut-device:10"));
handshakeListener.onHandshakeFailure();
Mockito.verify(handshakeContext).close();
}
@Test
- public void testOnHandshakeFailure2() throws Exception {
+ public void testOnHandshakeFailure2() {
Mockito.when(connectionAdapter.getRemoteAddress())
.thenReturn(InetSocketAddress.createUnresolved("ut-ofp.example.org", 4242));
connectionContextSpy.setNodeId(new NodeId("openflow:1"));
private OpenflowProtocolListenerInitialImpl openflowProtocolListenerInitial;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.when(connectionAdapter.isAlive()).thenReturn(true);
Mockito.when(connectionContext.getConnectionAdapter()).thenReturn(connectionAdapter);
Mockito.when(connectionContext.getConnectionState())
}
@Test
- public void testOnEchoRequestMessage() throws Exception {
+ public void testOnEchoRequestMessage() {
EchoRequestMessageBuilder echoRequestMessageBld = new EchoRequestMessageBuilder()
.setXid(42L)
.setVersion(OFConstants.OFP_VERSION_1_3);
}
@Test
- public void testOnHelloMessage() throws Exception {
+ public void testOnHelloMessage() {
HelloMessageBuilder helloMessageBld = new HelloMessageBuilder()
.setXid(42L)
.setVersion(OFConstants.OFP_VERSION_1_3);
}
@Test
- public void testCheckState() throws Exception {
+ public void testCheckState() {
Assert.assertFalse(openflowProtocolListenerInitial.checkState(ConnectionContext.CONNECTION_STATE.HANDSHAKING));
Assert.assertTrue(openflowProtocolListenerInitial.checkState(ConnectionContext.CONNECTION_STATE.HANDSHAKING));
}
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verifyNoMoreInteractions(connectionContext);
}
* Successful scenario - connection is on and closes without errors.
*/
@Test
- public void testOnDisconnectEvent1() throws Exception {
+ public void testOnDisconnectEvent1() {
DisconnectEvent disconnectNotification = new DisconnectEventBuilder().setInfo("testing disconnect").build();
systemNotificationsListener.onDisconnectEvent(disconnectNotification);
* Broken scenario - connection is on but fails to close.
*/
@Test
- public void testOnDisconnectEvent2() throws Exception {
+ public void testOnDisconnectEvent2() {
DisconnectEvent disconnectNotification = new DisconnectEventBuilder().setInfo("testing disconnect").build();
systemNotificationsListener.onDisconnectEvent(disconnectNotification);
* Successful scenario - connection is already down.
*/
@Test
- public void testOnDisconnectEvent3() throws Exception {
+ public void testOnDisconnectEvent3() {
connectionContextGolem.changeStateToTimeouting();
DisconnectEvent disconnectNotification = new DisconnectEventBuilder().setInfo("testing disconnect").build();
* Broken scenario - connection is on but throws error on close.
*/
@Test
- public void testOnDisconnectEvent4() throws Exception {
+ public void testOnDisconnectEvent4() {
Mockito.when(connectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.RIP);
DisconnectEvent disconnectNotification = new DisconnectEventBuilder().setInfo("testing disconnect").build();
private DeviceContext deviceContextSpy;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final FluentFuture<Optional<Node>> noExistNodeFuture =
FluentFutures.immediateFluentFuture(Optional.<Node>empty());
Mockito.lenient().when(readTx.read(LogicalDatastoreType.OPERATIONAL, nodeKeyIdent))
}
@Test
- public void testInitialSubmitTransaction() throws Exception {
+ public void testInitialSubmitTransaction() {
Mockito.doReturn(CommitInfo.emptyFluentFuture()).when(writeTx).commit();
final InstanceIdentifier<Nodes> dummyII = InstanceIdentifier.create(Nodes.class);
((DeviceContextImpl) deviceContext).getTransactionChainManager().activateTransactionManager() ;
}
@Test
- public void testAddDeleteToTxChain() throws Exception {
+ public void testAddDeleteToTxChain() {
final InstanceIdentifier<Nodes> dummyII = InstanceIdentifier.create(Nodes.class);
((DeviceContextImpl) deviceContext).getTransactionChainManager().activateTransactionManager() ;
((DeviceContextImpl) deviceContext).getTransactionChainManager().initialSubmitWriteTransaction();
}
@Test
- public void testSubmitTransaction() throws Exception {
+ public void testSubmitTransaction() {
((DeviceContextImpl) deviceContext).getTransactionChainManager().activateTransactionManager() ;
((DeviceContextImpl) deviceContext).getTransactionChainManager().initialSubmitWriteTransaction();
assertTrue(deviceContext.submitTransaction());
}
@Test
- public void testPortStatusMessage() throws Exception {
+ public void testPortStatusMessage() {
final PortStatusMessage mockedPortStatusMessage = mock(PortStatusMessage.class);
final Class dummyClass = Class.class;
when(mockedPortStatusMessage.getImplementedInterface()).thenReturn(dummyClass);
}
@Test
- public void testProcessFlowRemovedMessage() throws Exception {
+ public void testProcessFlowRemovedMessage() {
// prepare translation result
final FlowRemovedBuilder flowRemovedMdsalBld = new FlowRemovedBuilder()
.setTableId((short) 0)
}
@Test
- public void instantiateServiceInstance() throws Exception {
+ public void instantiateServiceInstance() {
deviceContext.instantiateServiceInstance();
}
@Test
- public void close() throws Exception {
+ public void close() {
deviceContext.close();
}
@Test
- public void closeServiceInstance() throws Exception {
+ public void closeServiceInstance() {
deviceContext.closeServiceInstance();
}
private DeviceManagerImpl deviceManager;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(mockConnectionContext.getFeatures()).thenReturn(mockFeatures);
when(mockConnectionContext.getConnectionAdapter()).thenReturn(mockedConnectionAdapter);
when(mockConnectionContext.getDeviceInfo()).thenReturn(deviceInfo);
}
@Test
- public void createContext() throws Exception {
+ public void createContext() {
final DeviceContext context = deviceManager.createContext(mockConnectionContext);
assertEquals(deviceInfo, context.getDeviceInfo());
}
@Test
- public void sendNodeAddedNotification() throws Exception {
+ public void sendNodeAddedNotification() {
deviceManager.sendNodeAddedNotification(DUMMY_IDENTIFIER);
deviceManager.sendNodeAddedNotification(DUMMY_IDENTIFIER);
verify(notificationPublishService).offerNotification(new NodeUpdatedBuilder()
}
@Test
- public void sendNodeRemovedNotification() throws Exception {
+ public void sendNodeRemovedNotification() {
deviceManager.sendNodeAddedNotification(DUMMY_IDENTIFIER);
deviceManager.sendNodeRemovedNotification(DUMMY_IDENTIFIER);
deviceManager.sendNodeRemovedNotification(DUMMY_IDENTIFIER);
private InOrder caOrdered;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
caOrdered = Mockito.inOrder(connectionAdapter);
rateLimiter = new PacketInRateLimiter(connectionAdapter, 4, 10, messageSpy, 0.5f);
}
@Test
- public void testDisableFlow() throws Exception {
+ public void testDisableFlow() {
rateLimiter.disableFlow();
Mockito.verify(messageSpy).spyMessage(DeviceContext.class, MessageSpy.StatisticsGroup.OFJ_BACKPRESSURE_ON);
}
@Test
- public void testEnableFlow() throws Exception {
+ public void testEnableFlow() {
rateLimiter.enableFlow();
Mockito.verify(messageSpy).spyMessage(DeviceContext.class, MessageSpy.StatisticsGroup.OFJ_BACKPRESSURE_OFF);
}
@Test
- public void testDrainLowWaterMark() throws Exception {
+ public void testDrainLowWaterMark() {
// scenario:
// occupy 4 permits
// drain low water mark = lwm temporarily set to 50% (= 2) and get limited
}
@Test
- public void testAcquirePermit() throws Exception {
+ public void testAcquirePermit() {
Assert.assertEquals(0, rateLimiter.getOccupiedPermits());
Assert.assertFalse(rateLimiter.isLimited());
}
@Test
- public void testChangeWaterMarks1() throws Exception {
+ public void testChangeWaterMarks1() {
rateLimiter.changeWaterMarks(2, 4);
acquirePermits(4);
Assert.assertEquals(4, rateLimiter.getOccupiedPermits());
}
@Test
- public void testChangeWaterMarks2() throws Exception {
+ public void testChangeWaterMarks2() {
// draining to lwm/occupied = 3/6
acquirePermits(6);
rateLimiter.drainLowWaterMark();
* and {@link SwitchFeaturesUtil SwitchFeaturesUtil}.
*/
@Before
- public void setUp() throws Exception {
+ public void setUp() {
featuresOutputBuilder = new GetFeaturesOutputBuilder();
swUtil = SwitchFeaturesUtil.getInstance();
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
featuresOutputBuilder = null;
swUtil = null;
}
private NodeId nodeId;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final ReadTransaction readOnlyTx = Mockito.mock(ReadTransaction.class);
Mockito.when(dataBroker.createTransactionChain(any(TransactionChainListener.class)))
.thenReturn(txChain);
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verifyNoMoreInteractions(txChain, writeTx);
}
@Test
- public void testWriteToTransaction() throws Exception {
+ public void testWriteToTransaction() {
final Node data = new NodeBuilder().setId(nodeId).build();
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
* Tests transaction submit {@link TransactionChainManager#submitTransaction()}.
*/
@Test
- public void testSubmitTransaction() throws Exception {
+ public void testSubmitTransaction() {
final Node data = new NodeBuilder().setId(nodeId).build();
txChainManager.initialSubmitWriteTransaction();
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
* test of {@link TransactionChainManager#submitTransaction()}: no submit, never enabled.
*/
@Test
- public void testSubmitTransaction1() throws Exception {
+ public void testSubmitTransaction1() {
final Node data = new NodeBuilder().setId(nodeId).build();
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
txChainManager.submitTransaction();
}
@Test
- public void testSubmitTransactionFailed() throws Exception {
+ public void testSubmitTransactionFailed() {
Mockito.doReturn(FluentFutures.immediateFailedFluentFuture(new TransactionCommitFailedException("mock")))
.when(writeTx).commit();
final Node data = new NodeBuilder().setId(nodeId).build();
* Test of {@link TransactionChainManager#enableSubmit()}: no submit - counter is not active.
*/
@Test
- public void testEnableCounter1() throws Exception {
+ public void testEnableCounter1() {
final Node data = new NodeBuilder().setId(nodeId).build();
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
}
@Test
- public void testOnTransactionChainFailed() throws Exception {
+ public void testOnTransactionChainFailed() {
txChainManager.onTransactionChainFailed(txChain, Mockito.mock(Transaction.class),
Mockito.mock(Throwable.class));
Mockito.verify(txChain).close();
}
@Test
- public void testOnTransactionChainSuccessful() throws Exception {
+ public void testOnTransactionChainSuccessful() {
txChainManager.onTransactionChainSuccessful(transactionChain);
// NOOP
Mockito.verifyZeroInteractions(transactionChain);
}
@Test
- public void testAddDeleteOperationTotTxChain() throws Exception {
+ public void testAddDeleteOperationTotTxChain() {
txChainManager.addDeleteOperationToTxChain(LogicalDatastoreType.CONFIGURATION, path);
Mockito.verify(txChain).newReadWriteTransaction();
}
@Test
- public void testDeactivateTransactionChainManager() throws Exception {
+ public void testDeactivateTransactionChainManager() {
txChainManager.deactivateTransactionManager();
Mockito.verify(txChain).close();
}
@Test
- public void testDeactivateTransactionChainManagerFailed() throws Exception {
+ public void testDeactivateTransactionChainManagerFailed() {
final Node data = new NodeBuilder().setId(nodeId).build();
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
}
@Test
- public void testShuttingDown() throws Exception {
+ public void testShuttingDown() {
final Node data = new NodeBuilder().setId(nodeId).build();
txChainManager.initialSubmitWriteTransaction();
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
private DeviceInitializerProvider provider;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
provider = new DeviceInitializerProvider();
}
@Test
- public void register() throws Exception {
+ public void register() {
provider.register(OFConstants.OFP_VERSION_1_3, abstractDeviceInitializer);
final Optional<AbstractDeviceInitializer> lookup = provider.lookup(OFConstants.OFP_VERSION_1_3);
assertTrue(lookup.isPresent());
}
@Test
- public void lookup() throws Exception {
+ public void lookup() {
assertFalse(provider.lookup(OFConstants.OFP_VERSION_1_0).isPresent());
}
private AbstractDeviceInitializer deviceInitializer;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final KeyedInstanceIdentifier<Node, NodeKey> nodeInstanceIdentifier = DeviceStateUtil
.createNodeInstanceIdentifier(new NodeId("openflow:1"));
private AbstractDeviceInitializer deviceInitializer;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final KeyedInstanceIdentifier<Node, NodeKey> nodeInstanceIdentifier = DeviceStateUtil
.createNodeInstanceIdentifier(new NodeId("openflow:1"));
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
// Pattern.DOTALL is set inline via "(?s)" at the beginning
Mockito.verify(console).print(matches("(?s).+"));
messageIntelligenceAgency.resetStatistics();
}
@Test
- public void addManager() throws Exception {
+ public void addManager() {
Assert.assertTrue(contextChainHolder.checkAllManagers());
}
@Test
- public void createContextChain() throws Exception {
+ public void createContextChain() {
contextChainHolder.createContextChain(connectionContext);
Mockito.verify(deviceManager).createContext(Mockito.any(ConnectionContext.class));
Mockito.verify(rpcManager).createContext(Mockito.any(DeviceContext.class));
@Test
- public void reconciliationFrameworkFailure() throws Exception {
+ public void reconciliationFrameworkFailure() {
Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
.thenReturn(Futures.immediateFailedFuture(new Throwable("test")));
contextChainHolder.createContextChain(connectionContext);
}
@Test
- public void reconciliationFrameworkDisconnect() throws Exception {
+ public void reconciliationFrameworkDisconnect() {
Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
.thenReturn(Futures.immediateFuture(ResultState.DISCONNECT));
contextChainHolder.createContextChain(connectionContext);
}
@Test
- public void reconciliationFrameworkSuccess() throws Exception {
+ public void reconciliationFrameworkSuccess() {
contextChainHolder.createContextChain(connectionContext);
Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
.thenReturn(Futures.immediateFuture(ResultState.DONOTHING));
}
@Test
- public void reconciliationFrameworkSuccessButNotSubmit() throws Exception {
+ public void reconciliationFrameworkSuccessButNotSubmit() {
contextChainHolder.createContextChain(connectionContext);
// TODO when if (future != null) check in MastershipChangeServiceManagerImpl's becomeSlaveOrDisconnect() is rm
// Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
private ContextChain contextChain;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
Mockito.when(deviceInfo.getServiceIdentifier()).thenReturn(SERVICE_GROUP_IDENTIFIER);
Mockito.when(deviceContext.closeServiceInstance()).thenReturn(Futures.immediateFuture(null));
}
@Test
- public void closeServiceInstance() throws Exception {
+ public void closeServiceInstance() {
contextChain.closeServiceInstance();
Mockito.verify(deviceContext).closeServiceInstance();
Mockito.verify(rpcContext).closeServiceInstance();
}
@Test
- public void close() throws Exception {
+ public void close() {
contextChain.registerDeviceRemovedHandler(deviceRemovedHandler);
contextChain.close();
Mockito.verify(statisticsContext).close();
}
@Test
- public void closeTwoTimes() throws Exception {
+ public void closeTwoTimes() {
contextChain.registerDeviceRemovedHandler(deviceRemovedHandler);
contextChain.close();
contextChain.close();
}
@Test
- public void closeThreeTimes() throws Exception {
+ public void closeThreeTimes() {
contextChain.registerDeviceRemovedHandler(deviceRemovedHandler);
contextChain.close();
contextChain.close();
}
@Test
- public void getIdentifier() throws Exception {
+ public void getIdentifier() {
Assert.assertEquals(contextChain.getIdentifier(), SERVICE_GROUP_IDENTIFIER);
}
@Test
- public void instantiateServiceInstanceFail() throws Exception {
+ public void instantiateServiceInstanceFail() {
Mockito.doThrow(new IllegalStateException()).when(deviceContext).instantiateServiceInstance();
contextChain.instantiateServiceInstance();
Mockito.verify(contextChainMastershipWatcher)
}
@Test
- public void register() throws Exception {
+ public void register() {
Assert.assertNotNull(registration);
}
@Test
- public void registerTwice() throws Exception {
+ public void registerTwice() {
MastershipChangeRegistration registration2;
registration2 = manager.register(secondService);
Assert.assertNotNull(registration);
}
@Test
- public void reconciliationFrameworkRegistration() throws Exception {
+ public void reconciliationFrameworkRegistration() {
Assert.assertNotNull(registrationRF);
}
}
@Test
- public void becomeMaster() throws Exception {
+ public void becomeMaster() {
manager.becomeMaster(deviceInfo);
Mockito.verify(service).onBecomeOwner(deviceInfo);
manager.becomeSlaveOrDisconnect(deviceInfo);
}
@Test
- public void becomeMasterBeforeDS() throws Exception {
+ public void becomeMasterBeforeDS() {
manager.becomeMasterBeforeSubmittedDS(deviceInfo);
Mockito.verify(event).onDevicePrepared(deviceInfo);
}
}
@Test
- public void evokeEventAfterRegistration() throws Exception {
+ public void evokeEventAfterRegistration() {
List<DeviceInfo> deviceInfos = new ArrayList<>();
deviceInfos.add(deviceInfo);
manager.setMasterChecker(masterChecker);
private MastershipServiceDelegate mastershipServiceDelegate;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
mastershipServiceDelegate = new MastershipServiceDelegate(mastershipChangeService, unregisterService);
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
verifyNoMoreInteractions(mastershipChangeService);
verifyNoMoreInteractions(unregisterService);
}
}
@Test
- public void onBecomeOwner() throws Exception {
+ public void onBecomeOwner() {
mastershipServiceDelegate.onBecomeOwner(deviceInfo);
verify(mastershipChangeService).onBecomeOwner(deviceInfo);
}
@Test
- public void onLoseOwnership() throws Exception {
+ public void onLoseOwnership() {
mastershipServiceDelegate.onLoseOwnership(deviceInfo);
verify(mastershipChangeService).onLoseOwnership(deviceInfo);
}
private DeserializationFactory factory;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
registry = new DeserializerRegistryImpl();
registry.init();
factory = new DeserializationFactory(registry);
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
DeserializerInjector.revertDeserializers(provider);
MessageDeserializerInjector.revertLegacyDeserializers(provider);
}
injector;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
injector = MessageDeserializerInjector.createInjector(switchConnectionProvider, EncodeConstants
.OF13_VERSION_ID);
}
@Test
- public void injectDeserializers() throws Exception {
+ public void injectDeserializers() {
injector.apply(10).apply(OfHeader.class).accept(ofDeserializer);
verify(switchConnectionProvider).unregisterDeserializerMapping(new TypeToClassKey(EncodeConstants
.OF13_VERSION_ID, 10));
public class CopyTtlInActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
writeHeader(in);
in.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
public class CopyTtlOutActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
writeHeader(in);
in.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
public class DecMplsTtlActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
writeHeader(in);
in.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
public class DecNwTtlActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
writeHeader(in);
in.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
public class GroupActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int groupId = 10;
writeHeader(in);
public class OutputActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int portNum = 10;
final short maxLength = 24;
public class PopMplsActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ethType = 10;
writeHeader(in);
public class PopPbbActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
writeHeader(in);
in.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
public class PopVlanActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
writeHeader(in);
in.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
public class PushMplsActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ethType = 10;
writeHeader(in);
public class PushPbbActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ethType = 10;
writeHeader(in);
public class PushVlanActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ethType = 10;
writeHeader(in);
public class SetFieldActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int portNum = 0xfffffffa;
writeHeader(in);
public class SetMplsTtlActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short mplsTtl = 10;
writeHeader(in);
public class SetNwTtlActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short nwTtl = 10;
writeHeader(in);
public class SetQueueActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int queueId = 10;
writeHeader(in);
}
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
// Header
public class ClearActionsInstructionDeserializerTest extends AbstractInstructionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
writeHeader(in);
in.writeZero(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
public class GoToTableInstructionDeserializerTest extends AbstractInstructionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short tableId = 3;
writeHeader(in);
public class MeterInstructionDeserializerTest extends AbstractInstructionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int meterId = 3;
writeHeader(in);
}
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
// Header
public class WriteMetadataInstructionDeserializerTest extends AbstractInstructionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final BigInteger metadata = BigInteger.valueOf(1234L);
final BigInteger metadataMask = BigInteger.valueOf(9876L);
public class ArpOpEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int arpOp = 10;
public class ArpSourceHardwareAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress arpSourceHardwareAddress = new MacAddress("00:01:02:03:04:05");
final MacAddress arpSourceHardwareAddressMask = new MacAddress("00:00:00:00:00:00");
public class ArpSourceTransportAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final Ipv4Prefix arpSourceTransportAddress = new Ipv4Prefix("192.168.0.0/24");
final Ipv4Prefix arpSourceTransportAddressNoMask = new Ipv4Prefix("192.168.0.0/32");
public class ArpTargetHardwareAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress arpTargetHardwareAddress = new MacAddress("00:01:02:03:04:05");
final MacAddress arpTargetHardwareAddressMask = new MacAddress("00:00:00:00:00:00");
public class ArpTargetTransportAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final Ipv4Prefix arpTargetTransportAddress = new Ipv4Prefix("192.168.0.0/24");
final Ipv4Prefix arpTargetTransportAddressNoMask = new Ipv4Prefix("192.168.0.0/32");
public class EthernetDestinationEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress ethernetDestinationAddress = new MacAddress("00:01:02:03:04:05");
final MacAddress ethernetDestinationAddressMask = new MacAddress("00:00:00:00:00:00");
public class EthernetSourceEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress ethernetSourceAddress = new MacAddress("00:01:02:03:04:05");
final MacAddress ethernetSourceAddressMask = new MacAddress("00:00:00:00:00:00");
public class EthernetTypeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int ethType = 0x800;
public class Icmpv4CodeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short code = 7;
public class Icmpv4TypeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short type = 7;
public class Icmpv6CodeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short code = 7;
public class Icmpv6TypeEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short type = 7;
public class InPhyPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int port = -6;
public class InPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int port = -6;
public class IpDscpEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ipDscp = 7;
public class IpEcnEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ipEcn = 7;
public class IpProtoEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ipProto = 7;
public class Ipv4DestinationEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final Ipv4Prefix address = new Ipv4Prefix("192.168.72.0/24");
final Iterator<String> addressParts = IpConversionUtil.splitToParts(address);
public class Ipv4SourceEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final Ipv4Prefix address = new Ipv4Prefix("192.168.72.0/24");
final Iterator<String> addressParts = IpConversionUtil.splitToParts(address);
public class Ipv6DestinationEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final Ipv6Prefix address = new Ipv6Prefix("fe80::200:f8ff:fe21:67cf/30");
public class Ipv6ExtHeaderEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int extHeader = 10;
final int extHeaderMask = 8;
public class Ipv6FlabelEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int flowLabel = 10;
final int flowLabelMask = 8;
public class Ipv6NdSllEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress address = new MacAddress("00:01:02:03:04:05");
public class Ipv6NdTargetEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final Ipv6Address address = new Ipv6Address("2001:db8::");
public class Ipv6NdTllEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress address = new MacAddress("00:01:02:03:04:05");
public class Ipv6SourceEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final Ipv6Prefix address = new Ipv6Prefix("fe80::200:f8ff:fe21:67cf/30");
public class MetadataEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final BigInteger metadata = BigInteger.valueOf(20);
final BigInteger metadataMask = BigInteger.valueOf(30);
public class MplsBosEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short mplsBos = 6;
public class MplsLabelEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int mplsLabel = 10;
public class MplsTcEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short mplsTc = 6;
public class PbbEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final long pbb = 6;
final long pbbMask = 5;
public class SctpDestinationPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int port = 22;
public class SctpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int port = 22;
public class TcpDestinationPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int port = 22;
public class TcpFlagsEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int tcpFlags = 6;
final int tcpFlagsMask = 5;
public class TcpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int port = 22;
public class TunnelIdEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final BigInteger tunnelId = BigInteger.valueOf(6);
final BigInteger tunnelIdMask = BigInteger.valueOf(5);
public class UdpDestinationPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int port = 22;
public class UdpSourcePortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int port = 22;
public class VlanPcpEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short vlanPcp = 7;
public class VlanVidEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int vlanVid = 8;
final byte[] vlanMask = new byte[]{16, 0};
}
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
// Flow header
buffer.writeByte(TYPE);
buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
}
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
// Group header
buffer.writeByte(TYPE);
buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
}
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
buffer.writeByte(TYPE); // Message type
buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
buffer.writeInt(XID);
}
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
buffer.writeByte(TYPE);
buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
buffer.writeInt(XID);
}
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
buffer.writeByte(TYPE);
buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
buffer.writeInt(XID);
private static final String DESCRIPTION = "Description";
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeBytes(MANUFACTURER.getBytes());
buffer.writeZero(DESC_STR_LEN - MANUFACTURER.length());
private static final byte PADDING_IN_MULTIPART_REPLY_HEADER = 4;
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeLong(PACKET_COUNT);
buffer.writeLong(BYTE_COUNT);
private static final int MPLS_LABEL = 135;
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
private static final byte PADDING_IN_TABLE_HEADER = 3;
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeByte(TABLE_ID);
buffer.writeZero(PADDING_IN_TABLE_HEADER);
private static final int WATCH_GROUP = 4;
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeShort(ITEM_LENGTH);
buffer.writeByte(GROUP_TYPE);
GroupCapabilities.ChainingChecks);
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
int bitMaskGroups = ByteBufUtils.fillBitMask(0,
GROUP_TYPES_SUPPORTED.contains(GroupTypes.GroupAll),
private static final long BYTE_COUNT = 2L;
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeShort(ITEM_LENGTH);
buffer.writeZero(PADDING_IN_GROUP_HEADER_01);
}
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeByte(TYPE);
buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
private static final byte PREC_LEVEL = 3;
@Test
- public void deserializeDrop() throws Exception {
+ public void deserializeDrop() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
writeCommonAtributes(buffer);
buffer.writeShort(OFPMBTDROP);
}
@Test
- public void deserializeDscp() throws Exception {
+ public void deserializeDscp() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
writeCommonAtributes(buffer);
buffer.writeShort(OFPMBTDSCP);
private static final byte MAX_COLOR = 48;
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeInt(MAX_METER);
private static final long BYTE_BAND_COUNT = 8L;
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeInt(METER_ID);
buffer.writeShort(ITEM_LENGTH);
private static final int MAXIMUM_SPEED = 10;
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeInt(PORT_NUMBER);
buffer.writeZero(PADDING_IN_PORT_DESC_HEADER_01);
private static final int NANOSECOND = 15;
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeInt(PORT);
buffer.writeZero(PADDING_IN_PORT_STATS_HEADER);
private static final int NANOSECOND = 15;
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
buffer.writeInt(PORT);
buffer.writeInt(QUEUE_ID);
private static final int OFPTFPT_APPLY_SETFIELD_MISS = 15;
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
writeValues(buffer, OFPTFPT_INSTRUCTIONS);
private TableFeaturesMatchFieldDeserializer deserializer = new TableFeaturesMatchFieldDeserializer();
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_OP);
private SerializerRegistry registry;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
registry = new SerializerRegistryImpl();
registry.init();
provider = new SerializerExtensionProviderImpl(registry);
private Function<Class<? extends Action>, Consumer<OFSerializer<? extends Action>>> injector;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
injector = ActionSerializerInjector.createInjector(switchConnectionProvider, EncodeConstants.OF13_VERSION_ID);
}
@Test
- public void injectSerializers() throws Exception {
+ public void injectSerializers() {
injector.apply(CopyTtlInCase.class).accept(actionSerializer);
verify(switchConnectionProvider).registerSerializer(
new MessageTypeKey<Object>(EncodeConstants.OF13_VERSION_ID, CopyTtlInCase.class),
private Function<Class<? extends Instruction>, Consumer<OFSerializer<? extends Instruction>>> injector;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
injector =
InstructionSerializerInjector.createInjector(switchConnectionProvider, EncodeConstants.OF13_VERSION_ID);
}
@Test
- public void injectSerializers() throws Exception {
+ public void injectSerializers() {
injector.apply(ApplyActionsCase.class).accept(instructionSerializer);
verify(switchConnectionProvider).registerSerializer(
new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, ApplyActionsCase.class),
}
@Test
- public void injectSerializers() throws Exception {
+ public void injectSerializers() {
injector.apply(OfHeader.class).accept(ofSerializer);
verify(switchConnectionProvider)
.registerSerializer(new MessageTypeKey<>(OFConstants.OFP_VERSION_1_3, OfHeader.class), ofSerializer);
public class CopyTtlInActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Action action = new CopyTtlInCaseBuilder()
.setCopyTtlIn(new CopyTtlInBuilder()
.build())
public class CopyTtlOutActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Action action = new CopyTtlOutCaseBuilder()
.setCopyTtlOut(new CopyTtlOutBuilder()
.build())
public class DecMplsTtlActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Action action = new DecMplsTtlCaseBuilder()
.setDecMplsTtl(new DecMplsTtlBuilder()
.build())
public class DecNwTtlActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Action action = new DecNwTtlCaseBuilder()
.setDecNwTtl(new DecNwTtlBuilder()
.build())
public class GroupActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long group = 10L;
final Action action = new GroupActionCaseBuilder()
public class OutputActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int length = 10;
final String port = OutputPortValues.LOCAL.toString();
public class PopMplsActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int ethType = 10;
final Action action = new PopMplsActionCaseBuilder()
public class PopPbbActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Action action = new PopPbbActionCaseBuilder()
.setPopPbbAction(new PopPbbActionBuilder()
.build())
public class PopVlanActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Action action = new PopVlanActionCaseBuilder()
.setPopVlanAction(new PopVlanActionBuilder()
.build())
public class PushMplsActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int ethType = 10;
final Action action = new PushMplsActionCaseBuilder()
public class PushPbbActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int ethType = 10;
final Action action = new PushPbbActionCaseBuilder()
public class PushVlanActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int ethType = 10;
final Action action = new PushVlanActionCaseBuilder()
public class SetDlDstActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final MacAddress address = new MacAddress("00:01:02:03:04:05");
final Action action = new SetDlDstActionCaseBuilder()
public class SetDlSrcActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final MacAddress address = new MacAddress("00:01:02:03:04:05");
final Action action = new SetDlSrcActionCaseBuilder()
public class SetMplsTtlActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short mpls = (short) 10;
final Action action = new SetMplsTtlActionCaseBuilder()
public class SetNwDstActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv4 address = new Ipv4Builder()
.setIpv4Address(new Ipv4Prefix("192.168.76.2/32"))
.build();
public class SetNwSrcActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv4 address = new Ipv4Builder()
.setIpv4Address(new Ipv4Prefix("192.168.76.2/32"))
.build();
public class SetNwTosActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int tos = 10;
final Action action = new SetNwTosActionCaseBuilder()
public class SetNwTtlActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short ttl = 10;
final Action action = new SetNwTtlActionCaseBuilder()
public class SetQueueActionSerializerTest extends AbstractActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long queue = 10;
final Action action = new SetQueueActionCaseBuilder()
public class SetTpDstActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final PortNumber port = new PortNumber(20);
final short protocol = 6; // TCP
public class SetTpSrcActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final PortNumber port = new PortNumber(20);
final short protocol = 6; // TCP
public class SetVlanIdActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int vlan = 1;
final Action action = new SetVlanIdActionCaseBuilder()
public class SetVlanPcpActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short vlan = 1;
final Action action = new SetVlanPcpActionCaseBuilder()
public class StripVlanActionSerializerTest extends AbstractSetFieldActionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Action action = new StripVlanActionCaseBuilder()
.setStripVlanAction(new StripVlanActionBuilder()
.build())
public class ApplyActionsInstructionSerializerTest extends AbstractInstructionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int order = 0;
final Ipv4Prefix prefix = new Ipv4Prefix("192.168.76.0/32");
public class ClearActionsInstructionSerializerTest extends AbstractInstructionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Instruction instruction = new ClearActionsCaseBuilder()
.setClearActions(new ClearActionsBuilder()
.build())
public class GoToTableInstructionSerializerTest extends AbstractInstructionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short table = 2;
final Instruction instruction = new GoToTableCaseBuilder()
public class MeterInstructionSerializerTest extends AbstractInstructionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long meter = 2;
final Instruction instruction = new MeterCaseBuilder()
public class WriteActionsInstructionSerializerTest extends AbstractInstructionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int order = 0;
final Ipv4Prefix prefix = new Ipv4Prefix("192.168.76.0/32");
public class WriteMetadataInstructionSerializerTest extends AbstractInstructionSerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long metadata = 10L;
final long metadataMask = 10L;
protected void assertMatch(final Match match,
final boolean hasMask,
- final Consumer<ByteBuf> assertBody) throws Exception {
+ final Consumer<ByteBuf> assertBody) {
final ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
getSerializer().serialize(match, buffer);
protected void assertMatch(final Match match,
final boolean hasMask,
- final Consumer<ByteBuf> assertBody) throws Exception {
+ final Consumer<ByteBuf> assertBody) {
final ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(match, buffer);
public class ArpOpEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int arpOp = 42;
final Match arpOpMatch = new MatchBuilder()
public class ArpSourceHardwareAddressEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final MacAddress address = new MacAddress("00:01:02:03:04:05");
final MacAddress mask = new MacAddress("00:00:00:00:00:00");
public class ArpSourceTransportAddressEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Match arpSpaMatch = new MatchBuilder()
.setLayer3Match(new ArpMatchBuilder()
.setArpSourceTransportAddress(new Ipv4Prefix("10.0.2.0/24"))
public class ArpTargetHardwareAddressEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final MacAddress address = new MacAddress("00:01:02:03:04:05");
final MacAddress mask = new MacAddress("00:00:00:00:00:00");
public class ArpTargetTransportAddressEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Match arpSpaMatch = new MatchBuilder()
.setLayer3Match(new ArpMatchBuilder()
.setArpTargetTransportAddress(new Ipv4Prefix("10.0.2.0/24"))
public class EthernetDestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final MacAddress address = new MacAddress("00:01:02:03:04:05");
final MacAddress mask = new MacAddress("00:00:00:00:00:00");
public class EthernetSourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final MacAddress address = new MacAddress("00:01:02:03:04:05");
final MacAddress mask = new MacAddress("00:00:00:00:00:00");
public class EthernetTypeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long ethType = 0xffffL;
final Match match = new MatchBuilder()
public class Icmpv4CodeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short code = 200;
final Match match = new MatchBuilder()
public class Icmpv4TypeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short type = 128;
final Match match = new MatchBuilder()
public class Icmpv6CodeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short code = 101;
final Match match = new MatchBuilder()
public class Icmpv6TypeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short type = 123;
final Match match = new MatchBuilder()
public class InPhyPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int port = 10122;
final Match match = new MatchBuilder()
public class InPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int port = 42;
final Match match = new MatchBuilder()
public class IpDscpEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short dscp = (short) 58;
final Match match = new MatchBuilder()
public class IpEcnEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short ecn = (short) 58;
final Match match = new MatchBuilder()
public class IpProtoEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short proto = (short) 6; // TCP
final Match match = new MatchBuilder()
public class Ipv4ArbitraryBitMaskDestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv4Address ipv4Address = new Ipv4Address("192.168.10.0");
final DottedQuad ipv4mask = new DottedQuad("255.255.255.0");
public class Ipv4ArbitraryBitMaskSourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv4Address ipv4Address = new Ipv4Address("192.168.10.0");
final DottedQuad ipv4mask = new DottedQuad("255.255.255.0");
public class Ipv4DestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Match ipv4match = new MatchBuilder()
.setLayer3Match(new Ipv4MatchBuilder()
.setIpv4Destination(new Ipv4Prefix("10.0.2.0/24"))
public class Ipv4SourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Match ipv4match = new MatchBuilder()
.setLayer3Match(new Ipv4MatchBuilder()
.setIpv4Source(new Ipv4Prefix("10.0.2.0/24"))
public class Ipv6ArbitraryBitMaskDestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv6Address ipv6Address = new Ipv6Address("aaaa:bbbb:1111:2222::");
final Ipv6ArbitraryMask ipv6mask = new Ipv6ArbitraryMask("ffff:ffff:ffff:ffff::");
public class Ipv6ArbitraryBitMaskSourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv6Address ipv6Address = new Ipv6Address("aaaa:bbbb:1111:2222::");
final Ipv6ArbitraryMask ipv6mask = new Ipv6ArbitraryMask("ffff:ffff:ffff:ffff::");
public class Ipv6DestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv6Prefix ipv6Address = new Ipv6Prefix("2001:db8::/32");
final Match ipv6abmMatch = new MatchBuilder()
}
@Test
- public void testSerializeWithoutMask() throws Exception {
+ public void testSerializeWithoutMask() {
final Ipv6Prefix ipv6Address = new Ipv6Prefix("2001:db8::123/128");
final Match ipv6abmMatch = new MatchBuilder()
public class Ipv6ExtHeaderEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int ipv6extHdr = 358;
final int ipv6extHdrMask = 100;
public class Ipv6LabelEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long ipv6flowLabel = 358;
final long ipv6flowLabelMask = 100;
public class Ipv6NdSllEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final MacAddress ipv6NdSll = new MacAddress("00:01:02:03:04:05");
final Match ipv6NdSllMatch = new MatchBuilder()
public class Ipv6NdTargetEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv6Address ipv6NdTarget = new Ipv6Address("2001:db8::");
final Match ipv6NdTargetMatch = new MatchBuilder()
public class Ipv6NdTllEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final MacAddress ipv6NdTll = new MacAddress("00:01:02:03:04:05");
final Match ipv6NdTllMatch = new MatchBuilder()
public class Ipv6SourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Ipv6Prefix ipv6Address = new Ipv6Prefix("2001:db8::/32");
final Match ipv6abmMatch = new MatchBuilder()
}
@Test
- public void testSerializeWithoutMask() throws Exception {
+ public void testSerializeWithoutMask() {
final Ipv6Prefix ipv6Address = new Ipv6Prefix("2001:db8::123/128");
final Match ipv6abmMatch = new MatchBuilder()
public class MetadataEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final byte[] metadata = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 };
final byte[] metadataMask = new byte[] { 30, 30, 30, 30, 30, 0, 0, 0 };
public class MplsBosEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short mplsBos = (short) 1;
final Match mplsBosMatch = new MatchBuilder()
public class MplsLabelEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long mplsLabel = 10L;
final Match mplsLabelMatch = new MatchBuilder()
public class MplsTcEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short mplsTc = (short) 1;
final Match mplsTcMatch = new MatchBuilder()
public class PacketTypeEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void serializeTest() throws Exception {
+ public void serializeTest() {
final long packetType = 0x1894f;
PacketTypeMatch packetTypeMatch = new PacketTypeMatchBuilder().setPacketType(packetType).build();
public class PbbEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long pbbId = 6789;
final byte[] pbbIdMask = new byte[] { 0, 15, 10 };
public class SctpDestinationPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int sctp = 10;
final Match sctpMatch = new MatchBuilder()
public class SctpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int sctp = 10;
final Match sctpMatch = new MatchBuilder()
public class TcpDestinationPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int tcp = 10;
final Match sctpMatch = new MatchBuilder()
public class TcpFlagsEntrySerializerTest extends AbstractExperimenterMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int tcp = 8;
final byte[] tcpMask = new byte[] { 30, 30 };
public class TcpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int tcp = 10;
final Match sctpMatch = new MatchBuilder()
public class TunnelIdEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final long tunnelId = 8;
final byte[] tcpMask = new byte[] { 30, 30, 30, 30, 0, 0, 0, 0 };
public class TunnelIpv4DestinationEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Match ipv4match = new MatchBuilder()
.setLayer3Match(new TunnelIpv4MatchBuilder()
.setTunnelIpv4Destination(new Ipv4Prefix("10.0.2.0/24"))
public class TunnelIpv4SourceEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Match ipv4match = new MatchBuilder()
.setLayer3Match(new TunnelIpv4MatchBuilder()
.setTunnelIpv4Source(new Ipv4Prefix("10.0.2.0/24"))
public class UdpDestinationPortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int tcp = 10;
final Match sctpMatch = new MatchBuilder()
public class UdpSourcePortEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int tcp = 10;
final Match sctpMatch = new MatchBuilder()
public class VlanPcpEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short vlan = (short) 1;
final Match vlanMatch = new MatchBuilder()
public class VlanVidEntrySerializerTest extends AbstractMatchEntrySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final int vlan = (short) 1;
final Match vlanMatch = new MatchBuilder()
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(MESSAGE, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(MESSAGE, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(MESSAGE, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(MESSAGE, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(MESSAGE, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
assertEquals(out.readableBytes(), 0);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
assertEquals(out.readableBytes(), 0);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
assertEquals(out.readableBytes(), 0);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
assertEquals(out.readableBytes(), 0);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(MESSAGE, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
assertEquals(out.readableBytes(), 0);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
assertEquals(out.readableBytes(), 0);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
}
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(BODY, out);
public class ApplyActionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ApplyActionsMiss property = new ApplyActionsMissBuilder()
.setApplyActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight
.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.miss
public class ApplyActionsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ApplyActions property = new ApplyActionsBuilder()
.setApplyActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
.prop.type.table.feature.prop.type.apply.actions
public class ApplySetfieldMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ApplySetfieldMiss property = new ApplySetfieldMissBuilder()
.setApplySetfieldMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight
.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss
public class ApplySetfieldTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final ApplySetfield property = new ApplySetfieldBuilder()
.setApplySetfield(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
.prop.type.table.feature.prop.type.apply.setfield
public class InstructionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final InstructionsMiss property = new InstructionsMissBuilder()
.setInstructionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight
.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss
public class InstructionsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Instructions property = new InstructionsBuilder()
.setInstructions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
.prop.type.table.feature.prop.type.instructions
public class MatchTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Match property = new MatchBuilder()
.setMatchSetfield(new MatchSetfieldBuilder()
.setSetFieldMatch(ImmutableList
public class NextTableMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short tableId = 42;
final NextTableMiss property = new NextTableMissBuilder()
.setTablesMiss(new TablesMissBuilder()
public class NextTableTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final short tableId = 42;
final NextTable property = new NextTableBuilder()
.setTables(new TablesBuilder()
public class WildcardsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Wildcards property = new WildcardsBuilder()
.setWildcardSetfield(new WildcardSetfieldBuilder()
.setSetFieldMatch(ImmutableList
public class WriteActionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final WriteActionsMiss property = new WriteActionsMissBuilder()
.setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight
.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss
public class WriteActionsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final WriteActions property = new WriteActionsBuilder()
.setWriteActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
.prop.type.table.feature.prop.type.write.actions
public class WriteSetfieldMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final WriteSetfieldMiss property = new WriteSetfieldMissBuilder()
.setWriteSetfieldMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight
.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss
public class WriteSetfieldTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final WriteSetfield property = new WriteSetfieldBuilder()
.setWriteSetfield(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
.prop.type.table.feature.prop.type.write.setfield
public class MatchFieldSerializerTest extends AbstractTablePropertySerializerTest {
@Test
- public void testSerialize() throws Exception {
+ public void testSerialize() {
final Match property = new MatchBuilder()
.setMatchSetfield(new MatchSetfieldBuilder()
.setSetFieldMatch(ImmutableList
private ReadTransaction readOnlyTransaction;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
nodeInstanceIdentifier =
InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(new NodeId(NODE_ID)));
when(dataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction);
}
@Test
- public void testRetrieveIdForFlow() throws Exception {
+ public void testRetrieveIdForFlow() {
Assert.assertEquals(descriptor, deviceFlowRegistry.retrieveDescriptor(key));
}
@Test
- public void testStore() throws Exception {
+ public void testStore() {
//store the same key with different value
final FlowDescriptor descriptor2 = FlowDescriptorFactory.create(key.getTableId(), new FlowId("ut:2"));
deviceFlowRegistry.storeDescriptor(key, descriptor2);
}
@Test
- public void testStoreIfNecessary() throws Exception {
+ public void testStoreIfNecessary() {
FlowId newFlowId;
//store existing key
}
@Test
- public void testRemoveDescriptor() throws Exception {
+ public void testRemoveDescriptor() {
deviceFlowRegistry.addMark(key);
Assert.assertEquals(0, deviceFlowRegistry.getAllFlowDescriptors().size());
}
@Test
- public void testClose() throws Exception {
+ public void testClose() {
deviceFlowRegistry.close();
Assert.assertEquals(0, deviceFlowRegistry.getAllFlowDescriptors().size());
}
@Test
- public void createAlienFlowIdTest() throws Exception {
+ public void createAlienFlowIdTest() {
final String alienFlowId1 = DeviceFlowRegistryImpl.createAlienFlowId(DUMMY_TABLE_ID).getValue();
final Integer index1 = parseIndex(alienFlowId1);
final String alienFlowId2 = DeviceFlowRegistryImpl.createAlienFlowId(DUMMY_TABLE_ID).getValue();
}
@Test
- public void testForEach() throws Exception {
+ public void testForEach() {
final AtomicInteger counter = new AtomicInteger(0);
deviceFlowRegistry.forEach(k -> counter.incrementAndGet());
Assert.assertEquals(1, counter.get());
public class FlowDescriptorDtoTest {
@Test
- public void testCreate() throws Exception {
+ public void testCreate() {
final FlowDescriptor flowDescriptor = FlowDescriptorFactory.create((short) 1, new FlowId("unit:1"));
Assert.assertNotNull(flowDescriptor);
Assert.assertNotNull(flowDescriptor.getFlowId());
@Test(expected = Exception.class)
@SuppressFBWarnings("NP_NONNULL_PARAM_VIOLATION") // that is the point of this test
- public void testCreateNegative1() throws Exception {
+ public void testCreateNegative1() {
FlowDescriptorFactory.create((short) 1, null);
}
}
}
@Test
- public void testEquals() throws Exception {
+ public void testEquals() {
FlowsStatisticsUpdate flowStats = FLOWS_STATISTICS_UPDATE_BUILDER.build();
HashSet<FlowRegistryKey> flowRegistryKeys = new HashSet<>();
}
@Test
- public void testEqualsNegative() throws Exception {
+ public void testEqualsNegative() {
final FlowAndStatisticsMapList flowStatisticsMapList1 =
TestFlowHelper.createFlowAndStatisticsMapListBuilder(1).build();
final FlowRegistryKey key1 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flowStatisticsMapList1);
}
@Test
- public void testGetHash2() throws Exception {
+ public void testGetHash2() {
MatchBuilder match1Builder = new MatchBuilder().setLayer3Match(new Ipv4MatchBuilder()
.setIpv4Destination(new Ipv4Prefix("10.0.1.157/32")).build());
FlowBuilder flow1Builder = new FlowBuilder()
}
@Test
- public void testGetHashNPE() throws Exception {
+ public void testGetHashNPE() {
MatchBuilder match1Builder = new MatchBuilder().setLayer3Match(new Ipv4MatchBuilder()
.setIpv4Destination(new Ipv4Prefix("10.0.1.157/32")).build());
FlowBuilder flow1Builder = new FlowBuilder()
}
@Test
- public void testGetHash() throws Exception {
+ public void testGetHash() {
FlowsStatisticsUpdate flowStats = FLOWS_STATISTICS_UPDATE_BUILDER.build();
for (FlowAndStatisticsMapList item : flowStats.getFlowAndStatisticsMapList()) {
private DeviceGroupRegistryImpl deviceGroupRegistry;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
deviceGroupRegistry = new DeviceGroupRegistryImpl();
groupId = new GroupId(42L);
groupId2 = new GroupId(84L);
}
@Test
- public void testStore() throws Exception {
+ public void testStore() {
deviceGroupRegistry.store(groupId2);
Assert.assertEquals(2, deviceGroupRegistry.getAllGroupIds().size());
}
@Test
- public void testRemoveMarked() throws Exception {
+ public void testRemoveMarked() {
deviceGroupRegistry.addMark(groupId);
deviceGroupRegistry.processMarks();
Assert.assertEquals(0, deviceGroupRegistry.getAllGroupIds().size());
}
@Test
- public void testRemoveMarkedNegative() throws Exception {
+ public void testRemoveMarkedNegative() {
deviceGroupRegistry.addMark(groupId2);
deviceGroupRegistry.processMarks();
Assert.assertEquals(1, deviceGroupRegistry.getAllGroupIds().size());
}
@Test
- public void testClose() throws Exception {
+ public void testClose() {
deviceGroupRegistry.addMark(groupId);
deviceGroupRegistry.close();
}
@Test
- public void testForEach() throws Exception {
+ public void testForEach() {
final AtomicInteger counter = new AtomicInteger(0);
deviceGroupRegistry.store(groupId2);
deviceGroupRegistry.forEach(group -> counter.incrementAndGet());
private DeviceMeterRegistryImpl deviceMeterRegistry;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
deviceMeterRegistry = new DeviceMeterRegistryImpl();
meterId = new MeterId(42L);
meterId2 = new MeterId(84L);
}
@Test
- public void testStore() throws Exception {
+ public void testStore() {
deviceMeterRegistry.store(meterId2);
Assert.assertEquals(2, deviceMeterRegistry.getAllMeterIds().size());
}
@Test
- public void testRemoveMarked() throws Exception {
+ public void testRemoveMarked() {
deviceMeterRegistry.addMark(meterId);
deviceMeterRegistry.processMarks();
Assert.assertEquals(0, deviceMeterRegistry.getAllMeterIds().size());
}
@Test
- public void testRemoveMarkedNegative() throws Exception {
+ public void testRemoveMarkedNegative() {
deviceMeterRegistry.addMark(meterId2);
deviceMeterRegistry.processMarks();
Assert.assertEquals(1, deviceMeterRegistry.getAllMeterIds().size());
}
@Test
- public void testClose() throws Exception {
+ public void testClose() {
deviceMeterRegistry.addMark(meterId);
deviceMeterRegistry.close();
}
@Test
- public void testForEach() throws Exception {
+ public void testForEach() {
final AtomicInteger counter = new AtomicInteger(0);
deviceMeterRegistry.store(meterId2);
deviceMeterRegistry.forEach(meter -> counter.incrementAndGet());
private RoleContext roleContext;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(DeviceStateUtil
.createNodeInstanceIdentifier(new NodeId("openflow:1")));
when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
roleContext.close();
}
@Test
- public void instantiateServiceInstance() throws Exception {
+ public void instantiateServiceInstance() {
roleContext.instantiateServiceInstance();
verify(roleService).setRole(new SetRoleInputBuilder()
.setControllerRole(OfpRole.BECOMEMASTER)
}
@Test
- public void testCreateRequestFuture() throws Exception {
+ public void testCreateRequestFuture() {
Future<?> future = requestContext.getFuture();
assertNotNull(future);
}
}
@Test
- public void testStoreOrFail() throws Exception {
+ public void testStoreOrFail() {
try (RpcContext rpcContext = new RpcContextImpl(
rpcProviderRegistry,
100,
}
@Test
- public void testStoreOrFailThatFails() throws Exception {
+ public void testStoreOrFailThatFails() {
try (RpcContext rpcContext = new RpcContextImpl(
rpcProviderRegistry,
0,
}
@Test
- public void testStoreAndCloseOrFail() throws Exception {
+ public void testStoreAndCloseOrFail() {
try (RpcContext rpcContext = new RpcContextImpl(
rpcProviderRegistry,
100,
* When deviceContext.reserveXidForDeviceMessage returns null, null should be returned.
*/
@Test
- public void testCreateRequestContext1() throws InterruptedException {
+ public void testCreateRequestContext1() {
when(deviceInfo.reserveXidForDeviceMessage()).thenReturn(null);
assertEquals(rpcContext.createRequestContext(),null);
}
*/
@Test
- public void testCreateRequestContext2() throws InterruptedException {
+ public void testCreateRequestContext2() {
RequestContext temp = rpcContext.createRequestContext();
temp.close();
verify(messageSpy).spyMessage(RpcContextImpl.class, MessageSpy.StatisticsGroup.REQUEST_STACK_FREED);
}
@Test
- public void createContext() throws Exception {
+ public void createContext() {
final RpcContext context = rpcManager.createContext(deviceContext);
assertEquals(deviceInfo, context.getDeviceInfo());
}
}
@Test
- public void testSendEcho() throws Exception {
+ public void testSendEcho() {
EchoInputBuilder sendEchoInput = new EchoInputBuilder();
echoService.handleServiceCall(sendEchoInput);
verify(mockedRequestContextStack).createRequestContext();
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
EchoInputBuilder sendEchoInput = new EchoInputBuilder().setData(DUMMY_DATA);
final OfHeader request = this.echoService.buildRequest(new Xid(DUMMY_XID_VALUE), sendEchoInput);
assertEquals(DUMMY_XID_VALUE, request.getXid());
private AbstractMultipartRequestCallback<MultipartReply> multipartRequestCallback;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.doNothing().when(requestContext).setResult(rpcResultCapt.capture());
Mockito.when(deviceContext.getMessageSpy()).thenReturn(spy);
* End collecting.
*/
@Test
- public void testOnSuccess1() throws Exception {
+ public void testOnSuccess1() {
multipartRequestCallback.onSuccess(null);
Mockito.verify(multiMsgCollector).endCollecting(ArgumentMatchers.any());
}
* Fail adding to collection.
*/
@Test
- public void testOnSuccess2() throws Exception {
+ public void testOnSuccess2() {
multipartRequestCallback.onSuccess(new EchoOutputBuilder().build());
final RpcResult<List<MultipartReply>> rpcResult = rpcResultCapt.getValue();
Assert.assertNotNull(rpcResult);
* Successfully added to collection.
*/
@Test
- public void testOnSuccess3() throws Exception {
+ public void testOnSuccess3() {
final MultipartReplyMessage replyMessage = new MultipartReplyMessageBuilder().build();
multipartRequestCallback.onSuccess(replyMessage);
Mockito.verify(multiMsgCollector)
* Not the last reply.
*/
@Test
- public void testOnSuccessWithValidMultipart1() throws Exception {
+ public void testOnSuccessWithValidMultipart1() {
final MatchBuilder matchBuilder = new MatchBuilder()
.setMatchEntry(Collections.emptyList());
final FlowStatsBuilder flowStatsBuilder = new FlowStatsBuilder()
@Before
@SuppressWarnings("unchecked")
- public void initialization() throws Exception {
+ public void initialization() {
lenient().when(mockedExtensionConverter.getExperimenterId())
.thenReturn(new ExperimenterId(DUMMY_EXPERIMENTER_ID));
lenient().when(mockedExtensionConverterProvider.getMessageConverter(Matchers.<TypeVersionKey>any()))
setup();
}
- protected void setup() throws Exception {
+ protected void setup() {
//NOOP - to be overloaded
}
private static final NodeRef NODE_REF = new NodeRef(NODE_II);
@Test
- public void testAdaptFlatBatchAddFlow() throws Exception {
+ public void testAdaptFlatBatchAddFlow() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_ADD);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testAdaptFlatBatchRemoveFlow() throws Exception {
+ public void testAdaptFlatBatchRemoveFlow() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_REMOVE);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testAdaptFlatBatchUpdateFlow() throws Exception {
+ public void testAdaptFlatBatchUpdateFlow() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_UPDATE);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testCreateBatchFlowChainingFunction_failures() throws Exception {
+ public void testCreateBatchFlowChainingFunction_failures() {
final RpcResult<BatchFlowOutputListGrouping> input = RpcResultBuilder.<BatchFlowOutputListGrouping>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-flowError")
.withResult(new AddFlowsBatchOutputBuilder()
}
@Test
- public void testCreateBatchFlowChainingFunction_successes() throws Exception {
+ public void testCreateBatchFlowChainingFunction_successes() {
final RpcResult<BatchFlowOutputListGrouping> input = RpcResultBuilder
.<BatchFlowOutputListGrouping>success(new AddFlowsBatchOutputBuilder().build())
.build();
private static final NodeRef NODE_REF = new NodeRef(NODE_II);
@Test
- public void testAdaptFlatBatchAddGroup() throws Exception {
+ public void testAdaptFlatBatchAddGroup() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_ADD);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testAdaptFlatBatchRemoveGroup() throws Exception {
+ public void testAdaptFlatBatchRemoveGroup() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_REMOVE);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testAdaptFlatBatchUpdateGroup() throws Exception {
+ public void testAdaptFlatBatchUpdateGroup() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_UPDATE);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testCreateBatchGroupChainingFunction_failures() throws Exception {
+ public void testCreateBatchGroupChainingFunction_failures() {
final RpcResult<BatchGroupOutputListGrouping> input = RpcResultBuilder.<BatchGroupOutputListGrouping>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-groupError")
.withResult(new AddGroupsBatchOutputBuilder()
}
@Test
- public void testCreateBatchGroupChainingFunction_successes() throws Exception {
+ public void testCreateBatchGroupChainingFunction_successes() {
final RpcResult<BatchGroupOutputListGrouping> input = RpcResultBuilder
.<BatchGroupOutputListGrouping>success(new AddGroupsBatchOutputBuilder().build())
.build();
private static final NodeRef NODE_REF = new NodeRef(NODE_II);
@Test
- public void testAdaptFlatBatchAddMeter() throws Exception {
+ public void testAdaptFlatBatchAddMeter() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_ADD);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testAdaptFlatBatchRemoveMeter() throws Exception {
+ public void testAdaptFlatBatchRemoveMeter() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_REMOVE);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testAdaptFlatBatchUpdateMeter() throws Exception {
+ public void testAdaptFlatBatchUpdateMeter() {
final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_UPDATE);
planStep.setBarrierAfter(true);
planStep.getTaskBag().addAll(Lists.newArrayList(
}
@Test
- public void testCreateBatchMeterChainingFunction_failures() throws Exception {
+ public void testCreateBatchMeterChainingFunction_failures() {
final RpcResult<BatchMeterOutputListGrouping> input = RpcResultBuilder.<BatchMeterOutputListGrouping>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-meterError")
.withResult(new AddMetersBatchOutputBuilder()
}
@Test
- public void testCreateBatchMeterChainingFunction_successes() throws Exception {
+ public void testCreateBatchMeterChainingFunction_successes() {
final RpcResult<BatchMeterOutputListGrouping> input = RpcResultBuilder
.<BatchMeterOutputListGrouping>success(new AddMetersBatchOutputBuilder().build())
.build();
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
SendBarrierInput sendBarrierInput = buildSendBarrierInput();
final OfHeader request = flowCapableTransactionService.buildRequest(new Xid(DUMMY_XID_VALUE), sendBarrierInput);
}
@Test
- public void testSendBarrier() throws Exception {
+ public void testSendBarrier() {
SendBarrierInput sendBarrierInput = buildSendBarrierInput();
flowCapableTransactionService.sendBarrier(sendBarrierInput);
verify(mockedRequestContextStack).createRequestContext();
NodeConfigServiceImpl nodeConfigService;
@Test
- public void testSetConfig() throws Exception {
+ public void testSetConfig() {
nodeConfigService = new NodeConfigServiceImpl(mockedRequestContextStack, mockedDeviceContext);
nodeConfigService.setConfig(dummyConfigInput());
verify(mockedRequestContextStack).createRequestContext();
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
nodeConfigService = new NodeConfigServiceImpl(mockedRequestContextStack, mockedDeviceContext);
final OfHeader request = nodeConfigService.buildRequest(new Xid(DUMMY_XID_VALUE), dummyConfigInput());
}
@Test
- public void testTransmitPacket() throws Exception {
+ public void testTransmitPacket() {
TransmitPacketInput transmitPacketInput = buildTransmitPacketInput();
packetProcessingService.transmitPacket(transmitPacketInput);
verify(mockedRequestContextStack).createRequestContext();
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
TransmitPacketInput transmitPacketInput = buildTransmitPacketInput();
final OfHeader request = packetProcessingService.buildRequest(new Xid(DUMMY_XID_VALUE), transmitPacketInput);
private SalAsyncConfigServiceImpl salAsyncConfigService;
@Override
- public void setup() throws Exception {
+ public void setup() {
salAsyncConfigService = new SalAsyncConfigServiceImpl(
mockedRequestContextStack, mockedDeviceContext);
}
}
@Test
- public void testAddBundleMessages() throws Exception {
+ public void testAddBundleMessages() {
final List<Message> innerMessages = createMessages();
final Messages messages = new MessagesBuilder().setMessage(innerMessages).build();
final AddBundleMessagesInput input = new AddBundleMessagesInputBuilder()
}
@Test
- public void testSendExperimenter() throws Exception {
+ public void testSendExperimenter() {
SendExperimenterInput sendExperimenterInput = buildSendExperimenterInput();
salExperimenterMessageService.sendExperimenter(sendExperimenterInput);
verify(mockedRequestContextStack).createRequestContext();
}
@Test
- public void sendExperimenterMpRequest() throws Exception {
+ public void sendExperimenterMpRequest() {
final SendExperimenterMpRequestInput data = new SendExperimenterMpRequestInputBuilder()
.setExperimenterMessageOfChoice(mockExperimenter())
.setNode(new NodeRef(mockedDeviceInfo.getNodeInstanceIdentifier()))
private SalFlatBatchServiceImpl salFlatBatchService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
salFlatBatchService =
new SalFlatBatchServiceImpl(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verifyNoMoreInteractions(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
}
public static final String FLOW_ID_VALUE_2 = "ut-dummy-flow2";
@Before
- public void setUp() throws Exception {
+ public void setUp() {
salFlowsBatchService = new SalFlowsBatchServiceImpl(salFlowService, transactionService);
Mockito.when(transactionService.sendBarrier(ArgumentMatchers.any()))
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verifyNoMoreInteractions(salFlowService, transactionService);
}
}
@Test
- public void testAddGroup() throws Exception {
+ public void testAddGroup() {
addGroup();
}
}
@Test
- public void testUpdateGroup() throws Exception {
+ public void testUpdateGroup() {
updateGroup();
}
@Test
- public void testUpdateGroupWithItemLifecycle() throws Exception {
+ public void testUpdateGroupWithItemLifecycle() {
updateGroup();
}
}
@Test
- public void testRemoveGroup() throws Exception {
+ public void testRemoveGroup() {
removeGroup();
}
@Test
- public void testRemoveGroupWithItemLifecycle() throws Exception {
+ public void testRemoveGroupWithItemLifecycle() {
removeGroup();
}
- private void removeGroup() throws Exception {
+ private void removeGroup() {
final GroupId dummyGroupId = new GroupId(DUMMY_GROUP_ID);
RemoveGroupInput removeGroupInput = new RemoveGroupInputBuilder().setGroupId(dummyGroupId).build();
this.<RemoveGroupOutput>mockSuccessfulFuture();
@Before
- public void setUp() throws Exception {
+ public void setUp() {
salGroupsBatchService = new SalGroupsBatchServiceImpl(salGroupService, transactionService);
Mockito.when(transactionService.sendBarrier(ArgumentMatchers.any()))
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verifyNoMoreInteractions(salGroupService, transactionService);
}
}
@Test
- public void testAddMeter() throws Exception {
+ public void testAddMeter() {
addMeter();
}
}
@Test
- public void testUpdateMeter() throws Exception {
+ public void testUpdateMeter() {
updateMeter();
}
- private void updateMeter() throws Exception {
+ private void updateMeter() {
final UpdatedMeter dummyUpdatedMeter =
new UpdatedMeterBuilder().setMeterId(new MeterId(DUMMY_METTER_ID)).build();
final OriginalMeter dummyOriginalMeter =
}
@Test
- public void testRemoveMeter() throws Exception {
+ public void testRemoveMeter() {
removeMeter();
}
- private void removeMeter() throws Exception {
+ private void removeMeter() {
final MeterId dummyMeterId = new MeterId(DUMMY_METER_ID);
RemoveMeterInput removeMeterInput = new RemoveMeterInputBuilder().setMeterId(dummyMeterId).build();
this.<RemoveMeterOutput>mockSuccessfulFuture();
private SalMetersBatchServiceImpl salMetersBatchService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
salMetersBatchService = new SalMetersBatchServiceImpl(salMeterService, transactionService);
Mockito.when(transactionService.sendBarrier(any()))
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verifyNoMoreInteractions(salMeterService, transactionService);
}
}
@Test
- public void testUpdatePort() throws Exception {
+ public void testUpdatePort() {
salPortService.updatePort(dummyUpdatePortInput());
verify(mockedRequestContextStack).createRequestContext();
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
final OfHeader ofHeader = salPortService.buildRequest(new Xid(DUMMY_XID), dummyUpdatePortInput());
}
import com.google.common.util.concurrent.SettableFuture;
import java.util.Collections;
import java.util.List;
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.junit.Assert;
import org.junit.Test;
}
@Test
- public void testUpdateTableFail1() throws ExecutionException, InterruptedException {
+ public void testUpdateTableFail1() {
Mockito.doAnswer((Answer<Void>) invocation -> {
final RpcResult<List<MultipartReply>> rpcResult =
RpcResultBuilder.<List<MultipartReply>>failed().build();
}
@Test
- public void testUpdateTableFail2() throws ExecutionException, InterruptedException {
+ public void testUpdateTableFail2() {
Mockito.doAnswer((Answer<Void>) invocation -> {
final RpcResult<List<MultipartReply>> rpcResult =
RpcResultBuilder.success(Collections.<MultipartReply>emptyList())
}
@Test
- public void testUpdateTableSuccess() throws ExecutionException, InterruptedException {
+ public void testUpdateTableSuccess() {
Mockito.doAnswer((Answer<Void>) invocation -> {
TableFeaturesBuilder tableFeaturesBld = new TableFeaturesBuilder()
.setTableId((short) 0)
private SingleLayerAggregateFlowMultipartService service;
@Override
- protected void setup() throws Exception {
+ protected void setup() {
service = new SingleLayerAggregateFlowMultipartService(mockedRequestContextStack, mockedDeviceContext);
}
@Test
- public void buildRequest() throws Exception {
+ public void buildRequest() {
final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input = new
GetAggregateFlowStatisticsFromFlowTableForGivenMatchInputBuilder()
.setTableId(TABLE_ID)
private SingleLayerExperimenterMultipartService service;
@Override
- protected void setup() throws Exception {
+ protected void setup() {
service = new SingleLayerExperimenterMultipartService(
mockedRequestContextStack, mockedDeviceContext,
mockedExtensionConverterProvider);
}
@Test
- public void buildRequest() throws Exception {
+ public void buildRequest() {
final SendExperimenterMpRequestInput input = new SendExperimenterMpRequestInputBuilder()
.setExperimenterMessageOfChoice(mockExperimenter())
.build();
private SingleLayerFlowService<AddFlowOutput> service;
@Override
- protected void setup() throws Exception {
+ protected void setup() {
service = new SingleLayerFlowService<>(mockedRequestContextStack,
mockedDeviceContext, AddFlowOutput.class);
}
@Test
- public void buildRequest() throws Exception {
+ public void buildRequest() {
final AddFlowInput input = new AddFlowInputBuilder()
.setTableId(TABLE_ID)
.build();
private SingleLayerGroupService<AddGroupOutput> service;
@Override
- protected void setup() throws Exception {
+ protected void setup() {
service = new SingleLayerGroupService<>(mockedRequestContextStack,
mockedDeviceContext, AddGroupOutput.class);
}
@Test
- public void buildRequest() throws Exception {
+ public void buildRequest() {
final AddGroupInput input = new AddGroupInputBuilder()
.setGroupId(new GroupId(GROUP_ID))
.build();
private SingleLayerMeterService<AddMeterOutput> service;
@Override
- protected void setup() throws Exception {
+ protected void setup() {
service = new SingleLayerMeterService<>(mockedRequestContextStack,
mockedDeviceContext, AddMeterOutput.class);
}
@Test
- public void buildRequest() throws Exception {
+ public void buildRequest() {
final AddMeterInput input = new AddMeterInputBuilder()
.setMeterId(new MeterId(METER_ID))
.build();
private SingleLayerPortService<UpdatePortOutput> service;
@Override
- protected void setup() throws Exception {
+ protected void setup() {
service = new SingleLayerPortService<>(mockedRequestContextStack,
mockedDeviceContext, UpdatePortOutput.class);
}
@Test
- public void buildRequest() throws Exception {
+ public void buildRequest() {
final Port input = new PortBuilder()
.setPortNumber(new PortNumberUni(PORT_ID))
.build();
private SingleLayerTableMultipartService service;
@Override
- protected void setup() throws Exception {
+ protected void setup() {
service = new SingleLayerTableMultipartService(mockedRequestContextStack, mockedDeviceContext,
MultipartWriterProviderFactory.createDefaultProvider(mockedDeviceContext));
}
@Test
- public void buildRequest() throws Exception {
+ public void buildRequest() {
final UpdateTableInput input = new UpdateTableInputBuilder()
.setUpdatedTable(new UpdatedTableBuilder()
.setTableFeatures(Collections.singletonList(new TableFeaturesBuilder()
private RequestContext<Void> requestContext;
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
verifyNoMoreInteractions(requestContext);
}
@Test
- public void closeRequestContextWithRpcError() throws Exception {
+ public void closeRequestContextWithRpcError() {
final String errorMessage = "Test error";
RequestContextUtil.closeRequestContextWithRpcError(
requestContext,
}
@Test
- public void closeRequestContext() throws Exception {
+ public void closeRequestContext() {
doThrow(new IllegalStateException()).when(requestContext).close();
RequestContextUtil.closeRequestContext(requestContext);
verify(requestContext).close();
public class RequestInputUtilsTest {
@Test
- public void createMultipartHeader() throws Exception {
+ public void createMultipartHeader() {
final Short version = OFConstants.OFP_VERSION_1_3;
final Long xid = 42L;
final MultipartType type = MultipartType.OFPMPDESC;
}
@Test
- public void gatherDynamicDataTest() throws InterruptedException {
+ public void gatherDynamicDataTest() {
when(mockedDeviceState.isTableStatisticsAvailable()).thenReturn(Boolean.TRUE);
when(mockedDeviceState.isFlowStatisticsAvailable()).thenReturn(Boolean.TRUE);
Mockito.mock(OpenflowProviderConfig.class);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
convertorManager = ConvertorManagerFactory.createDefaultManager();
when(mockedDeviceInfo.reserveXidForDeviceMessage()).thenReturn(TEST_XID);
Mockito.when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
*/
@Test
@SuppressWarnings("checkstyle:IllegalCatch")
- public void testClose() throws Exception {
+ public void testClose() {
statisticsContext =
new StatisticsContextImpl<>(mockedDeviceContext,
convertorManager,
}
@Test
- public void testGatherDynamicData_none() throws Exception {
+ public void testGatherDynamicData_none() {
statisticsContext.instantiateServiceInstance();
Mockito.verifyNoMoreInteractions(mockedStatisticsGatheringService, mockedStatisticsOnFlyGatheringService);
}
@Test
- public void testGatherDynamicData_all() throws Exception {
+ public void testGatherDynamicData_all() {
Mockito.reset(mockedDeviceState);
when(mockedDeviceState.isTableStatisticsAvailable()).thenReturn(Boolean.TRUE);
when(mockedDeviceState.isFlowStatisticsAvailable()).thenReturn(Boolean.TRUE);
private MultipartWriterProvider provider;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
when(deviceContext.getDeviceFlowRegistry()).thenReturn(deviceFlowRegistry);
when(deviceContext.getDeviceGroupRegistry()).thenReturn(deviceGroupRegistry);
}
@Test
- public void testWriteFlowStatistics() throws Exception {
+ public void testWriteFlowStatistics() {
final ArgumentCaptor<LogicalDatastoreType> dataStoreType = ArgumentCaptor.forClass(LogicalDatastoreType.class);
final ArgumentCaptor<InstanceIdentifier> flowPath = ArgumentCaptor.forClass(InstanceIdentifier.class);
final ArgumentCaptor<Flow> flow = ArgumentCaptor.forClass(Flow.class);
}
@Test
- public void testDeleteAllKnownFlows() throws Exception {
+ public void testDeleteAllKnownFlows() {
final short tableId = 0;
final InstanceIdentifier<FlowCapableNode> nodePath =
deviceInfo.getNodeInstanceIdentifier().augmentation(FlowCapableNode.class);
}
@Test
- public void testClose() throws Exception {
+ public void testClose() {
statisticsManager.close();
verify(serviceControlRegistration).close();
}
private StatisticsPollingService statisticsPollingService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(timeCounter.getAverageTimeBetweenMarks()).thenReturn(15000L);
when(gatheringSupplier.get()).thenReturn(Futures.immediateFuture(true));
statisticsPollingService = new StatisticsPollingService(
}
@Test
- public void startUp() throws Exception {
+ public void startUp() {
statisticsPollingService.startUp();
verify(timeCounter).markStart();
}
}
@Test
- public void scheduler() throws Exception {
+ public void scheduler() {
statisticsPollingService.scheduler();
verify(timeCounter).getAverageTimeBetweenMarks();
}
private TimeCounter timeCounter;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
timeCounter = new TimeCounter();
}
* @throws Exception if interrupted
*/
@Test
- public void testGetAverageTimeBetweenMarks() throws Exception {
+ public void testGetAverageTimeBetweenMarks() {
Assert.assertEquals(0, timeCounter.getAverageTimeBetweenMarks());
timeCounter.markStart();
Assert.assertEquals(0, timeCounter.getAverageTimeBetweenMarks());
}
@Test(expected = IllegalAccessError.class)
- public void testGetAggregateFlowStatisticsFromFlowTableForAllFlows() throws Exception {
+ public void testGetAggregateFlowStatisticsFromFlowTableForAllFlows() {
GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder input =
new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
.setNode(createNodeRef("unitProt:123"))
}
@Test(expected = IllegalAccessError.class)
- public void testGetAllFlowStatisticsFromFlowTable() throws Exception {
+ public void testGetAllFlowStatisticsFromFlowTable() {
GetAllFlowStatisticsFromFlowTableInputBuilder input = new GetAllFlowStatisticsFromFlowTableInputBuilder()
.setNode(createNodeRef("unitProt:123"))
.setTableId(new TableId((short) 1));
}
@Test(expected = IllegalAccessError.class)
- public void testGetAllFlowsStatisticsFromAllFlowTables() throws Exception {
+ public void testGetAllFlowsStatisticsFromAllFlowTables() {
GetAllFlowsStatisticsFromAllFlowTablesInputBuilder input =
new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder()
.setNode(createNodeRef("unitProt:123"));
}
@Test(expected = IllegalAccessError.class)
- public void testGetFlowStatisticsFromFlowTable() throws Exception {
+ public void testGetFlowStatisticsFromFlowTable() {
GetFlowStatisticsFromFlowTableInputBuilder input = new GetFlowStatisticsFromFlowTableInputBuilder()
.setNode(createNodeRef("unitProt:123"))
.setPriority(5);
}
@Test
- public void testGetAggregateFlowStatisticsFromFlowTableForAllFlows() throws Exception {
+ public void testGetAggregateFlowStatisticsFromFlowTableForAllFlows() {
GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input =
new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
.setNode(createNodeRef("unitProt:123"))
}
@Test
- public void testGetAllFlowStatisticsFromFlowTable() throws Exception {
+ public void testGetAllFlowStatisticsFromFlowTable() {
GetAllFlowStatisticsFromFlowTableInput input = new GetAllFlowStatisticsFromFlowTableInputBuilder()
.setNode(createNodeRef("unitProt:123"))
.setTableId(new TableId((short) 1))
}
@Test
- public void testGetAllFlowsStatisticsFromAllFlowTables() throws Exception {
+ public void testGetAllFlowsStatisticsFromAllFlowTables() {
GetAllFlowsStatisticsFromAllFlowTablesInput input = new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder()
.setNode(createNodeRef("unitProt:123"))
.build();
}
@Test
- public void testGetFlowStatisticsFromFlowTable() throws Exception {
+ public void testGetFlowStatisticsFromFlowTable() {
GetFlowStatisticsFromFlowTableInput input = new GetFlowStatisticsFromFlowTableInputBuilder()
.setNode(createNodeRef("unitProt:123"))
.setPriority(5)
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
Xid xid = new Xid(42L);
GetFlowTablesStatisticsInputBuilder input = new GetFlowTablesStatisticsInputBuilder()
.setNode(createNodeRef("unitProt:123"));
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verify(notificationPublishService).offerNotification(ArgumentMatchers.any());
}
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
Xid xid = new Xid(42L);
GetNodeConnectorStatisticsInputBuilder input = new GetNodeConnectorStatisticsInputBuilder()
.setNodeConnectorId(new NodeConnectorId("junitProto:11:12"))
}
@Test
- public void testGetOfVersion() throws Exception {
+ public void testGetOfVersion() {
Assert.assertEquals(OFConstants.OFP_VERSION_1_3, service.getOfVersion().getVersion());
}
}
@Test(expected = IllegalAccessError.class)
- public void testGetAggregateFlowStatisticsFromFlowTableForGivenMatch() throws Exception {
+ public void testGetAggregateFlowStatisticsFromFlowTableForGivenMatch() {
flowStatisticsServiceDelegate.getAggregateFlowStatisticsFromFlowTableForGivenMatch(null);
}
}
@Test
- public void testGetStatisticsOfType() throws Exception {
+ public void testGetStatisticsOfType() {
final EventIdentifier eventIdentifier = new EventIdentifier("ut-event", "ut-device-id:1");
statisticsGatheringService.getStatisticsOfType(eventIdentifier, MultipartType.OFPMPFLOW);
Mockito.verify(mockedRequestContextStack).createRequestContext();
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
final long xidValue = 21L;
Xid xid = new Xid(xidValue);
final OfHeader request = statisticsGatheringService.buildRequest(xid, MultipartType.OFPMPFLOW);
}
@Test
- public void testGetStatisticsOfType() throws Exception {
+ public void testGetStatisticsOfType() {
final EventIdentifier eventIdentifier = new EventIdentifier("ut-event", "ut-device-id:1");
for (MultipartType mpType : MultipartType.values()) {
statisticsGatheringService.getStatisticsOfType(eventIdentifier, mpType);
}
@Test
- public void testBuildRequest() throws Exception {
+ public void testBuildRequest() {
final long xidValue = 21L;
Xid xid = new Xid(xidValue);
for (MultipartType mpType : MultipartType.values()) {
}
@Before
- public void init() throws Exception {
+ public void init() {
nodeConnectorId = InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(
DATAPATH_ID, PORT_NO, OpenflowVersion.get(OF_VERSION));
setUp();
}
- protected abstract void setUp() throws Exception;
+ protected abstract void setUp();
@Test
- public abstract void testBuildRequestBody() throws Exception;
+ public abstract void testBuildRequestBody();
@Test
- public abstract void testBuildReply() throws Exception;
+ public abstract void testBuildReply();
@Test
- public abstract void testStoreStatistics() throws Exception;
+ public abstract void testStoreStatistics();
}
private OpendaylightDirectStatisticsService emptyService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final OpendaylightDirectStatisticsServiceProvider provider = new OpendaylightDirectStatisticsServiceProvider();
provider.register(AbstractFlowDirectStatisticsService.class, flowDirectStatisticsService);
provider.register(AbstractGroupDirectStatisticsService.class, groupDirectStatisticsService);
}
@Test
- public void testGetGroupStatistics() throws Exception {
+ public void testGetGroupStatistics() {
service.getGroupStatistics(getGroupStatisticsInput);
verify(groupDirectStatisticsService).handleAndReply(getGroupStatisticsInput);
}
}
@Test
- public void testGetQueueStatistics() throws Exception {
+ public void testGetQueueStatistics() {
service.getQueueStatistics(getQueueStatisticsInput);
verify(queueDirectStatisticsService).handleAndReply(getQueueStatisticsInput);
}
}
@Test
- public void testGetFlowStatistics() throws Exception {
+ public void testGetFlowStatistics() {
service.getFlowStatistics(getFlowStatisticsInput);
verify(flowDirectStatisticsService).handleAndReply(getFlowStatisticsInput);
}
}
@Test
- public void testGetMeterStatistics() throws Exception {
+ public void testGetMeterStatistics() {
service.getMeterStatistics(getMeterStatisticsInput);
verify(meterDirectStatisticsService).handleAndReply(getMeterStatisticsInput);
}
}
@Test
- public void testGetNodeConnectorStatistics() throws Exception {
+ public void testGetNodeConnectorStatistics() {
service.getNodeConnectorStatistics(getNodeConnectorStatisticsInput);
verify(nodeConnectorDirectStatisticsService).handleAndReply(getNodeConnectorStatisticsInput);
}
private FlowDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new FlowDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetFlowStatisticsInput input = mock(GetFlowStatisticsInput.class);
when(input.getTableId()).thenReturn(TABLE_NO);
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final MultipartReply reply = mock(MultipartReply.class);
final MultipartReplyFlowCase flowCase = mock(MultipartReplyFlowCase.class);
final MultipartReplyFlow flow = mock(MultipartReplyFlow.class);
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final FlowAndStatisticsMapList stat = mock(FlowAndStatisticsMapList.class);
when(stat.getTableId()).thenReturn(TABLE_NO);
when(stat.getMatch()).thenReturn(new MatchBuilder().build());
private GroupDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new GroupDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetGroupStatisticsInput input = mock(GetGroupStatisticsInput.class);
lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final MultipartReply reply = mock(MultipartReply.class);
final MultipartReplyGroupCase groupCase = mock(MultipartReplyGroupCase.class);
final MultipartReplyGroup group = mock(MultipartReplyGroup.class);
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final org.opendaylight.yang.gen.v1.urn
.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stat =
mock(org.opendaylight.yang.gen.v1.urn
private MeterDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new MeterDirectStatisticsService(requestContextStack, deviceContext, convertorManager,
multipartWriterProvider);
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetMeterStatisticsInput input = mock(GetMeterStatisticsInput.class);
when(input.getMeterId()).thenReturn(new MeterId(METER_NO));
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final MultipartReply reply = mock(MultipartReply.class);
final MultipartReplyMeterCase MeterCase = mock(MultipartReplyMeterCase.class);
final MultipartReplyMeter meter = mock(MultipartReplyMeter.class);
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats stat
= mock(
org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats
private PortDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new PortDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetNodeConnectorStatisticsInput input = mock(GetNodeConnectorStatisticsInput.class);
lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final MultipartReply reply = mock(MultipartReply.class);
final MultipartReplyPortStatsCase nodeConnectorCase = mock(MultipartReplyPortStatsCase.class);
final MultipartReplyPortStats nodeConnector = mock(MultipartReplyPortStats.class);
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final NodeConnectorStatisticsAndPortNumberMap stat = mock(NodeConnectorStatisticsAndPortNumberMap.class);
when(stat.getNodeConnectorId()).thenReturn(nodeConnectorId);
private QueueDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new QueueDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetQueueStatisticsInput input = mock(GetQueueStatisticsInput.class);
lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final MultipartReply reply = mock(MultipartReply.class);
final MultipartReplyQueueCase queueCase = mock(MultipartReplyQueueCase.class);
final MultipartReplyQueue queue = mock(MultipartReplyQueue.class);
}
@Test
- public void testStoreStatisticsBarePortNo() throws Exception {
+ public void testStoreStatisticsBarePortNo() {
final QueueIdAndStatisticsMap map = mock(QueueIdAndStatisticsMap.class);
when(map.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
when(map.getNodeConnectorId()).thenReturn(new NodeConnectorId("1"));
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final QueueIdAndStatisticsMap map = mock(QueueIdAndStatisticsMap.class);
when(map.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
when(map.getNodeConnectorId()).thenReturn(new NodeConnectorId("openflow:1:1"));
private FlowDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new FlowDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetFlowStatisticsInput input = mock(GetFlowStatisticsInput.class);
when(input.getTableId()).thenReturn(TABLE_NO);
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final FlowAndStatisticsMapList flowStat = new FlowAndStatisticsMapListBuilder()
.setDuration(new DurationBuilder()
.setSecond(new Counter32(1L))
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final FlowAndStatisticsMapList stat = mock(FlowAndStatisticsMapList.class);
when(stat.getTableId()).thenReturn(TABLE_NO);
when(stat.getMatch()).thenReturn(new MatchBuilder().build());
private GroupDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new GroupDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetGroupStatisticsInput input = mock(GetGroupStatisticsInput.class);
lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final GroupStats groupStat = new GroupStatsBuilder()
.setGroupId(new GroupId(GROUP_NO))
.build();
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final org.opendaylight.yang.gen.v1.urn
.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats stat =
mock(org.opendaylight.yang.gen.v1.urn
private MeterDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new MeterDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetMeterStatisticsInput input = mock(GetMeterStatisticsInput.class);
lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final MeterStats meterStat = new MeterStatsBuilder()
.setMeterId(new MeterId(METER_NO))
.setByteInCount(new Counter64(BigInteger.ONE))
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final org.opendaylight.yang.gen.v1.urn
.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats stat =
mock(org.opendaylight.yang.gen.v1.urn
private PortDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new PortDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetNodeConnectorStatisticsInput input = mock(GetNodeConnectorStatisticsInput.class);
lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final NodeConnectorStatisticsAndPortNumberMap portStat = new NodeConnectorStatisticsAndPortNumberMapBuilder()
.setNodeConnectorId(nodeConnectorId)
.build();
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final NodeConnectorStatisticsAndPortNumberMap stat = mock(NodeConnectorStatisticsAndPortNumberMap.class);
when(stat.getNodeConnectorId()).thenReturn(nodeConnectorId);
private QueueDirectStatisticsService service;
@Override
- public void setUp() throws Exception {
+ public void setUp() {
service = new QueueDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
}
@Override
- public void testBuildRequestBody() throws Exception {
+ public void testBuildRequestBody() {
final GetQueueStatisticsInput input = mock(GetQueueStatisticsInput.class);
lenient().when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
}
@Override
- public void testBuildReply() throws Exception {
+ public void testBuildReply() {
final QueueIdAndStatisticsMap queueStats = new QueueIdAndStatisticsMapBuilder()
.setQueueId(new QueueId(QUEUE_NO))
.setNodeConnectorId(new NodeConnectorId(PORT_NO.toString()))
}
@Test
- public void testStoreStatisticsBarePortNo() throws Exception {
+ public void testStoreStatisticsBarePortNo() {
final QueueIdAndStatisticsMap map = mock(QueueIdAndStatisticsMap.class);
when(map.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
when(map.getNodeConnectorId()).thenReturn(new NodeConnectorId("1"));
}
@Override
- public void testStoreStatistics() throws Exception {
+ public void testStoreStatistics() {
final QueueIdAndStatisticsMap map = mock(QueueIdAndStatisticsMap.class);
when(map.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
when(map.getNodeConnectorId()).thenReturn(new NodeConnectorId("openflow:1:1"));
private DeviceInfo deviceInfo;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
translator = new AggregatedFlowStatisticsTranslator();
}
@Test
- public void testTranslate() throws Exception {
+ public void testTranslate() {
MultipartReplyAggregateBuilder aggregateStatsValueBld = new MultipartReplyAggregateBuilder()
.setByteCount(BigInteger.valueOf(1L))
.setFlowCount(2L)
private FlowWildcardsV10 flowWildcards;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final KeyedInstanceIdentifier<Node, NodeKey> nodeId = InstanceIdentifier.create(Nodes.class)
.child(Node.class, new NodeKey(new NodeId("dummyNodeId")));
}
@Test
- public void testTranslate() throws Exception {
+ public void testTranslate() {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved flowRemovedMessage =
buildMessage(false);
final FlowRemoved flowRemoved = translator.translate(flowRemovedMessage, deviceInfo, null);
}
@Test
- public void testTranslateV10() throws Exception {
+ public void testTranslateV10() {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved flowRemovedMessage =
buildMessage(true);
final FlowRemoved flowRemoved = translatorV10.translate(flowRemovedMessage, deviceInfo, null);
static final Long PORT_NUM_VALUE = 11L;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final List<PhyPort> phyPorts = Collections.singletonList(phyPort);
convertorManager = ConvertorManagerFactory.createDefaultManager();
}
@Test
- public void testTranslate() throws Exception {
+ public void testTranslate() {
final KeyedInstanceIdentifier<Node, NodeKey> nodePath = KeyedInstanceIdentifier
.create(Nodes.class)
.child(Node.class, new NodeKey(new NodeId("openflow:10")));
}
@Test
- public void testGetPacketInMatch() throws Exception {
+ public void testGetPacketInMatch() {
MatchEntryBuilder matchEntryBuilder = assembleMatchEntryBld(PORT_NUM_VALUE);
MatchBuilder packetInMatchBld = new MatchBuilder()
.setMatchEntry(Lists.newArrayList(matchEntryBuilder.build()));
private PortStatusMessageBuilder portBld;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
portUpdateTranslator = new PortUpdateTranslator();
portStateBld = new StateBuilder().setLive(true);
}
@Test
- public void testTranslate_13() throws Exception {
+ public void testTranslate_13() {
Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures portFeatures =
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures
}
@Test
- public void testTranslate_10() throws Exception {
+ public void testTranslate_10() {
Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_0);
final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures portFeatures =
new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures(
public class AddressNormalizationUtilTest {
@Test
- public void normalizeProtocolAgnosticPortOF10() throws Exception {
+ public void normalizeProtocolAgnosticPortOF10() {
final Uri left = new Uri("openflow:1:INPORT");
final Uri right = new Uri("IN_PORT");
}
@Test
- public void normalizeProtocolAgnosticPortOF13() throws Exception {
+ public void normalizeProtocolAgnosticPortOF13() {
final Uri left = new Uri("openflow:1:ANY");
final Uri right = new Uri("ANY");
}
@Test
- public void normalizeIpv6Prefix() throws Exception {
+ public void normalizeIpv6Prefix() {
final Ipv6Prefix left = new Ipv6Prefix("1E3D:5678:9ABC::/24");
final Ipv6Prefix right = new Ipv6Prefix("1e3d:5600:0:0:0:0:0:0/24");
}
@Test
- public void normalizeIpv6Arbitrary() throws Exception {
+ public void normalizeIpv6Arbitrary() {
final Ipv6Address leftAddress = new Ipv6Address("1E3D:5678:9ABC::");
final Ipv6ArbitraryMask leftMask = new Ipv6ArbitraryMask("FFFF:FF00::");
final Ipv6Prefix right = new Ipv6Prefix("1e3d:5600:0:0:0:0:0:0/24");
}
@Test
- public void normalizeIpv6AddressWithoutMask() throws Exception {
+ public void normalizeIpv6AddressWithoutMask() {
final Ipv6Address left = new Ipv6Address("1E3D:5678:9ABC::");
final Ipv6Address right = new Ipv6Address("1e3d:5678:9abc:0:0:0:0:0");
}
@Test
- public void normalizeIpv4Prefix() throws Exception {
+ public void normalizeIpv4Prefix() {
final Ipv4Prefix left = new Ipv4Prefix("192.168.72.1/16");
final Ipv4Prefix right = new Ipv4Prefix("192.168.0.0/16");
}
@Test
- public void normalizeIpv4Arbitrary() throws Exception {
+ public void normalizeIpv4Arbitrary() {
final Ipv4Address leftAddress = new Ipv4Address("192.168.72.1");
final DottedQuad leftMask = new DottedQuad("255.255.0.0");
final Ipv4Prefix right = new Ipv4Prefix("192.168.0.0/16");
}
@Test
- public void normalizeMacAddress() throws Exception {
+ public void normalizeMacAddress() {
final MacAddress left = new MacAddress("01:23:45:AB:CD:EF");
final MacAddress right = new MacAddress("01:23:45:ab:cd:ef");
}
@Test
- public void normalizeMacAddressMask() throws Exception {
+ public void normalizeMacAddressMask() {
final MacAddress left = new MacAddress("FF:FF:FF:FF:FF:FF");
final MacAddress right = null;
private ArgumentCaptor<Pair<RpcResult<String>, RpcResult<SendBarrierOutput>>> pairCpt;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
Mockito.when(transactionService.sendBarrier(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
Mockito.verifyNoMoreInteractions(transactionService, compositeTransform);
}
@Test
- public void testChainBarrier() throws Exception {
+ public void testChainBarrier() {
final String data = "ut-data1";
final ListenableFuture<RpcResult<String>> input = RpcResultBuilder.success(data).buildFuture();
final ListenableFuture<RpcResult<String>> chainResult =
}
@Test
- public void testCreateSendBarrierInput() throws Exception {
+ public void testCreateSendBarrierInput() {
final SendBarrierInput barrierInput = BarrierUtil.createSendBarrierInput(NODE_REF);
Assert.assertEquals(NODE_REF, barrierInput.getNode());
private FeaturesReply featuresReply;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(NODE_II);
doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit();
when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
}
@Test
- public void makeEmptyNodes() throws Exception {
+ public void makeEmptyNodes() {
DeviceInitializationUtil.makeEmptyNodes(dataBroker);
verify(dataBroker).newWriteOnlyTransaction();
verify(writeTransaction).merge(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier
}
@Test
- public void makeEmptyTables() throws Exception {
+ public void makeEmptyTables() {
DeviceInitializationUtil.makeEmptyTables(txFacade, deviceInfo, (short) 10);
verify(txFacade, times(10)).writeToTransaction(
eq(LogicalDatastoreType.OPERATIONAL), any(), any());
}
@Test
- public void getIpAddress() throws Exception {
+ public void getIpAddress() {
final IpAddress ipAddress = DeviceInitializationUtil.getIpAddress(connectionContext, NODE_II);
assertEquals(ipAddress, IetfInetUtil.INSTANCE.ipAddressFor(INET_SOCKET_ADDRESS.getAddress()));
}
@Test
- public void getPortNumber() throws Exception {
+ public void getPortNumber() {
final PortNumber portNumber = DeviceInitializationUtil.getPortNumber(connectionContext, NODE_II);
assertEquals(portNumber, new PortNumber(PORT));
}
@Test
- public void getSwitchFeatures() throws Exception {
+ public void getSwitchFeatures() {
final SwitchFeatures switchFeatures = DeviceInitializationUtil.getSwitchFeatures(connectionContext);
assertEquals(TABLES, switchFeatures.getMaxTables().shortValue());
}
private static final Logger LOG = LoggerFactory.getLogger(FlatBatchUtilTest.class);
@Test
- public void testMarkBarriersWhereNeeded_noBarrier() throws Exception {
+ public void testMarkBarriersWhereNeeded_noBarrier() {
final List<Batch> batches = Lists.newArrayList(
//general part - no flush required
createBatch(BatchStepType.GROUP_REMOVE),
}
@Test
- public void testMarkBarriersWhereNeeded_allBarriers() throws Exception {
+ public void testMarkBarriersWhereNeeded_allBarriers() {
// need to flush G+/F+
checkBarriersBetween(BatchStepType.GROUP_ADD, BatchStepType.FLOW_ADD);
// need to flush G+/F*
}
@Test
- public void testMarkBarriersWhereNeeded_single() throws Exception {
+ public void testMarkBarriersWhereNeeded_single() {
final List<Batch> batches = Lists.newArrayList(
//general part - no flush required
createBatch(BatchStepType.GROUP_REMOVE)
}
@Test
- public void testDecideBarrier() throws Exception {
+ public void testDecideBarrier() {
Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.GROUP_ADD), BatchStepType.FLOW_ADD));
Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.GROUP_ADD), BatchStepType.FLOW_UPDATE));
}
@Test
- public void testAssembleBatchPlan() throws Exception {
+ public void testAssembleBatchPlan() {
final List<Batch> batches = Lists.newArrayList(
createBatch(BatchStepType.GROUP_ADD),
createBatch(BatchStepType.GROUP_REMOVE, 2),
}
@Test
- public void testDetectBatchStepType() throws Exception {
+ public void testDetectBatchStepType() {
for (BatchStepType stepType : BatchStepType.values()) {
LOG.debug("checking detection of: {}", stepType);
final Batch batch = createBatch(stepType);
}
@Test
- public void testMergeJobsResultsFutures() throws Exception {
+ public void testMergeJobsResultsFutures() {
final BatchFailure batchFailure = new BatchFailureBuilder()
.setBatchOrder(9)
.setBatchItemIdChoice(new FlatBatchFailureFlowIdCaseBuilder()
public static final Short DUMMY_TABLE_ID = 1;
@Test
- public void testBuildFlowPath() throws Exception {
+ public void testBuildFlowPath() {
final InstanceIdentifier<Node> nodePath = InstanceIdentifier
.create(Nodes.class)
.child(Node.class, new NodeKey(DUMMY_NODE_ID));
}
@Test
- public void testCreateCumulatingFunction() throws Exception {
+ public void testCreateCumulatingFunction() {
final Function<List<RpcResult<String>>, RpcResult<List<BatchFailedFlowsOutput>>> function =
FlowUtil.createCumulatingFunction(Lists.newArrayList(createBatchFlowIdGrouping(DUMMY_FLOW_ID),
createBatchFlowIdGrouping(DUMMY_FLOW_ID_2)));
}
@Test
- public void testFlowAddTransformFailure() throws Exception {
+ public void testFlowAddTransformFailure() {
final RpcResult<List<BatchFailedFlowsOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(FlowUtil.FLOW_ADD_TRANSFORM.apply(input));
}
@Test
- public void testFlowAddTransformSuccess() throws Exception {
+ public void testFlowAddTransformSuccess() {
final RpcResult<List<BatchFailedFlowsOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(FlowUtil.FLOW_ADD_TRANSFORM.apply(input));
}
@Test
- public void testFlowRemoveTransformFailure() throws Exception {
+ public void testFlowRemoveTransformFailure() {
final RpcResult<List<BatchFailedFlowsOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(FlowUtil.FLOW_REMOVE_TRANSFORM.apply(input));
}
@Test
- public void testFlowRemoveTransformSuccess() throws Exception {
+ public void testFlowRemoveTransformSuccess() {
final RpcResult<List<BatchFailedFlowsOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(FlowUtil.FLOW_REMOVE_TRANSFORM.apply(input));
}
@Test
- public void testFlowUpdateTransformFailure() throws Exception {
+ public void testFlowUpdateTransformFailure() {
final RpcResult<List<BatchFailedFlowsOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(FlowUtil.FLOW_UPDATE_TRANSFORM.apply(input));
}
@Test
- public void testFlowUpdateTransformSuccess() throws Exception {
+ public void testFlowUpdateTransformSuccess() {
final RpcResult<List<BatchFailedFlowsOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(FlowUtil.FLOW_UPDATE_TRANSFORM.apply(input));
}
}
@Test
- public void testCreateComposingFunction_success_success() throws Exception {
+ public void testCreateComposingFunction_success_success() {
final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddFlowsBatchOutput>> compositeFunction = FlowUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_failure_success() throws Exception {
+ public void testCreateComposingFunction_failure_success() {
final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddFlowsBatchOutput>> compositeFunction = FlowUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_success_failure() throws Exception {
+ public void testCreateComposingFunction_success_failure() {
final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddFlowsBatchOutput>> compositeFunction = FlowUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_failure_failure() throws Exception {
+ public void testCreateComposingFunction_failure_failure() {
final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddFlowsBatchOutput>> compositeFunction = FlowUtil.createComposingFunction();
0b00000000000000000000000000000000000001111111111111001100000000001L;
@Test
- public void testBuildGroupPath() throws Exception {
+ public void testBuildGroupPath() {
final InstanceIdentifier<Node> nodePath = InstanceIdentifier
.create(Nodes.class)
.child(Node.class, new NodeKey(DUMMY_NODE_ID));
}
@Test
- public void testCreateCumulatingFunction() throws Exception {
+ public void testCreateCumulatingFunction() {
final Function<List<RpcResult<String>>, RpcResult<List<BatchFailedGroupsOutput>>> function =
GroupUtil.createCumulatingFunction(Lists.newArrayList(createBatchGroup(DUMMY_GROUP_ID),
createBatchGroup(DUMMY_GROUP_ID_2)));
}
@Test
- public void testGroupAddTransformFailure() throws Exception {
+ public void testGroupAddTransformFailure() {
final RpcResult<List<BatchFailedGroupsOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(GroupUtil.GROUP_ADD_TRANSFORM.apply(input));
}
@Test
- public void testGroupAddTransformFailureSuccess() throws Exception {
+ public void testGroupAddTransformFailureSuccess() {
final RpcResult<List<BatchFailedGroupsOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(GroupUtil.GROUP_ADD_TRANSFORM.apply(input));
}
@Test
- public void testGroupRemoveTransformFailure() throws Exception {
+ public void testGroupRemoveTransformFailure() {
final RpcResult<List<BatchFailedGroupsOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(GroupUtil.GROUP_REMOVE_TRANSFORM.apply(input));
}
@Test
- public void testFlowRemoveTransformSuccess() throws Exception {
+ public void testFlowRemoveTransformSuccess() {
final RpcResult<List<BatchFailedGroupsOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(GroupUtil.GROUP_REMOVE_TRANSFORM.apply(input));
}
@Test
- public void testFlowUpdateTransformFailure() throws Exception {
+ public void testFlowUpdateTransformFailure() {
final RpcResult<List<BatchFailedGroupsOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(GroupUtil.GROUP_UPDATE_TRANSFORM.apply(input));
}
@Test
- public void testFlowUpdateTransformSuccess() throws Exception {
+ public void testFlowUpdateTransformSuccess() {
final RpcResult<List<BatchFailedGroupsOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(GroupUtil.GROUP_UPDATE_TRANSFORM.apply(input));
}
}
@Test
- public void testCreateComposingFunction_success_success() throws Exception {
+ public void testCreateComposingFunction_success_success() {
final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddGroupsBatchOutput>> compositeFunction = GroupUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_failure_success() throws Exception {
+ public void testCreateComposingFunction_failure_success() {
final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddGroupsBatchOutput>> compositeFunction = GroupUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_success_failure() throws Exception {
+ public void testCreateComposingFunction_success_failure() {
final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddGroupsBatchOutput>> compositeFunction = GroupUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_failure_failure() throws Exception {
+ public void testCreateComposingFunction_failure_failure() {
final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddGroupsBatchOutput>> compositeFunction = GroupUtil.createComposingFunction();
private ConvertorManager convertorManager;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
convertorManager = ConvertorManagerFactory.createDefaultManager();
when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeatures);
}
@Test
- public void registerStatCompatibilityServices() throws Exception {
+ public void registerStatCompatibilityServices() {
final OpendaylightFlowStatisticsService flowStatService = OpendaylightFlowStatisticsServiceImpl
.createWithOook(mockedRpcContext, mockedDeviceContext, convertorManager);
private static final MeterId DUMMY_METER_ID_2 = new MeterId(43L);
@Test
- public void testBuildGroupPath() throws Exception {
+ public void testBuildGroupPath() {
final InstanceIdentifier<Node> nodePath = InstanceIdentifier
.create(Nodes.class)
.child(Node.class, new NodeKey(DUMMY_NODE_ID));
}
@Test
- public void testCreateCumulatingFunction() throws Exception {
+ public void testCreateCumulatingFunction() {
final Function<List<RpcResult<String>>, RpcResult<List<BatchFailedMetersOutput>>> function =
MeterUtil.createCumulativeFunction(Lists.newArrayList(
createBatchMeter(DUMMY_METER_ID),
}
@Test
- public void testMeterAddTransformFailure() throws Exception {
+ public void testMeterAddTransformFailure() {
final RpcResult<List<BatchFailedMetersOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(MeterUtil.METER_ADD_TRANSFORM.apply(input));
}
@Test
- public void testMeterAddTransformSuccess() throws Exception {
+ public void testMeterAddTransformSuccess() {
final RpcResult<List<BatchFailedMetersOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(MeterUtil.METER_ADD_TRANSFORM.apply(input));
}
@Test
- public void testMeterRemoveTransformFailure() throws Exception {
+ public void testMeterRemoveTransformFailure() {
final RpcResult<List<BatchFailedMetersOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(MeterUtil.METER_REMOVE_TRANSFORM.apply(input));
}
@Test
- public void testFlowRemoveTransformSuccess() throws Exception {
+ public void testFlowRemoveTransformSuccess() {
final RpcResult<List<BatchFailedMetersOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(MeterUtil.METER_REMOVE_TRANSFORM.apply(input));
}
@Test
- public void testFlowUpdateTransformFailure() throws Exception {
+ public void testFlowUpdateTransformFailure() {
final RpcResult<List<BatchFailedMetersOutput>> input = createBatchOutcomeWithError();
checkBatchErrorOutcomeTransformation(MeterUtil.METER_UPDATE_TRANSFORM.apply(input));
}
@Test
- public void testFlowUpdateTransformSuccess() throws Exception {
+ public void testFlowUpdateTransformSuccess() {
final RpcResult<List<BatchFailedMetersOutput>> input = createEmptyBatchOutcome();
checkBatchSuccessOutcomeTransformation(MeterUtil.METER_UPDATE_TRANSFORM.apply(input));
}
}
@Test
- public void testCreateComposingFunction_success_success() throws Exception {
+ public void testCreateComposingFunction_success_success() {
final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddMetersBatchOutput>> compositeFunction = MeterUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_failure_success() throws Exception {
+ public void testCreateComposingFunction_failure_success() {
final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddMetersBatchOutput>> compositeFunction = MeterUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_success_failure() throws Exception {
+ public void testCreateComposingFunction_success_failure() {
final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddMetersBatchOutput>> compositeFunction = MeterUtil.createComposingFunction();
}
@Test
- public void testCreateComposingFunction_failure_failure() throws Exception {
+ public void testCreateComposingFunction_failure_failure() {
final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<SendBarrierOutput>>,
RpcResult<AddMetersBatchOutput>> compositeFunction = MeterUtil.createComposingFunction();
}
@Test
- public void testGetPortNoFromPacketIn() throws Exception {
+ public void testGetPortNoFromPacketIn() {
PacketIn packetIn = createPacketIn(PORT_NO);
Long portNo = NodeConnectorRefToPortTranslator.getPortNoFromPacketIn(packetIn);
assertEquals(portNo, PORT_NO);
}
@Test
- public void testNodeConnectorConversion() throws Exception {
+ public void testNodeConnectorConversion() {
// Mock the packet in message
PacketIn packetIn = createPacketIn(PORT_NO);
private static final NodeRef NODE_REF = new NodeRef(NODE_II);
@Test
- public void testExtractNodeId() throws Exception {
+ public void testExtractNodeId() {
Assert.assertEquals(NODE_ID, PathUtil.extractNodeId(NODE_REF));
}
@Test
- public void testExtractNodeId2() throws Exception {
+ public void testExtractNodeId2() {
Assert.assertEquals(NODE_ID, PathUtil.extractNodeId(NODE_II));
}
}
\ No newline at end of file
@RunWith(MockitoJUnitRunner.class)
public class ConvertorManagerTest {
@Test
- public void testRegisterConvertor() throws Exception {
+ public void testRegisterConvertor() {
final ConvertorManager convertorManager = new ConvertorManager(OFConstants.OFP_VERSION_1_3)
.registerConvertor(OFConstants.OFP_VERSION_1_3, new Convertor<Action, String, VersionConvertorData>() {
@Override
}
@Test
- public void testConvert() throws Exception {
+ public void testConvert() {
final ConvertorManager convertorManager = new ConvertorManager(OFConstants.OFP_VERSION_1_3)
.registerConvertor(OFConstants.OFP_VERSION_1_3, new Convertor<Action, String, VersionConvertorData>() {
@Override
* Test for {@link ConvertorManager#convert(Collection, ConvertorData)}.
*/
@Test
- public void testConvert1() throws Exception {
+ public void testConvert1() {
final ConvertorManager convertorManager = new ConvertorManager(OFConstants.OFP_VERSION_1_3)
.registerConvertor(OFConstants.OFP_VERSION_1_3,
new Convertor<List<Action>, String, VersionConvertorData>() {
}
@Test
- public void testToTableFeaturesRequest() throws Exception {
+ public void testToTableFeaturesRequest() {
List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures>
tableFeaturesList = new ArrayList<>();
org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesBuilder
}
@Test
- public void testCountBitsAsCIDRReplacement() throws Exception {
+ public void testCountBitsAsCIDRReplacement() {
BigInteger maskSeed = new BigInteger("1ffffffffffffffffffffffffffffffff", 16);
byte[] maskArray = new byte[16];
LOG.debug("maskSeed= {}", ByteBufUtils.bytesToHexString(maskSeed.toByteArray()));
}
@Override
- public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
LOG.warn("Unexpected exception from downstream.", cause);
ctx.close();
}
@Override
- protected void decode(ChannelHandlerContext chc, ByteBuf bb, List<Object> list) throws Exception {
+ protected void decode(ChannelHandlerContext chc, ByteBuf bb, List<Object> list) {
if (bb.readableBytes() < LENGTH_OF_HEADER) {
LOG.debug("skipping bb - too few data for header: {}", bb.readableBytes());
return;
}
@Override
- public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
+ public void channelRead(ChannelHandlerContext ctx, Object msg) {
ByteBuf bb = (ByteBuf) msg;
if (LOG.isDebugEnabled()) {
LOG.debug("Message {}", ByteBufUtils.byteBufToHexString(bb));
}
@Override
- public void channelActive(ChannelHandlerContext ctx) throws Exception {
+ public void channelActive(ChannelHandlerContext ctx) {
LOG.debug("Client is active");
if (isOnlineFuture != null) {
isOnlineFuture.set(true);
}
@Override
- public void initChannel(SocketChannel ch) throws Exception {
+ public void initChannel(SocketChannel ch) {
ChannelPipeline pipeline = ch.pipeline();
if (secured) {
SSLEngine engine = ClientSslContextFactory.getClientContext()
}
@Override
- public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
LOG.warn("Unexpected exception from downstream.", cause);
ctx.close();
}
@Override
- protected void decode(ChannelHandlerContext chc, DatagramPacket msg, List<Object> list) throws Exception {
+ protected void decode(ChannelHandlerContext chc, DatagramPacket msg, List<Object> list) {
ByteBuf bb = msg.content();
if (bb.readableBytes() < LENGTH_OF_HEADER) {
LOG.debug("skipping bb - too few data for header: {}", bb.readableBytes());
}
@Override
- public void initChannel(DatagramChannel ch) throws Exception {
+ public void initChannel(DatagramChannel ch) {
ChannelPipeline pipeline = ch.pipeline();
SimpleClientHandler simpleClientHandler = new SimpleClientHandler(isOnlineFuture, scenarioHandler);
simpleClientHandler.setScenario(scenarioHandler);
* @see java.lang.AutoCloseable#close()
*/
@Override
- public void close() throws Exception {
+ public void close() {
OpenflowpluginGroupTestServiceProvider.LOG
.info("SalGroupServiceProvide stopped.");
groupRegistration.close();
* @see java.lang.AutoCloseable#close()
*/
@Override
- public void close() throws Exception {
+ public void close() {
OpenflowpluginTableFeaturesTestServiceProvider.LOG
.info("SalTableServiceProvider stopped.");
tableRegistration.close();
* @see java.lang.AutoCloseable#close()
*/
@Override
- public void close() throws Exception {
+ public void close() {
OpenflowpluginTestServiceProvider.LOG
.info("SalFlowServiceProvide stopped.");
flowRegistration.close();