X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fservices%2Fbatch%2FFlatBatchMeterAdaptersTest.java;h=bf487d3e7e6e22b2f2faa7c67add03f231928416;hb=3a44a80f20e2ad3b9683a8ef2c459f96a86c53fb;hp=7ef5d07adb691cd2014fed8611fac0cbb55d2593;hpb=048b140495244d00f65fd0e5e73f171e147af2a8;p=openflowplugin.git diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdaptersTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdaptersTest.java index 7ef5d07adb..bf487d3e7e 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdaptersTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdaptersTest.java @@ -53,14 +53,15 @@ public class FlatBatchMeterAdaptersTest { 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( createAddMeterBatch(1L), createAddMeterBatch(2L))); - final AddMetersBatchInput addMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchAddMeter(planStep, NODE_REF); + final AddMetersBatchInput addMetersBatchInput = + FlatBatchMeterAdapters.adaptFlatBatchAddMeter(planStep, NODE_REF); Assert.assertTrue(addMetersBatchInput.isBarrierAfter()); Assert.assertEquals(2, addMetersBatchInput.getBatchAddMeters().size()); @@ -92,39 +93,45 @@ public class FlatBatchMeterAdaptersTest { } @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( createRemoveMeterBatch(1L), createRemoveMeterBatch(2L))); - final RemoveMetersBatchInput removeMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchRemoveMeter(planStep, NODE_REF); + final RemoveMetersBatchInput removeMetersBatchInput = + FlatBatchMeterAdapters.adaptFlatBatchRemoveMeter(planStep, NODE_REF); Assert.assertTrue(removeMetersBatchInput.isBarrierAfter()); Assert.assertEquals(2, removeMetersBatchInput.getBatchRemoveMeters().size()); - Assert.assertEquals(1L, removeMetersBatchInput.getBatchRemoveMeters().get(0).getMeterId().getValue().longValue()); - Assert.assertEquals(2L, removeMetersBatchInput.getBatchRemoveMeters().get(1).getMeterId().getValue().longValue()); + Assert.assertEquals(1L, + removeMetersBatchInput.getBatchRemoveMeters().get(0).getMeterId().getValue().longValue()); + Assert.assertEquals(2L, + removeMetersBatchInput.getBatchRemoveMeters().get(1).getMeterId().getValue().longValue()); } @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( createUpdateMeterBatch(1L), createUpdateMeterBatch(2L))); - final UpdateMetersBatchInput updateMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchUpdateMeter(planStep, NODE_REF); + final UpdateMetersBatchInput updateMetersBatchInput = + FlatBatchMeterAdapters.adaptFlatBatchUpdateMeter(planStep, NODE_REF); Assert.assertTrue(updateMetersBatchInput.isBarrierAfter()); Assert.assertEquals(2, updateMetersBatchInput.getBatchUpdateMeters().size()); - Assert.assertEquals(1L, updateMetersBatchInput.getBatchUpdateMeters().get(0).getUpdatedBatchedMeter().getMeterId().getValue().longValue()); - Assert.assertEquals(2L, updateMetersBatchInput.getBatchUpdateMeters().get(1).getUpdatedBatchedMeter().getMeterId().getValue().longValue()); + Assert.assertEquals(1L, updateMetersBatchInput.getBatchUpdateMeters().get(0) + .getUpdatedBatchedMeter().getMeterId().getValue().longValue()); + Assert.assertEquals(2L, updateMetersBatchInput.getBatchUpdateMeters().get(1) + .getUpdatedBatchedMeter().getMeterId().getValue().longValue()); } @Test - public void testCreateBatchMeterChainingFunction_failures() throws Exception { + public void testCreateBatchMeterChainingFunction_failures() { final RpcResult input = RpcResultBuilder.failed() .withError(RpcError.ErrorType.APPLICATION, "ut-meterError") .withResult(new AddMetersBatchOutputBuilder() @@ -143,11 +150,12 @@ public class FlatBatchMeterAdaptersTest { Assert.assertEquals(2, rpcResult.getResult().getBatchFailure().size()); Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue()); Assert.assertEquals(4, rpcResult.getResult().getBatchFailure().get(1).getBatchOrder().intValue()); - Assert.assertEquals(2L, ((FlatBatchFailureMeterIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice()).getMeterId().getValue().longValue()); + Assert.assertEquals(2L, ((FlatBatchFailureMeterIdCase) rpcResult.getResult().getBatchFailure().get(1) + .getBatchItemIdChoice()).getMeterId().getValue().longValue()); } @Test - public void testCreateBatchMeterChainingFunction_successes() throws Exception { + public void testCreateBatchMeterChainingFunction_successes() { final RpcResult input = RpcResultBuilder .success(new AddMetersBatchOutputBuilder().build()) .build();