Fix checkstyle warnings for util package 73/61773/8
authormiroslav.macko <miroslav.macko@pantheon.tech>
Tue, 15 Aug 2017 14:25:26 +0000 (16:25 +0200)
committermiroslav.macko <miroslav.macko@pantheon.tech>
Tue, 22 Aug 2017 08:32:52 +0000 (10:32 +0200)
See also: bug 8607

Change-Id: I3bd3b473ebb673b6883def0503cf8d3b3a8a6d10
Signed-off-by: miroslav.macko <miroslav.macko@pantheon.tech>
29 files changed:
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/AddressNormalizationUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/BarrierUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/DeviceInitializationUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/DeviceStateUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/ErrorUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/FlatBatchUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/FlowUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/GroupUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/MatchNormalizationUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/MatchUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/MdSalRegistrationUtils.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/MeterUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/NodeConnectorRefToPortTranslator.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/PathUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/TranslatorLibraryUtil.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/mastership/MastershipChangeServiceManagerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/DeviceStateUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlatBatchUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlowUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/GroupUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MatchNormalizationUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MatchUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MdSalRegistrationUtilsTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MeterUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/NodeConnectorRefToPortTranslatorTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/PathUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/TranslatorLibratyUtilTest.java

index ee11155af092c2e97df42cfb0f4a4b3839ed9946..1692db033bd41058d8416a94ce43614e2272a257 100644 (file)
@@ -69,7 +69,8 @@ public class AddressNormalizationUtil {
         }
 
         final byte[] address = IetfInetUtil.INSTANCE.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Prefix));
-        final byte[] mask = IpConversionUtil.convertIpv6PrefixToByteArray(IpConversionUtil.extractIpv6Prefix(ipv6Prefix));
+        final byte[] mask =
+                IpConversionUtil.convertIpv6PrefixToByteArray(IpConversionUtil.extractIpv6Prefix(ipv6Prefix));
         return normalizeIpv6Address(address, mask);
     }
 
@@ -81,7 +82,8 @@ public class AddressNormalizationUtil {
      * @return normalized Ipv6 prefix
      */
     @Nullable
-    public static Ipv6Prefix normalizeIpv6Arbitrary(@Nullable final Ipv6Address ipv6Address, @Nullable final Ipv6ArbitraryMask ipv4Mask) {
+    public static Ipv6Prefix normalizeIpv6Arbitrary(@Nullable final Ipv6Address ipv6Address,
+                                                    @Nullable final Ipv6ArbitraryMask ipv4Mask) {
         if (Objects.isNull(ipv6Address)) {
             return null;
         }
@@ -118,7 +120,8 @@ public class AddressNormalizationUtil {
         }
 
         final byte[] address = IetfInetUtil.INSTANCE.ipv4AddressBytes(IpConversionUtil.extractIpv4Address(ipv4Prefix));
-        final byte[] mask = IpConversionUtil.convertArbitraryMaskToByteArray(IpConversionUtil.extractIpv4AddressMask(ipv4Prefix));
+        final byte[] mask =
+                IpConversionUtil.convertArbitraryMaskToByteArray(IpConversionUtil.extractIpv4AddressMask(ipv4Prefix));
         return normalizeIpv4Address(address, mask);
     }
 
@@ -130,7 +133,8 @@ public class AddressNormalizationUtil {
      * @return normalized Ipv4 prefix
      */
     @Nullable
-    public static Ipv4Prefix normalizeIpv4Arbitrary(@Nullable final Ipv4Address ipv4Address, @Nullable final DottedQuad ipv4Mask) {
+    public static Ipv4Prefix normalizeIpv4Arbitrary(@Nullable final Ipv4Address ipv4Address,
+                                                    @Nullable final DottedQuad ipv4Mask) {
         if (Objects.isNull(ipv4Address)) {
             return null;
         }
@@ -193,9 +197,9 @@ public class AddressNormalizationUtil {
         final byte[] result = new byte[address.length];
 
         for (int i = 0; i < address.length; i++) {
-            result[i] = Objects.nonNull(mask) ?
-                    (byte) (address[i] & mask[i]) :
-                    address[i];
+            result[i] = Objects.nonNull(mask)
+                    ? (byte) (address[i] & mask[i])
+                    address[i];
         }
 
         try {
@@ -207,26 +211,27 @@ public class AddressNormalizationUtil {
     }
 
     /**
-     * Convert arbitrary mask to prefix mask and append it to textual representation of Inet address
+     * Convert arbitrary mask to prefix mask and append it to textual representation of Inet address.
      *
      * @param address the address
      * @param mask    the mask
      * @return the string
      */
     @Nullable
-    public static String normalizeInetAddressWithMask(@Nullable final InetAddress address, @Nullable final byte[] mask) {
+    public static String normalizeInetAddressWithMask(@Nullable final InetAddress address,
+                                                      @Nullable final byte[] mask) {
         if (Objects.isNull(address)) {
             return null;
         }
 
-        return address.getHostAddress() +
-                (Objects.nonNull(mask)
+        return address.getHostAddress()
+                (Objects.nonNull(mask)
                         ? PREFIX_SEPARATOR + String.valueOf(IpConversionUtil.countBits(mask))
                         : "");
     }
 
     /**
-     * Convert MAC address to it's lower case format
+     * Convert MAC address to it's lower case format.
      *
      * @param macAddress the MAC address
      * @return normalized MAC address
@@ -241,7 +246,7 @@ public class AddressNormalizationUtil {
     }
 
     /**
-     * Convert MAC address mask to it's lower case format and if it is full F mask, return null
+     * Convert MAC address mask to it's lower case format and if it is full F mask, return null.
      *
      * @param macAddress the MAC address
      * @return normalized MAC address
index 51a900959c9c889d3495e940c6a1ad7387ecc2f0..14a7455850c950b367c6774f4e5a75c8560d4389 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 /**
- * provides barrier message chaining and factory methods
+ * Provides barrier message chaining and factory methods.
  */
 public final class BarrierUtil {
 
@@ -34,14 +34,14 @@ public final class BarrierUtil {
 
 
     /**
-     * chain a barrier message - regardless of previous result and use given {@link Function} to combine
-     * original result and barrier result
+     * Chain a barrier message - regardless of previous result and use given {@link Function} to combine
+     * original result and barrier result.
      *
      * @param <T>                type of input future
      * @param input              future to chain barrier to
      * @param nodeRef            target device
      * @param transactionService barrier service
-     * @param compositeTransform
+     * @param compositeTransform composite transform
      * @return future holding both results (input and of the barrier)
      */
     public static <T> ListenableFuture<RpcResult<T>> chainBarrier(
@@ -54,7 +54,8 @@ public final class BarrierUtil {
         final ListenableFuture<RpcResult<Void>> barrierResult = Futures.transformAsync(input,
                 new AsyncFunction<RpcResult<T>, RpcResult<Void>>() {
                     @Override
-                    public ListenableFuture<RpcResult<Void>> apply(@Nullable final RpcResult<T> interInput) throws Exception {
+                    public ListenableFuture<RpcResult<Void>> apply(@Nullable final RpcResult<T> interInput)
+                            throws Exception {
                         resultPair.setLeft(interInput);
                         final SendBarrierInput barrierInput = createSendBarrierInput(nodeRef);
                         return JdkFutureAdapters.listenInPoolThread(transactionService.sendBarrier(barrierInput));
@@ -75,6 +76,8 @@ public final class BarrierUtil {
     }
 
     /**
+     * Creates barrier input.
+     *
      * @param nodeRef rpc routing context
      * @return input for {@link FlowCapableTransactionService#sendBarrier(SendBarrierInput)}
      */
index 116cfe35b01fdb5c2f6943b5a2f529523add39e0..f4896d5ea5be1b4c3db0a378ad66be96f0a97185 100644 (file)
@@ -71,6 +71,7 @@ public class DeviceInitializationUtil {
      * @param deviceInfo device info
      * @param nrOfTables number of tables
      */
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public static void makeEmptyTables(final TxFacade txFacade, final DeviceInfo deviceInfo, final short nrOfTables) {
         if (LOG.isDebugEnabled()) {
             LOG.debug("About to create {} empty tables for node {}.", nrOfTables, deviceInfo.getLOGValue());
index a0380df0f7b772d9b21b2a870a2d4c812c679211..ebef3b83a35fea8fc839d77ef278165f84b5569a 100644 (file)
@@ -18,16 +18,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 
-/**
- * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 20.4.2015.
- */
 public final class DeviceStateUtil {
 
     private DeviceStateUtil() {
         throw new IllegalStateException("This class should not be instantiated");
     }
 
-    public static void setDeviceStateBasedOnV13Capabilities(final DeviceState deviceState, final Capabilities capabilities) {
+    public static void setDeviceStateBasedOnV13Capabilities(final DeviceState deviceState,
+                                                            final Capabilities capabilities) {
         deviceState.setFlowStatisticsAvailable(capabilities.isOFPCFLOWSTATS());
         deviceState.setTableStatisticsAvailable(capabilities.isOFPCTABLESTATS());
         deviceState.setPortStatisticsAvailable(capabilities.isOFPCPORTSTATS());
@@ -35,14 +33,15 @@ public final class DeviceStateUtil {
         deviceState.setGroupAvailable(capabilities.isOFPCGROUPSTATS());
     }
 
-    public static void setDeviceStateBasedOnV10Capabilities(final DeviceState deviceState, final CapabilitiesV10 capabilitiesV10) {
+    public static void setDeviceStateBasedOnV10Capabilities(final DeviceState deviceState,
+                                                            final CapabilitiesV10 capabilitiesV10) {
         deviceState.setFlowStatisticsAvailable(capabilitiesV10.isOFPCFLOWSTATS());
         deviceState.setTableStatisticsAvailable(capabilitiesV10.isOFPCTABLESTATS());
         deviceState.setPortStatisticsAvailable(capabilitiesV10.isOFPCPORTSTATS());
         deviceState.setQueueStatisticsAvailable(capabilitiesV10.isOFPCQUEUESTATS());
     }
 
-    public static KeyedInstanceIdentifier<Node, NodeKey> createNodeInstanceIdentifier(NodeId nodeId){
+    public static KeyedInstanceIdentifier<Node, NodeKey> createNodeInstanceIdentifier(NodeId nodeId) {
         return InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(nodeId));
     }
 }
index 11ed18943f53d28b259a81602b7c1987d95098a6..fc570f6ab670deddd8d9bf0f84f7d77ed30ed715 100644 (file)
@@ -20,7 +20,7 @@ public final class ErrorUtil {
         throw new IllegalStateException("This class should not be instantiated.");
     }
 
-    public static final String errorsToString(final Collection<RpcError> rpcErrors) {
+    public static String errorsToString(final Collection<RpcError> rpcErrors) {
         final StringBuilder errors = new StringBuilder();
         if ((null != rpcErrors) && (rpcErrors.size() > 0)) {
             for (final RpcError rpcError : rpcErrors) {
index f4e31bae8259f915ec58257cbefee5944cbcee10..24ed0f32a8b9f4e93481fc200ee2deb0d1e81609 100644 (file)
@@ -212,11 +212,13 @@ public final class FlatBatchUtil {
      * @param status RPC result status
      * @return ListenableFuture of RPC result with empty list of errors and batch failures
      */
-    public static ListenableFuture<RpcResult<ProcessFlatBatchOutput>> createEmptyRpcBatchResultFuture(final boolean status) {
+    public static ListenableFuture<RpcResult<ProcessFlatBatchOutput>> createEmptyRpcBatchResultFuture(
+            final boolean status) {
         return RpcResultBuilder.<ProcessFlatBatchOutput>status(status)
                                .withRpcErrors(new ArrayList<>())
-                               .withResult(new ProcessFlatBatchOutputBuilder().setBatchFailure(new ArrayList<>()).build())
+                               .withResult(new ProcessFlatBatchOutputBuilder()
+                                       .setBatchFailure(new ArrayList<>())
+                                       .build())
                                .buildFuture();
     }
-
 }
index 616256174bc1ac0d1d80a6abbf56ea426de61ce2..bfa2243d95a000f78fa784f6903028811231ed54 100644 (file)
@@ -48,73 +48,83 @@ public final class FlowUtil {
             RpcResultBuilder.success(Collections.<BatchFailedFlowsOutput>emptyList());
 
     /**
-     * Attach barrier response to given {@link RpcResult}&lt;RemoveFlowsBatchOutput&gt;
+     * Attach barrier response to given {@link RpcResult}&lt;RemoveFlowsBatchOutput&gt;.
      */
-    public static final Function<Pair<RpcResult<RemoveFlowsBatchOutput>, RpcResult<Void>>, RpcResult<RemoveFlowsBatchOutput>>
+    public static final Function<Pair<RpcResult<RemoveFlowsBatchOutput>,
+                                 RpcResult<Void>>,
+                                 RpcResult<RemoveFlowsBatchOutput>>
             FLOW_REMOVE_COMPOSING_TRANSFORM = createComposingFunction();
 
     /**
-     * Attach barrier response to given {@link RpcResult}&lt;AddFlowsBatchOutput&gt;
+     * Attach barrier response to given {@link RpcResult}&lt;AddFlowsBatchOutput&gt;.
      */
     public static final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
             FLOW_ADD_COMPOSING_TRANSFORM = createComposingFunction();
 
     /**
-     * Attach barrier response to given {@link RpcResult}&lt;UpdateFlowsBatchOutput&gt;
+     * Attach barrier response to given {@link RpcResult}&lt;UpdateFlowsBatchOutput&gt;.
      */
-    public static final Function<Pair<RpcResult<UpdateFlowsBatchOutput>, RpcResult<Void>>, RpcResult<UpdateFlowsBatchOutput>>
+    public static final Function<Pair<RpcResult<UpdateFlowsBatchOutput>,
+                                 RpcResult<Void>>,
+                                 RpcResult<UpdateFlowsBatchOutput>>
             FLOW_UPDATE_COMPOSING_TRANSFORM = createComposingFunction();
 
     /**
-     * Gather errors into collection and wrap it into {@link RpcResult} and propagate all {@link RpcError}
+     * Gather errors into collection and wrap it into {@link RpcResult} and propagate all {@link RpcError}.
      */
-    public static final Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<RemoveFlowsBatchOutput>> FLOW_REMOVE_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<RemoveFlowsBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<RemoveFlowsBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedFlowsOutput>> batchFlowsCumulativeResult) {
-                    final RemoveFlowsBatchOutput batchOutput = new RemoveFlowsBatchOutputBuilder()
-                            .setBatchFailedFlowsOutput(batchFlowsCumulativeResult.getResult()).build();
+    public static final Function<RpcResult<List<BatchFailedFlowsOutput>>,
+                                 RpcResult<RemoveFlowsBatchOutput>> FLOW_REMOVE_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<RemoveFlowsBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<RemoveFlowsBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedFlowsOutput>> batchFlowsCumulativeResult) {
+                final RemoveFlowsBatchOutput batchOutput = new RemoveFlowsBatchOutputBuilder()
+                        .setBatchFailedFlowsOutput(batchFlowsCumulativeResult.getResult()).build();
 
-                    final RpcResultBuilder<RemoveFlowsBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchFlowsCumulativeResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
+                final RpcResultBuilder<RemoveFlowsBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchFlowsCumulativeResult, batchOutput);
+                return resultBld.build();
+            }
+        };
 
     /**
-     * Gather errors into collection and wrap it into {@link RpcResult} and propagate all {@link RpcError}
+     * Gather errors into collection and wrap it into {@link RpcResult} and propagate all {@link RpcError}.
      */
-    public static final Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<AddFlowsBatchOutput>> FLOW_ADD_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<AddFlowsBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<AddFlowsBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedFlowsOutput>> batchFlowsCumulativeResult) {
-                    final AddFlowsBatchOutput batchOutput = new AddFlowsBatchOutputBuilder()
-                            .setBatchFailedFlowsOutput(batchFlowsCumulativeResult.getResult()).build();
+    public static final Function<RpcResult<List<BatchFailedFlowsOutput>>,
+                                 RpcResult<AddFlowsBatchOutput>> FLOW_ADD_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<AddFlowsBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<AddFlowsBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedFlowsOutput>> batchFlowsCumulativeResult) {
+                final AddFlowsBatchOutput batchOutput = new AddFlowsBatchOutputBuilder()
+                        .setBatchFailedFlowsOutput(batchFlowsCumulativeResult.getResult()).build();
 
-                    final RpcResultBuilder<AddFlowsBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchFlowsCumulativeResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
+                final RpcResultBuilder<AddFlowsBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchFlowsCumulativeResult, batchOutput);
+                return resultBld.build();
+            }
+        };
 
     /**
-     * Gather errors into collection and wrap it into {@link RpcResult} and propagate all {@link RpcError}
+     * Gather errors into collection and wrap it into {@link RpcResult} and propagate all {@link RpcError}.
      */
-    public static final Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<UpdateFlowsBatchOutput>> FLOW_UPDATE_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<UpdateFlowsBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<UpdateFlowsBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedFlowsOutput>> batchFlowsCumulativeResult) {
-                    final UpdateFlowsBatchOutput batchOutput = new UpdateFlowsBatchOutputBuilder()
-                            .setBatchFailedFlowsOutput(batchFlowsCumulativeResult.getResult()).build();
+    public static final Function<RpcResult<List<BatchFailedFlowsOutput>>,
+                                 RpcResult<UpdateFlowsBatchOutput>> FLOW_UPDATE_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedFlowsOutput>>, RpcResult<UpdateFlowsBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<UpdateFlowsBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedFlowsOutput>> batchFlowsCumulativeResult) {
+                final UpdateFlowsBatchOutput batchOutput = new UpdateFlowsBatchOutputBuilder()
+                        .setBatchFailedFlowsOutput(batchFlowsCumulativeResult.getResult()).build();
 
-                    final RpcResultBuilder<UpdateFlowsBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchFlowsCumulativeResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
+                final RpcResultBuilder<UpdateFlowsBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchFlowsCumulativeResult, batchOutput);
+                return resultBld.build();
+            }
+        };
 
     private FlowUtil() {
         throw new IllegalStateException("This class should not be instantiated.");
@@ -124,13 +134,12 @@ public final class FlowUtil {
      * Wrap given list of problematic flow-ids into {@link RpcResult} of given type.
      *
      * @param batchFlowsCumulativeResult list of ids failed flows
-     * @param batchOutput
-     * @param <T>                        flow operation type
+     * @param batchOutput flow operation type
      * @return batch flow operation output of given type containing list of flow-ids and corresponding success flag
      */
-    private static <T extends BatchFlowOutputListGrouping>
-    RpcResultBuilder<T> createCumulativeRpcResult(final @Nullable RpcResult<List<BatchFailedFlowsOutput>> batchFlowsCumulativeResult,
-                                                  final T batchOutput) {
+    private static <T extends BatchFlowOutputListGrouping> RpcResultBuilder<T> createCumulativeRpcResult(
+            final @Nullable RpcResult<List<BatchFailedFlowsOutput>> batchFlowsCumulativeResult,
+            final T batchOutput) {
         final RpcResultBuilder<T> resultBld;
         if (batchFlowsCumulativeResult.isSuccessful()) {
             resultBld = RpcResultBuilder.success(batchOutput);
@@ -153,7 +162,7 @@ public final class FlowUtil {
      */
     @VisibleForTesting
     static <T extends BatchFlowOutputListGrouping>
-    Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>> createComposingFunction() {
+        Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>> createComposingFunction() {
         return new Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>>() {
             @Nullable
             @Override
@@ -210,7 +219,7 @@ public final class FlowUtil {
     private static class CumulatingFunction<O> {
         private final List<? extends BatchFlowIdGrouping> inputBatchFlows;
 
-        public CumulatingFunction(List<? extends BatchFlowIdGrouping> inputBatchFlows) {
+        CumulatingFunction(List<? extends BatchFlowIdGrouping> inputBatchFlows) {
             this.inputBatchFlows = inputBatchFlows;
         }
 
index d572eea2340e986aeab058169b46704f1d64eeda..64a98e3cd9d29c3326df398c0a459d2857b8e12f 100644 (file)
@@ -34,67 +34,79 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.Up
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.output.list.grouping.BatchFailedGroupsOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.output.list.grouping.BatchFailedGroupsOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType;
 
 /**
- * provides group util methods
+ * Provides group util methods.
  */
 public final class GroupUtil {
 
     private static final RpcResultBuilder<List<BatchFailedGroupsOutput>> SUCCESSFUL_GROUP_OUTPUT_RPC_RESULT =
             RpcResultBuilder.success(Collections.<BatchFailedGroupsOutput>emptyList());
 
-    public static final Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<AddGroupsBatchOutput>> GROUP_ADD_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<AddGroupsBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<AddGroupsBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedGroupsOutput>> batchGroupsCumulatedResult) {
-                    final AddGroupsBatchOutput batchOutput = new AddGroupsBatchOutputBuilder()
-                            .setBatchFailedGroupsOutput(batchGroupsCumulatedResult.getResult()).build();
+    public static final Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<AddGroupsBatchOutput>>
+        GROUP_ADD_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<AddGroupsBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<AddGroupsBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedGroupsOutput>> batchGroupsCumulatedResult) {
+                final AddGroupsBatchOutput batchOutput = new AddGroupsBatchOutputBuilder()
+                        .setBatchFailedGroupsOutput(batchGroupsCumulatedResult.getResult()).build();
 
-                    final RpcResultBuilder<AddGroupsBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchGroupsCumulatedResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
-    public static final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
-            GROUP_ADD_COMPOSING_TRANSFORM = createComposingFunction();
+                final RpcResultBuilder<AddGroupsBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchGroupsCumulatedResult, batchOutput);
+                return resultBld.build();
+            }
+        };
+    public static final Function<Pair<RpcResult<AddGroupsBatchOutput>,
+                                 RpcResult<Void>>,
+                                 RpcResult<AddGroupsBatchOutput>>
+        GROUP_ADD_COMPOSING_TRANSFORM = createComposingFunction();
 
-    public static final Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<RemoveGroupsBatchOutput>> GROUP_REMOVE_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<RemoveGroupsBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<RemoveGroupsBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedGroupsOutput>> batchGroupsCumulatedResult) {
-                    final RemoveGroupsBatchOutput batchOutput = new RemoveGroupsBatchOutputBuilder()
-                            .setBatchFailedGroupsOutput(batchGroupsCumulatedResult.getResult()).build();
+    public static final Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<RemoveGroupsBatchOutput>>
+        GROUP_REMOVE_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<RemoveGroupsBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<RemoveGroupsBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedGroupsOutput>> batchGroupsCumulatedResult) {
+                final RemoveGroupsBatchOutput batchOutput = new RemoveGroupsBatchOutputBuilder()
+                        .setBatchFailedGroupsOutput(batchGroupsCumulatedResult.getResult()).build();
 
-                    final RpcResultBuilder<RemoveGroupsBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchGroupsCumulatedResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
-    public static final Function<Pair<RpcResult<RemoveGroupsBatchOutput>, RpcResult<Void>>, RpcResult<RemoveGroupsBatchOutput>>
-            GROUP_REMOVE_COMPOSING_TRANSFORM = createComposingFunction();
+                final RpcResultBuilder<RemoveGroupsBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchGroupsCumulatedResult, batchOutput);
+                return resultBld.build();
+            }
+        };
+    public static final Function<Pair<RpcResult<RemoveGroupsBatchOutput>,
+                                      RpcResult<Void>>,
+                                      RpcResult<RemoveGroupsBatchOutput>>
+        GROUP_REMOVE_COMPOSING_TRANSFORM = createComposingFunction();
 
-    public static final Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<UpdateGroupsBatchOutput>> GROUP_UPDATE_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<UpdateGroupsBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<UpdateGroupsBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedGroupsOutput>> batchGroupsCumulatedResult) {
-                    final UpdateGroupsBatchOutput batchOutput = new UpdateGroupsBatchOutputBuilder()
-                            .setBatchFailedGroupsOutput(batchGroupsCumulatedResult.getResult()).build();
+    public static final Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<UpdateGroupsBatchOutput>>
+        GROUP_UPDATE_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedGroupsOutput>>, RpcResult<UpdateGroupsBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<UpdateGroupsBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedGroupsOutput>> batchGroupsCumulatedResult) {
+                final UpdateGroupsBatchOutput batchOutput = new UpdateGroupsBatchOutputBuilder()
+                        .setBatchFailedGroupsOutput(batchGroupsCumulatedResult.getResult()).build();
 
-                    final RpcResultBuilder<UpdateGroupsBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchGroupsCumulatedResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
-    public static final Function<Pair<RpcResult<UpdateGroupsBatchOutput>, RpcResult<Void>>, RpcResult<UpdateGroupsBatchOutput>>
+                final RpcResultBuilder<UpdateGroupsBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchGroupsCumulatedResult, batchOutput);
+                return resultBld.build();
+            }
+        };
+    public static final Function<Pair<RpcResult<UpdateGroupsBatchOutput>,
+                                      RpcResult<Void>>,
+                                      RpcResult<UpdateGroupsBatchOutput>>
             GROUP_UPDATE_COMPOSING_TRANSFORM = createComposingFunction();
 
     private GroupUtil() {
@@ -102,8 +114,9 @@ public final class GroupUtil {
     }
 
     /**
-     * @param nodePath
-     * @param groupId
+     * Method build the group path.
+     * @param nodePath - node path
+     * @param groupId - group Id
      * @return instance identifier assembled for given node and group
      */
     public static GroupRef buildGroupPath(final InstanceIdentifier<Node> nodePath, final GroupId groupId) {
@@ -115,25 +128,27 @@ public final class GroupUtil {
     }
 
     public static <O> Function<List<RpcResult<O>>, RpcResult<List<BatchFailedGroupsOutput>>> createCumulatingFunction(
-            final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group> inputBatchGroups) {
+            final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group>
+                    inputBatchGroups) {
         return createCumulatingFunction(inputBatchGroups, Iterables.size(inputBatchGroups));
     }
 
     public static <O> Function<List<RpcResult<O>>, RpcResult<List<BatchFailedGroupsOutput>>> createCumulatingFunction(
-            final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group> inputBatchGroups,
-            final int sizeOfInputBatch) {
+            final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group>
+                    inputBatchGroups, final int sizeOfInputBatch) {
         return new CumulatingFunction<O>(inputBatchGroups, sizeOfInputBatch).invoke();
     }
 
     /*
      * Method returns the bitmap of actions supported by each group.
      *
-     * @param actionsSupported
+     * @param actionsSupported - list of supported actions
      * @return
      */
     public static List<Long> extractGroupActionsSupportBitmap(final List<ActionType> actionsSupported) {
         List<Long> supportActionByGroups = new ArrayList<>();
-        for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType supportedActions : actionsSupported) {
+        for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType supportedActions
+                : actionsSupported) {
             long supportActionBitmap = 0;
             supportActionBitmap |= supportedActions.isOFPATOUTPUT() ? (1) : 0;
             supportActionBitmap |= supportedActions.isOFPATCOPYTTLOUT() ? (1 << 11) : 0;
@@ -166,8 +181,8 @@ public final class GroupUtil {
      * @return reusable static function
      */
     @VisibleForTesting
-    static <T extends BatchGroupOutputListGrouping>
-    Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>> createComposingFunction() {
+    static <T extends BatchGroupOutputListGrouping> Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>>
+        createComposingFunction() {
         return new Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>>() {
             @Nullable
             @Override
@@ -194,13 +209,12 @@ public final class GroupUtil {
      * Wrap given list of problematic group-ids into {@link RpcResult} of given type.
      *
      * @param batchGroupsCumulativeResult list of ids failed groups
-     * @param batchOutput
-     * @param <T>                         group operation type
+     * @param batchOutput group operation type
      * @return batch group operation output of given type containing list of group-ids and corresponding success flag
      */
-    private static <T extends BatchGroupOutputListGrouping>
-    RpcResultBuilder<T> createCumulativeRpcResult(@Nullable final RpcResult<List<BatchFailedGroupsOutput>> batchGroupsCumulativeResult,
-                                                  final T batchOutput) {
+    private static <T extends BatchGroupOutputListGrouping> RpcResultBuilder<T> createCumulativeRpcResult(
+        @Nullable
+        final RpcResult<List<BatchFailedGroupsOutput>> batchGroupsCumulativeResult, final T batchOutput) {
         final RpcResultBuilder<T> resultBld;
         if (batchGroupsCumulativeResult.isSuccessful()) {
             resultBld = RpcResultBuilder.success(batchOutput);
@@ -213,10 +227,13 @@ public final class GroupUtil {
     }
 
     private static class CumulatingFunction<O> {
-        private final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group> inputBatchGroups;
+        private final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group>
+                inputBatchGroups;
         private final int sizeOfInputBatch;
 
-        public CumulatingFunction(Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group> inputBatchGroups, int sizeOfInputBatch) {
+        CumulatingFunction(
+                Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group>
+                        inputBatchGroups, int sizeOfInputBatch) {
             this.inputBatchGroups = inputBatchGroups;
             this.sizeOfInputBatch = sizeOfInputBatch;
         }
index 527379c7cf9fe46d773343d92a58c7297e523d7e..6aa643104aa23c3731548eff890b1137955fd096 100644 (file)
@@ -47,14 +47,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder;
 
 /**
- * Utility class for match normalization
+ * Utility class for match normalization.
  */
 public final class MatchNormalizationUtil {
     // Cache normalizers for common OpenFlow versions
     private static final Map<Short, Set<Function<MatchBuilder, MatchBuilder>>> NORMALIZERS = ImmutableMap
             .<Short, Set<Function<MatchBuilder, MatchBuilder>>>builder()
-            .put(OFConstants.OFP_VERSION_1_0, createNormalizers(OFConstants.OFP_VERSION_1_0).collect(Collectors.toSet()))
-            .put(OFConstants.OFP_VERSION_1_3, createNormalizers(OFConstants.OFP_VERSION_1_3).collect(Collectors.toSet()))
+            .put(OFConstants.OFP_VERSION_1_0, createNormalizers(OFConstants.OFP_VERSION_1_0)
+                    .collect(Collectors.toSet()))
+            .put(OFConstants.OFP_VERSION_1_3, createNormalizers(OFConstants.OFP_VERSION_1_3)
+                    .collect(Collectors.toSet()))
             .build();
 
     private MatchNormalizationUtil() {
@@ -82,16 +84,16 @@ public final class MatchNormalizationUtil {
     @Nonnull
     private static Stream<Function<MatchBuilder, MatchBuilder>> createNormalizers(final short version) {
         return Stream.of(
-                MatchNormalizationUtil::normalizeExtensionMatch,
-                MatchNormalizationUtil::normalizeEthernetMatch,
-                MatchNormalizationUtil::normalizeArpMatch,
-                MatchNormalizationUtil::normalizeTunnelIpv4Match,
-                MatchNormalizationUtil::normalizeIpv4Match,
-                MatchNormalizationUtil::normalizeIpv4MatchArbitraryBitMask,
-                MatchNormalizationUtil::normalizeIpv6Match,
-                MatchNormalizationUtil::normalizeIpv6MatchArbitraryBitMask,
-                (match) -> normalizeInPortMatch(match, version),
-                (match) -> normalizeInPhyPortMatch(match, version));
+            MatchNormalizationUtil::normalizeExtensionMatch,
+            MatchNormalizationUtil::normalizeEthernetMatch,
+            MatchNormalizationUtil::normalizeArpMatch,
+            MatchNormalizationUtil::normalizeTunnelIpv4Match,
+            MatchNormalizationUtil::normalizeIpv4Match,
+            MatchNormalizationUtil::normalizeIpv4MatchArbitraryBitMask,
+            MatchNormalizationUtil::normalizeIpv6Match,
+            MatchNormalizationUtil::normalizeIpv6MatchArbitraryBitMask,
+            (match) -> normalizeInPortMatch(match, version),
+            (match) -> normalizeInPhyPortMatch(match, version));
     }
 
     @Nonnull
index 2f629fdf876a8c8e306f50629e8eba016d85215b..e4e4ad4da09c47235680ab3adc0395aa1436c7c8 100644 (file)
@@ -57,61 +57,63 @@ public final class MatchUtil {
             })
             .put(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow
                     .Match.class, (match) -> {
-                final MatchBuilder matchBuilder = new MatchBuilder(match);
+                    final MatchBuilder matchBuilder = new MatchBuilder(match);
 
-                resolveExtensions(match).ifPresent(extensionLists -> matchBuilder
-                        .addAugmentation(GeneralAugMatchNotifUpdateFlowStats.class,
-                                new GeneralAugMatchNodesNodeTableFlowBuilder()
-                                        .setExtensionList(extensionLists)
-                                        .build()));
+                    resolveExtensions(match).ifPresent(extensionLists -> matchBuilder
+                            .addAugmentation(GeneralAugMatchNotifUpdateFlowStats.class,
+                                    new GeneralAugMatchNodesNodeTableFlowBuilder()
+                                            .setExtensionList(extensionLists)
+                                            .build()));
 
-                return matchBuilder.build();
-            })
+                    return matchBuilder.build();
+                })
             .put(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.mod.removed
                     .Match.class, (match) -> {
-                final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.mod.removed
-                        .MatchBuilder matchBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types
-                        .rev131026.flow.mod.removed.MatchBuilder(match);
-
-                resolveExtensions(match).ifPresent(extensionLists -> matchBuilder
-                        .addAugmentation(GeneralAugMatchNotifSwitchFlowRemoved.class,
-                                new GeneralAugMatchNotifSwitchFlowRemovedBuilder()
-                                        .setExtensionList(extensionLists)
-                                        .build()));
-
-                return matchBuilder.build();
-            })
+                    final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.mod.removed
+                            .MatchBuilder matchBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types
+                            .rev131026.flow.mod.removed.MatchBuilder(match);
+
+                    resolveExtensions(match).ifPresent(extensionLists -> matchBuilder
+                            .addAugmentation(GeneralAugMatchNotifSwitchFlowRemoved.class,
+                                    new GeneralAugMatchNotifSwitchFlowRemovedBuilder()
+                                            .setExtensionList(extensionLists)
+                                            .build()));
+
+                    return matchBuilder.build();
+                })
             .put(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received
                     .Match.class, (match) -> {
-                final org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received
-                        .MatchBuilder matchBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
-                        .rev130709.packet.received.MatchBuilder(match);
-
-                resolveExtensions(match).ifPresent(extensionLists -> matchBuilder
-                        .addAugmentation(GeneralAugMatchNotifPacketIn.class,
-                                new GeneralAugMatchNotifPacketInBuilder()
-                                        .setExtensionList(extensionLists)
-                                        .build()));
-
-                return matchBuilder.build();
-            })
+                    final org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received
+                            .MatchBuilder matchBuilder =
+                            new org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
+                            .rev130709.packet.received.MatchBuilder(match);
+
+                    resolveExtensions(match).ifPresent(extensionLists -> matchBuilder
+                            .addAugmentation(GeneralAugMatchNotifPacketIn.class,
+                                    new GeneralAugMatchNotifPacketInBuilder()
+                                            .setExtensionList(extensionLists)
+                                            .build()));
+
+                    return matchBuilder.build();
+                })
             .put(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.in.message
                     .Match.class, (match) -> {
-                final org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.in.message
-                        .MatchBuilder matchBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
-                        .rev130709.packet.in.message.MatchBuilder(match);
-
-                resolveExtensions(match).ifPresent(extensionLists -> matchBuilder
-                        .addAugmentation(GeneralAugMatchPacketInMessage.class,
-                                new GeneralAugMatchPacketInMessageBuilder()
-                                        .setExtensionList(extensionLists)
-                                        .build()));
-
-                return matchBuilder.build();
-            })
+                    final org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.in.message
+                            .MatchBuilder matchBuilder =
+                            new org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
+                            .rev130709.packet.in.message.MatchBuilder(match);
+
+                    resolveExtensions(match).ifPresent(extensionLists -> matchBuilder
+                            .addAugmentation(GeneralAugMatchPacketInMessage.class,
+                                    new GeneralAugMatchPacketInMessageBuilder()
+                                            .setExtensionList(extensionLists)
+                                            .build()));
+
+                    return matchBuilder.build();
+                })
             .build();
 
-    private MatchUtil(){
+    private MatchUtil() {
         throw new IllegalStateException("This class should not be instantiated.");
     }
 
@@ -134,7 +136,8 @@ public final class MatchUtil {
         matchV10Builder.setNwTos(zeroShort);
         matchV10Builder.setTpDst(zeroInteger);
         matchV10Builder.setTpSrc(zeroInteger);
-        FlowWildcardsV10 flowWildcardsV10 = new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true);
+        FlowWildcardsV10 flowWildcardsV10 =
+                new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true);
         matchV10Builder.setWildcards(flowWildcardsV10);
         return matchV10Builder;
     }
index c3bfc0e38cd76cfc528e164555d1eebfc844456e..918aa951e22e41d8a7ed4e68c2bc1ab0f7a4426a 100644 (file)
@@ -74,9 +74,14 @@ public class MdSalRegistrationUtils {
     }
 
     /**
-     * Method registers all OF services for role {@link OfpRole#BECOMEMASTER}
-     *  @param rpcContext    - registration processing is implemented in {@link org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext}
-     * @param deviceContext - every service needs {@link org.opendaylight.openflowplugin.api.openflow.device.DeviceContext} as input parameter
+     * Method registers all OF services for role {@link OfpRole#BECOMEMASTER}.
+     *
+     * @param rpcContext    - registration processing is implemented in
+     *        {@link org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext}
+     *
+     * @param deviceContext - every service needs
+     *        {@link org.opendaylight.openflowplugin.api.openflow.device.DeviceContext} as input parameter
+     *
      * @param convertorExecutor convertor executor
      */
     public static void registerServices(@Nonnull final RpcContext rpcContext,
@@ -89,21 +94,30 @@ public class MdSalRegistrationUtils {
 
         // create service instances
         final SalFlowServiceImpl salFlowService = new SalFlowServiceImpl(rpcContext, deviceContext, convertorExecutor);
-        final FlowCapableTransactionServiceImpl flowCapableTransactionService = new FlowCapableTransactionServiceImpl(rpcContext, deviceContext);
-        final SalGroupServiceImpl salGroupService = new SalGroupServiceImpl(rpcContext, deviceContext, convertorExecutor);
-        final SalMeterServiceImpl salMeterService = new SalMeterServiceImpl(rpcContext, deviceContext, convertorExecutor);
+        final FlowCapableTransactionServiceImpl flowCapableTransactionService =
+                new FlowCapableTransactionServiceImpl(rpcContext, deviceContext);
+        final SalGroupServiceImpl salGroupService =
+                new SalGroupServiceImpl(rpcContext, deviceContext, convertorExecutor);
+        final SalMeterServiceImpl salMeterService =
+                new SalMeterServiceImpl(rpcContext, deviceContext, convertorExecutor);
 
         // register routed service instances
-        rpcContext.registerRpcServiceImplementation(SalEchoService.class, new SalEchoServiceImpl(rpcContext, deviceContext));
+        rpcContext.registerRpcServiceImplementation(SalEchoService.class,
+                new SalEchoServiceImpl(rpcContext, deviceContext));
         rpcContext.registerRpcServiceImplementation(SalFlowService.class, salFlowService);
         rpcContext.registerRpcServiceImplementation(FlowCapableTransactionService.class, flowCapableTransactionService);
         rpcContext.registerRpcServiceImplementation(SalMeterService.class, salMeterService);
         rpcContext.registerRpcServiceImplementation(SalGroupService.class, salGroupService);
-        rpcContext.registerRpcServiceImplementation(SalTableService.class, new SalTableServiceImpl(rpcContext, deviceContext, convertorExecutor, multipartWriterProvider));
-        rpcContext.registerRpcServiceImplementation(SalPortService.class, new SalPortServiceImpl(rpcContext, deviceContext, convertorExecutor));
-        rpcContext.registerRpcServiceImplementation(PacketProcessingService.class, new PacketProcessingServiceImpl(rpcContext, deviceContext, convertorExecutor));
-        rpcContext.registerRpcServiceImplementation(NodeConfigService.class, new NodeConfigServiceImpl(rpcContext, deviceContext));
-        rpcContext.registerRpcServiceImplementation(OpendaylightFlowStatisticsService.class, OpendaylightFlowStatisticsServiceImpl.createWithOook(rpcContext, deviceContext, convertorExecutor));
+        rpcContext.registerRpcServiceImplementation(SalTableService.class,
+                new SalTableServiceImpl(rpcContext, deviceContext, convertorExecutor, multipartWriterProvider));
+        rpcContext.registerRpcServiceImplementation(SalPortService.class,
+                new SalPortServiceImpl(rpcContext, deviceContext, convertorExecutor));
+        rpcContext.registerRpcServiceImplementation(PacketProcessingService.class,
+                new PacketProcessingServiceImpl(rpcContext, deviceContext, convertorExecutor));
+        rpcContext.registerRpcServiceImplementation(NodeConfigService.class,
+                new NodeConfigServiceImpl(rpcContext, deviceContext));
+        rpcContext.registerRpcServiceImplementation(OpendaylightFlowStatisticsService.class,
+                OpendaylightFlowStatisticsServiceImpl.createWithOook(rpcContext, deviceContext, convertorExecutor));
 
         // register direct statistics gathering services
         rpcContext.registerRpcServiceImplementation(OpendaylightDirectStatisticsService.class,
@@ -129,17 +143,22 @@ public class MdSalRegistrationUtils {
         //register onf extension bundles
         rpcContext.registerRpcServiceImplementation(SalBundleService.class,
                 new SalBundleServiceImpl(new SalExperimenterMessageServiceImpl(
-                        rpcContext, deviceContext, extensionConverterProvider
-                )));
+                        rpcContext, deviceContext, extensionConverterProvider)));
     }
 
     /**
      * Support deprecated statistic related services for backward compatibility. The only exception from deprecation is
      * the aggregated flow statistic with match criteria input.
-     * @param rpcContext
-     * @param deviceContext
-     * @param notificationPublishService
-     * @param convertorExecutor
+     *
+     * @param rpcContext    - registration processing is implemented in
+     *        {@link org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext}
+     *
+     * @param deviceContext - every service needs
+     *        {@link org.opendaylight.openflowplugin.api.openflow.device.DeviceContext} as input parameter
+     *
+     * @param notificationPublishService - notification service
+     *
+     * @param convertorExecutor - convertor executor
      */
     public static void registerStatCompatibilityServices(final RpcContext rpcContext, final DeviceContext deviceContext,
                                                          final NotificationPublishService notificationPublishService,
@@ -152,19 +171,25 @@ public class MdSalRegistrationUtils {
 
         // attach delegate to flow statistics service (to cover all but aggregated stats with match filter input)
         final OpendaylightFlowStatisticsServiceDelegateImpl flowStatisticsDelegate =
-                new OpendaylightFlowStatisticsServiceDelegateImpl(rpcContext, deviceContext, notificationPublishService, new AtomicLong(), convertorExecutor);
+                new OpendaylightFlowStatisticsServiceDelegateImpl(rpcContext, deviceContext, notificationPublishService,
+                        new AtomicLong(), convertorExecutor);
         ((Delegator<OpendaylightFlowStatisticsService>) flowStatisticsService).setDelegate(flowStatisticsDelegate);
 
         // register all statistics (deprecated) services
         rpcContext.registerRpcServiceImplementation(OpendaylightFlowTableStatisticsService.class,
-                new OpendaylightFlowTableStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService));
+                new OpendaylightFlowTableStatisticsServiceImpl(rpcContext, deviceContext,
+                        compatibilityXidSeed, notificationPublishService));
         rpcContext.registerRpcServiceImplementation(OpendaylightGroupStatisticsService.class,
-                new OpendaylightGroupStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService, convertorExecutor));
+                new OpendaylightGroupStatisticsServiceImpl(rpcContext, deviceContext,
+                        compatibilityXidSeed, notificationPublishService, convertorExecutor));
         rpcContext.registerRpcServiceImplementation(OpendaylightMeterStatisticsService.class,
-                new OpendaylightMeterStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService, convertorExecutor));
+                new OpendaylightMeterStatisticsServiceImpl(rpcContext, deviceContext,
+                        compatibilityXidSeed, notificationPublishService, convertorExecutor));
         rpcContext.registerRpcServiceImplementation(OpendaylightQueueStatisticsService.class,
-                new OpendaylightQueueStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService));
+                new OpendaylightQueueStatisticsServiceImpl(rpcContext, deviceContext,
+                        compatibilityXidSeed, notificationPublishService));
         rpcContext.registerRpcServiceImplementation(OpendaylightPortStatisticsService.class,
-                new OpendaylightPortStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService));
+                new OpendaylightPortStatisticsServiceImpl(rpcContext, deviceContext,
+                        compatibilityXidSeed, notificationPublishService));
     }
 }
index e31cafd51570baf341fe16d4b88b8b38be085309..78c60721088e2e72daaed840d15f76df5dc184a7 100644 (file)
@@ -41,68 +41,81 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 /**
- * provides meter util methods
+ * Provides meter util methods.
  */
 public final class MeterUtil {
 
     private static final RpcResultBuilder<List<BatchFailedMetersOutput>> SUCCESSFUL_METER_OUTPUT_RPC_RESULT =
             RpcResultBuilder.success(Collections.<BatchFailedMetersOutput>emptyList());
 
-    public static final Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<AddMetersBatchOutput>> METER_ADD_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<AddMetersBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<AddMetersBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedMetersOutput>> batchMetersCumulatedResult) {
-                    final AddMetersBatchOutput batchOutput = new AddMetersBatchOutputBuilder()
-                            .setBatchFailedMetersOutput(batchMetersCumulatedResult.getResult()).build();
-
-                    final RpcResultBuilder<AddMetersBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchMetersCumulatedResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
-    public static final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
-            METER_ADD_COMPOSING_TRANSFORM = createComposingFunction();
-
-    public static final Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<RemoveMetersBatchOutput>> METER_REMOVE_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<RemoveMetersBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<RemoveMetersBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedMetersOutput>> batchMetersCumulatedResult) {
-                    final RemoveMetersBatchOutput batchOutput = new RemoveMetersBatchOutputBuilder()
-                            .setBatchFailedMetersOutput(batchMetersCumulatedResult.getResult()).build();
+    public static final Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<AddMetersBatchOutput>>
+        METER_ADD_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<AddMetersBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<AddMetersBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedMetersOutput>> batchMetersCumulatedResult) {
+                final AddMetersBatchOutput batchOutput = new AddMetersBatchOutputBuilder()
+                        .setBatchFailedMetersOutput(batchMetersCumulatedResult.getResult()).build();
 
-                    final RpcResultBuilder<RemoveMetersBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchMetersCumulatedResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
-    public static final Function<Pair<RpcResult<RemoveMetersBatchOutput>, RpcResult<Void>>, RpcResult<RemoveMetersBatchOutput>>
-            METER_REMOVE_COMPOSING_TRANSFORM = createComposingFunction();
+                final RpcResultBuilder<AddMetersBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchMetersCumulatedResult, batchOutput);
+                return resultBld.build();
+            }
+        };
+    public static final Function<Pair<RpcResult<AddMetersBatchOutput>,
+                                      RpcResult<Void>>,
+                                      RpcResult<AddMetersBatchOutput>>
+        METER_ADD_COMPOSING_TRANSFORM = createComposingFunction();
+
+    public static final Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<RemoveMetersBatchOutput>>
+        METER_REMOVE_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<RemoveMetersBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<RemoveMetersBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedMetersOutput>> batchMetersCumulatedResult) {
+                final RemoveMetersBatchOutput batchOutput = new RemoveMetersBatchOutputBuilder()
+                        .setBatchFailedMetersOutput(batchMetersCumulatedResult.getResult()).build();
 
-    public static final Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<UpdateMetersBatchOutput>> METER_UPDATE_TRANSFORM =
-            new Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<UpdateMetersBatchOutput>>() {
-                @Nullable
-                @Override
-                public RpcResult<UpdateMetersBatchOutput> apply(@Nullable final RpcResult<List<BatchFailedMetersOutput>> batchMetersCumulatedResult) {
-                    final UpdateMetersBatchOutput batchOutput = new UpdateMetersBatchOutputBuilder()
-                            .setBatchFailedMetersOutput(batchMetersCumulatedResult.getResult()).build();
+                final RpcResultBuilder<RemoveMetersBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchMetersCumulatedResult, batchOutput);
+                return resultBld.build();
+            }
+        };
+    public static final Function<Pair<RpcResult<RemoveMetersBatchOutput>,
+                                      RpcResult<Void>>,
+                                      RpcResult<RemoveMetersBatchOutput>>
+        METER_REMOVE_COMPOSING_TRANSFORM = createComposingFunction();
+
+    public static final Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<UpdateMetersBatchOutput>>
+        METER_UPDATE_TRANSFORM =
+        new Function<RpcResult<List<BatchFailedMetersOutput>>, RpcResult<UpdateMetersBatchOutput>>() {
+            @Nullable
+            @Override
+            public RpcResult<UpdateMetersBatchOutput> apply(
+                    @Nullable final RpcResult<List<BatchFailedMetersOutput>> batchMetersCumulatedResult) {
+                final UpdateMetersBatchOutput batchOutput = new UpdateMetersBatchOutputBuilder()
+                        .setBatchFailedMetersOutput(batchMetersCumulatedResult.getResult()).build();
 
-                    final RpcResultBuilder<UpdateMetersBatchOutput> resultBld =
-                            createCumulativeRpcResult(batchMetersCumulatedResult, batchOutput);
-                    return resultBld.build();
-                }
-            };
-    public static final Function<Pair<RpcResult<UpdateMetersBatchOutput>, RpcResult<Void>>, RpcResult<UpdateMetersBatchOutput>>
-            METER_UPDATE_COMPOSING_TRANSFORM = createComposingFunction();
+                final RpcResultBuilder<UpdateMetersBatchOutput> resultBld =
+                        createCumulativeRpcResult(batchMetersCumulatedResult, batchOutput);
+                return resultBld.build();
+            }
+        };
+    public static final Function<Pair<RpcResult<UpdateMetersBatchOutput>,
+                                      RpcResult<Void>>,
+                                      RpcResult<UpdateMetersBatchOutput>>
+        METER_UPDATE_COMPOSING_TRANSFORM = createComposingFunction();
 
     private MeterUtil() {
         throw new IllegalStateException("This class should not be instantiated.");
     }
 
     /**
-     * @param nodePath
-     * @param meterId
+     * Create meter path.
+     * @param nodePath node path
+     * @param meterId meter Id
      * @return instance identifier assembled for given node and meter
      */
     public static MeterRef buildMeterPath(final InstanceIdentifier<Node> nodePath, final MeterId meterId) {
@@ -114,12 +127,14 @@ public final class MeterUtil {
     }
 
     public static <O> Function<List<RpcResult<O>>, RpcResult<List<BatchFailedMetersOutput>>> createCumulativeFunction(
-            final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter> inputBatchMeters) {
+            final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter>
+                    inputBatchMeters) {
         return createCumulativeFunction(inputBatchMeters, Iterables.size(inputBatchMeters));
     }
 
     public static <O> Function<List<RpcResult<O>>, RpcResult<List<BatchFailedMetersOutput>>> createCumulativeFunction(
-            final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter> inputBatchMeters,
+            final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter>
+                    inputBatchMeters,
             final int sizeOfInputBatch) {
         return new CumulativeFunction<O>(inputBatchMeters, sizeOfInputBatch).invoke();
     }
@@ -135,7 +150,7 @@ public final class MeterUtil {
      */
     @VisibleForTesting
     static <T extends BatchMeterOutputListGrouping>
-    Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>> createComposingFunction() {
+        Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>> createComposingFunction() {
         return new Function<Pair<RpcResult<T>, RpcResult<Void>>, RpcResult<T>>() {
             @Nullable
             @Override
@@ -162,13 +177,13 @@ public final class MeterUtil {
      * Wrap given list of problematic group-ids into {@link RpcResult} of given type.
      *
      * @param batchMetersCumulativeResult list of ids failed groups
-     * @param batchOutput
-     * @param <T>                         group operation type
+     * @param batchOutput group operation type
      * @return batch group operation output of given type containing list of group-ids and corresponding success flag
      */
     private static <T extends BatchMeterOutputListGrouping>
-    RpcResultBuilder<T> createCumulativeRpcResult(final @Nullable RpcResult<List<BatchFailedMetersOutput>> batchMetersCumulativeResult,
-                                                  final T batchOutput) {
+        RpcResultBuilder<T> createCumulativeRpcResult(
+            final @Nullable RpcResult<List<BatchFailedMetersOutput>> batchMetersCumulativeResult,
+            final T batchOutput) {
         final RpcResultBuilder<T> resultBld;
         if (batchMetersCumulativeResult.isSuccessful()) {
             resultBld = RpcResultBuilder.success(batchOutput);
@@ -181,10 +196,13 @@ public final class MeterUtil {
     }
 
     private static class CumulativeFunction<O> {
-        private final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter> inputBatchMeters;
+        private final Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter>
+                inputBatchMeters;
         private final int sizeOfInputBatch;
 
-        public CumulativeFunction(Iterable<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter> inputBatchMeters, int sizeOfInputBatch) {
+        CumulativeFunction(
+                Iterable<? extends org.opendaylight.yang.gen.v1.urn
+                        .opendaylight.meter.types.rev130918.Meter> inputBatchMeters, int sizeOfInputBatch) {
             this.inputBatchMeters = inputBatchMeters;
             this.sizeOfInputBatch = sizeOfInputBatch;
         }
index 477d73ab7ac7fc6fdcdd82afe0f30d30789e2fa9..40ffe4754422ff8bda1e7baf764494ef1f2e6ecb 100644 (file)
@@ -31,7 +31,7 @@ import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
  */
 public class NodeConnectorRefToPortTranslator {
     /**
-     * Converts {@link PacketIn} to {@link NodeConnectorRef}
+     * Converts {@link PacketIn} to {@link NodeConnectorRef}.
      * @param packetIn Packet input
      * @param dataPathId Data path id
      * @return packet input converted to node connector reference
index b3dbec8f4907b95f280e8dbc6daf59002fe92e93..3fbbcaa1419a34b79337a5f62dc468fd438621ab 100644 (file)
@@ -14,7 +14,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
- * Purpose: utility class providing path and {@link InstanceIdentifier} tools
+ * Purpose: utility class providing path and {@link InstanceIdentifier} tools.
  */
 public class PathUtil {
     private PathUtil() {
@@ -22,7 +22,7 @@ public class PathUtil {
     }
 
     /**
-     * Extracts node id from instance identifier
+     * Extracts node id from instance identifier.
      * @param input instance identifier
      * @return node-id from given instance identifier
      */
@@ -31,7 +31,7 @@ public class PathUtil {
     }
 
     /**
-     * Extracts node id from node reference
+     * Extracts node id from node reference.
      * @param input reference to {@link Node}
      * @return node-id from given reference
      */
index 8ec2c59c909a46c604996ee512c1b685b54459fe..0c0889b7559c22b0c73ac129a627aafea9ea47d5 100644 (file)
@@ -24,9 +24,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregateCase;
 
-/**
- * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 3.4.2015.
- */
 public final class TranslatorLibraryUtil {
 
 
@@ -34,21 +31,31 @@ public final class TranslatorLibraryUtil {
         throw new IllegalStateException("This class should not be instantiated");
     }
 
-    private static final TranslatorKeyFactory of13TranslatorKeyFactory = new TranslatorKeyFactory(OFConstants.OFP_VERSION_1_3);
-    private static final TranslatorKeyFactory of10TranslatorKeyFactory = new TranslatorKeyFactory(OFConstants.OFP_VERSION_1_0);
-
-    public static void injectBasicTranslatorLibrary(final TranslatorLibrarian librarian, final ConvertorExecutor convertorExecutor) {
-        final TranslatorLibrary basicTranslatorLibrary = new TranslatorLibraryBuilder().
-                addTranslator(of13TranslatorKeyFactory.createTranslatorKey(PacketIn.class), new PacketReceivedTranslator(convertorExecutor)).
-                addTranslator(of13TranslatorKeyFactory.createTranslatorKey(PortGrouping.class), new PortUpdateTranslator()).
-                addTranslator(of13TranslatorKeyFactory.createTranslatorKey(MultipartReplyAggregateCase.class), new AggregatedFlowStatisticsTranslator()).
-                addTranslator(of13TranslatorKeyFactory.createTranslatorKey(FlowRemoved.class), new FlowRemovedTranslator(convertorExecutor)).
-                addTranslator(of10TranslatorKeyFactory.createTranslatorKey(PacketIn.class), new PacketReceivedTranslator(convertorExecutor)).
-                addTranslator(of10TranslatorKeyFactory.createTranslatorKey(PortGrouping.class), new PortUpdateTranslator()).
-                addTranslator(of10TranslatorKeyFactory.createTranslatorKey(MultipartReplyAggregateCase.class), new AggregatedFlowStatisticsTranslator()).
-                addTranslator(of10TranslatorKeyFactory.createTranslatorKey(FlowRemoved.class), new FlowRemovedV10Translator(convertorExecutor)).
-
-                build();
+    private static final TranslatorKeyFactory OF_13_TRANSLATOR_KEY_FACTORY =
+            new TranslatorKeyFactory(OFConstants.OFP_VERSION_1_3);
+    private static final TranslatorKeyFactory OF_10_TRANSLATOR_KEY_FACTORY =
+            new TranslatorKeyFactory(OFConstants.OFP_VERSION_1_0);
+
+    public static void injectBasicTranslatorLibrary(final TranslatorLibrarian librarian,
+                                                    final ConvertorExecutor convertorExecutor) {
+        final TranslatorLibrary basicTranslatorLibrary = new TranslatorLibraryBuilder()
+                .addTranslator(OF_13_TRANSLATOR_KEY_FACTORY.createTranslatorKey(PacketIn.class),
+                        new PacketReceivedTranslator(convertorExecutor))
+                .addTranslator(OF_13_TRANSLATOR_KEY_FACTORY.createTranslatorKey(PortGrouping.class),
+                        new PortUpdateTranslator())
+                .addTranslator(OF_13_TRANSLATOR_KEY_FACTORY.createTranslatorKey(MultipartReplyAggregateCase.class),
+                        new AggregatedFlowStatisticsTranslator())
+                .addTranslator(OF_13_TRANSLATOR_KEY_FACTORY.createTranslatorKey(FlowRemoved.class),
+                        new FlowRemovedTranslator(convertorExecutor))
+                .addTranslator(OF_10_TRANSLATOR_KEY_FACTORY.createTranslatorKey(PacketIn.class),
+                        new PacketReceivedTranslator(convertorExecutor))
+                .addTranslator(OF_10_TRANSLATOR_KEY_FACTORY.createTranslatorKey(PortGrouping.class),
+                        new PortUpdateTranslator())
+                .addTranslator(OF_10_TRANSLATOR_KEY_FACTORY.createTranslatorKey(MultipartReplyAggregateCase.class),
+                        new AggregatedFlowStatisticsTranslator())
+                .addTranslator(OF_10_TRANSLATOR_KEY_FACTORY.createTranslatorKey(FlowRemoved.class),
+                        new FlowRemovedV10Translator(convertorExecutor))
+                .build();
 
         librarian.setTranslatorLibrary(basicTranslatorLibrary);
     }
index 667b4a700efbb5e97530c1836c3d7f4115fd7e3b..d6b2dd29457a6fdffbab3eaa4f11f046f049eac7 100644 (file)
@@ -20,7 +20,6 @@ import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipChange;
 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListenerRegistration;
 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
@@ -41,7 +40,6 @@ import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager
 import org.opendaylight.openflowplugin.impl.mastership.MastershipChangeServiceManagerImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.rf.state.rev170713.ResultState;
-import org.opendaylight.yangtools.yang.common.RpcError;
 
 @RunWith(MockitoJUnitRunner.class)
 public class ContextChainHolderImplTest {
@@ -140,7 +138,8 @@ public class ContextChainHolderImplTest {
 
     @Test
     public void reconciliationFrameworkFailure() throws Exception {
-        Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo)).thenReturn(Futures.immediateFailedFuture(new Throwable("test")));
+        Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
+                .thenReturn(Futures.immediateFailedFuture(new Throwable("test")));
         contextChainHolder.createContextChain(connectionContext);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_FLOW_REGISTRY_FILL);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_GATHERING);
@@ -151,7 +150,8 @@ public class ContextChainHolderImplTest {
 
     @Test
     public void reconciliationFrameworkDisconnect() throws Exception {
-        Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo)).thenReturn(Futures.immediateFuture(ResultState.DISCONNECT));
+        Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
+                .thenReturn(Futures.immediateFuture(ResultState.DISCONNECT));
         contextChainHolder.createContextChain(connectionContext);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_FLOW_REGISTRY_FILL);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_GATHERING);
@@ -163,7 +163,8 @@ public class ContextChainHolderImplTest {
     @Test
     public void reconciliationFrameworkSuccess() throws Exception {
         contextChainHolder.createContextChain(connectionContext);
-        Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo)).thenReturn(Futures.immediateFuture(ResultState.DONOTHING));
+        Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
+                .thenReturn(Futures.immediateFuture(ResultState.DONOTHING));
         Mockito.when(statisticsContext.initialSubmitAfterReconciliation()).thenReturn(true);
         contextChainHolder.createContextChain(connectionContext);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_FLOW_REGISTRY_FILL);
@@ -176,7 +177,8 @@ public class ContextChainHolderImplTest {
     @Test
     public void reconciliationFrameworkSuccessButNotSubmit() throws Exception {
         contextChainHolder.createContextChain(connectionContext);
-        Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo)).thenReturn(Futures.immediateFuture(ResultState.DONOTHING));
+        Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
+                .thenReturn(Futures.immediateFuture(ResultState.DONOTHING));
         Mockito.when(statisticsContext.initialSubmitAfterReconciliation()).thenReturn(false);
         contextChainHolder.createContextChain(connectionContext);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_FLOW_REGISTRY_FILL);
index c61a6029374f9c368bd1dd56419c5a0c340f8240..d04c3815005e8e34eb0530cc8c3df883f89d4cdb 100644 (file)
@@ -121,6 +121,7 @@ public class ContextChainImplTest {
     public void instantiateServiceInstanceFail() throws Exception {
         Mockito.doThrow(new IllegalStateException()).when(deviceContext).instantiateServiceInstance();
         contextChain.instantiateServiceInstance();
-        Mockito.verify(contextChainMastershipWatcher).onNotAbleToStartMastershipMandatory(Mockito.any(DeviceInfo.class), Mockito.anyString());
+        Mockito.verify(contextChainMastershipWatcher)
+                .onNotAbleToStartMastershipMandatory(Mockito.any(DeviceInfo.class), Mockito.anyString());
     }
 }
index 6b3a996a3cbc44ec00d0eac21fa8470292a87d55..496935722238411b289c730fef069ddc54ade14b 100644 (file)
@@ -41,7 +41,7 @@ public class MastershipChangeServiceManagerImplTest {
     @Mock
     private ReconciliationFrameworkEvent secondEvent;
 
-    final private MastershipChangeServiceManager manager = new MastershipChangeServiceManagerImpl();
+    private final MastershipChangeServiceManager manager = new MastershipChangeServiceManagerImpl();
     private MastershipChangeRegistration registration;
     private ReconciliationFrameworkRegistration registrationRF;
 
index 610d4ca16eb6d26ea410443784011439834efa48..b024f178b8f2f3cc7288ac110a06787f0fd0d901 100644 (file)
@@ -54,7 +54,8 @@ public class DeviceStateUtilTest {
 
     @Test
     public void setDeviceStateBasedOnV10CapabilitiesTest() {
-        CapabilitiesV10 dummyCapabilitiesV10 = new CapabilitiesV10(false, false, false, false, false, false, false, false);
+        CapabilitiesV10 dummyCapabilitiesV10 =
+                new CapabilitiesV10(false, false, false, false, false, false, false, false);
 
         DeviceStateUtil.setDeviceStateBasedOnV10Capabilities(mockedDeviceState, dummyCapabilitiesV10);
         verify(mockedDeviceState).setFlowStatisticsAvailable(false);
index cdf78c4448272938069664b2633f553bd3a98167..47c6b3bd26e80580e59e8a147e9f53f1260e9fb5 100644 (file)
@@ -122,7 +122,9 @@ public class FlatBatchUtilTest {
         FlatBatchUtil.markBarriersWhereNeeded(batchPlan);
         LOG.debug("checking barrier between {} / {}", typeOfFirst, typeOfSecond);
         Assert.assertEquals(2, batchPlan.size());
-        Assert.assertTrue("barrier expected between " + typeOfFirst + " / " + typeOfSecond, batchPlan.get(0).isBarrierAfter());
+        Assert.assertTrue("barrier expected between "
+                + typeOfFirst + " / "
+                + typeOfSecond, batchPlan.get(0).isBarrierAfter());
         Assert.assertFalse(batchPlan.get(1).isBarrierAfter());
     }
 
@@ -145,14 +147,18 @@ public class FlatBatchUtilTest {
         Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.GROUP_ADD), BatchStepType.FLOW_ADD));
         Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.GROUP_ADD), BatchStepType.FLOW_UPDATE));
 
-        Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.FLOW_REMOVE), BatchStepType.GROUP_REMOVE));
-        Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.FLOW_UPDATE), BatchStepType.GROUP_REMOVE));
+        Assert.assertTrue(FlatBatchUtil
+                .decideBarrier(EnumSet.of(BatchStepType.FLOW_REMOVE), BatchStepType.GROUP_REMOVE));
+        Assert.assertTrue(FlatBatchUtil
+                .decideBarrier(EnumSet.of(BatchStepType.FLOW_UPDATE), BatchStepType.GROUP_REMOVE));
 
         Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.METER_ADD), BatchStepType.FLOW_ADD));
         Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.METER_ADD), BatchStepType.FLOW_UPDATE));
 
-        Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.FLOW_REMOVE), BatchStepType.METER_REMOVE));
-        Assert.assertTrue(FlatBatchUtil.decideBarrier(EnumSet.of(BatchStepType.FLOW_UPDATE), BatchStepType.METER_REMOVE));
+        Assert.assertTrue(FlatBatchUtil
+                .decideBarrier(EnumSet.of(BatchStepType.FLOW_REMOVE), BatchStepType.METER_REMOVE));
+        Assert.assertTrue(FlatBatchUtil
+                .decideBarrier(EnumSet.of(BatchStepType.FLOW_UPDATE), BatchStepType.METER_REMOVE));
     }
 
     @Test
@@ -168,12 +174,12 @@ public class FlatBatchUtilTest {
         final List<BatchPlanStep> batchPlanSteps = FlatBatchUtil.assembleBatchPlan(batches);
         Assert.assertEquals(5, batchPlanSteps.size());
 
-        int i = 0;
-        checkSegment(batchPlanSteps.get(i++), BatchStepType.GROUP_ADD, 1);
-        checkSegment(batchPlanSteps.get(i++), BatchStepType.GROUP_REMOVE, 2);
-        checkSegment(batchPlanSteps.get(i++), BatchStepType.GROUP_REMOVE, 1);
-        checkSegment(batchPlanSteps.get(i++), BatchStepType.GROUP_ADD, 1);
-        checkSegment(batchPlanSteps.get(i++), BatchStepType.GROUP_UPDATE, 3);
+        int index = 0;
+        checkSegment(batchPlanSteps.get(index++), BatchStepType.GROUP_ADD, 1);
+        checkSegment(batchPlanSteps.get(index++), BatchStepType.GROUP_REMOVE, 2);
+        checkSegment(batchPlanSteps.get(index++), BatchStepType.GROUP_REMOVE, 1);
+        checkSegment(batchPlanSteps.get(index++), BatchStepType.GROUP_ADD, 1);
+        checkSegment(batchPlanSteps.get(index++), BatchStepType.GROUP_UPDATE, 3);
     }
 
     private void checkSegment(final BatchPlanStep planStep, final BatchStepType stepType, final int expected) {
@@ -270,7 +276,8 @@ public class FlatBatchUtilTest {
                         .build())
                 .build();
 
-        final ProcessFlatBatchOutput output = new ProcessFlatBatchOutputBuilder().setBatchFailure(Lists.newArrayList(batchFailure)).build();
+        final ProcessFlatBatchOutput output
+                = new ProcessFlatBatchOutputBuilder().setBatchFailure(Lists.newArrayList(batchFailure)).build();
 
         final RpcResult<ProcessFlatBatchOutput> rpcResultFailed = RpcResultBuilder.<ProcessFlatBatchOutput>failed()
                 .withError(RpcError.ErrorType.APPLICATION, "ut-rpcError")
@@ -278,15 +285,18 @@ public class FlatBatchUtilTest {
         final RpcResult<ProcessFlatBatchOutput> rpcResultSuccess = RpcResultBuilder.<ProcessFlatBatchOutput>success()
                 .withResult(new ProcessFlatBatchOutputBuilder().setBatchFailure(new ArrayList<>())).build();
 
-        final RpcResult<ProcessFlatBatchOutput> rpcResult1 = FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultFailed, rpcResultSuccess));
+        final RpcResult<ProcessFlatBatchOutput> rpcResult1
+                = FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultFailed, rpcResultSuccess));
         Assert.assertEquals(1, rpcResult1.getErrors().size());
         Assert.assertFalse(rpcResult1.isSuccessful());
 
-        final RpcResult<ProcessFlatBatchOutput> rpcResult2 = FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultFailed, rpcResultFailed));
+        final RpcResult<ProcessFlatBatchOutput> rpcResult2
+                = FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultFailed, rpcResultFailed));
         Assert.assertEquals(2, rpcResult2.getErrors().size());
         Assert.assertFalse(rpcResult2.isSuccessful());
 
-        final RpcResult<ProcessFlatBatchOutput> rpcResult3 = FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultSuccess, rpcResultSuccess));
+        final RpcResult<ProcessFlatBatchOutput> rpcResult3
+                = FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultSuccess, rpcResultSuccess));
         Assert.assertEquals(0, rpcResult3.getErrors().size());
         Assert.assertTrue(rpcResult3.isSuccessful());
     }
index b5fe5d8d23ad05ca4ca4c5d5c4d2e5ba92114d19..1275ef8a52232d4472f5b9debf2cb3cbe529c720 100644 (file)
@@ -80,42 +80,43 @@ public class FlowUtilTest {
     }
 
     @Test
-    public void testFLOW_ADD_TRANSFORM__failure() throws Exception {
+    public void testFlowAddTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedFlowsOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(FlowUtil.FLOW_ADD_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_ADD_TRANSFORM__success() throws Exception {
+    public void testFlowAddTransformSuccess() throws Exception {
         final RpcResult<List<BatchFailedFlowsOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(FlowUtil.FLOW_ADD_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_REMOVE_TRANSFORM__failure() throws Exception {
+    public void testFlowRemoveTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedFlowsOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(FlowUtil.FLOW_REMOVE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_REMOVE_TRANSFORM__success() throws Exception {
+    public void testFlowRemoveTransformSuccess() throws Exception {
         final RpcResult<List<BatchFailedFlowsOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(FlowUtil.FLOW_REMOVE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_UPDATE_TRANSFORM__failure() throws Exception {
+    public void testFlowUpdateTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedFlowsOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(FlowUtil.FLOW_UPDATE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_UPDATE_TRANSFORM__success() throws Exception {
+    public void testFlowUpdateTransformSuccess() throws Exception {
         final RpcResult<List<BatchFailedFlowsOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(FlowUtil.FLOW_UPDATE_TRANSFORM.apply(input));
     }
 
-    private <T extends BatchFlowOutputListGrouping> void checkBatchSuccessOutcomeTransformation(final RpcResult<T> output) {
+    private <T extends BatchFlowOutputListGrouping> void checkBatchSuccessOutcomeTransformation(
+            final RpcResult<T> output) {
         Assert.assertTrue(output.isSuccessful());
         Assert.assertEquals(0, output.getResult().getBatchFailedFlowsOutput().size());
         Assert.assertEquals(0, output.getErrors().size());
@@ -136,7 +137,8 @@ public class FlowUtilTest {
                 .build();
     }
 
-    private <T extends BatchFlowOutputListGrouping> void checkBatchErrorOutcomeTransformation(final RpcResult<T> output) {
+    private <T extends BatchFlowOutputListGrouping> void checkBatchErrorOutcomeTransformation(
+            final RpcResult<T> output) {
         Assert.assertFalse(output.isSuccessful());
         Assert.assertEquals(1, output.getResult().getBatchFailedFlowsOutput().size());
         Assert.assertEquals(DUMMY_FLOW_ID, output.getResult().getBatchFailedFlowsOutput().get(0).getFlowId());
@@ -146,8 +148,8 @@ public class FlowUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_success() throws Exception {
-        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>> compositeFunction =
-                FlowUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
+                compositeFunction = FlowUtil.createComposingFunction();
 
         final RpcResult<AddFlowsBatchOutput> addFlowBatchOutput = createAddFlowsBatchSuccessOutput();
         final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
@@ -161,8 +163,8 @@ public class FlowUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_success() throws Exception {
-        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>> compositeFunction =
-                FlowUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
+                compositeFunction = FlowUtil.createComposingFunction();
 
         final RpcResult<AddFlowsBatchOutput> addFlowBatchOutput = createAddFlowsBatchFailureOutcome();
         final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
@@ -176,8 +178,8 @@ public class FlowUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_failure() throws Exception {
-        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>> compositeFunction =
-                FlowUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
+                compositeFunction = FlowUtil.createComposingFunction();
 
         final RpcResult<AddFlowsBatchOutput> addFlowBatchOutput = createAddFlowsBatchSuccessOutput();
         final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
@@ -191,8 +193,8 @@ public class FlowUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_failure() throws Exception {
-        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>> compositeFunction =
-                FlowUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddFlowsBatchOutput>, RpcResult<Void>>, RpcResult<AddFlowsBatchOutput>>
+                compositeFunction = FlowUtil.createComposingFunction();
 
         final RpcResult<AddFlowsBatchOutput> addFlowBatchOutput = createAddFlowsBatchFailureOutcome();
         final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
index e433a499208c931d594b794c87eb538f1422e5a7..c49c85af7278635e24176bd0ecaf33f61f492ddc 100644 (file)
@@ -41,10 +41,11 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
  */
 public class GroupUtilTest {
 
-    public static final NodeId DUMMY_NODE_ID = new NodeId("dummyNodeId");
+    private static final NodeId DUMMY_NODE_ID = new NodeId("dummyNodeId");
     private static final GroupId DUMMY_GROUP_ID = new GroupId(42L);
     private static final GroupId DUMMY_GROUP_ID_2 = new GroupId(43L);
-    private static final Long GROUP_ACTION_BITMAP = 0b00000000000000000000000000000000000001111111111111001100000000001L;
+    private static final Long GROUP_ACTION_BITMAP =
+            0b00000000000000000000000000000000000001111111111111001100000000001L;
 
     @Test
     public void testBuildGroupPath() throws Exception {
@@ -82,42 +83,43 @@ public class GroupUtilTest {
     }
 
     @Test
-    public void testGROUP_ADD_TRANSFORM__failure() throws Exception {
+    public void testGroupAddTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedGroupsOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(GroupUtil.GROUP_ADD_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testGROUP_ADD_TRANSFORM__success() throws Exception {
+    public void testGroupAddTransformFailureSuccess() throws Exception {
         final RpcResult<List<BatchFailedGroupsOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(GroupUtil.GROUP_ADD_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testGROUP_REMOVE_TRANSFORM__failure() throws Exception {
+    public void testGroupRemoveTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedGroupsOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(GroupUtil.GROUP_REMOVE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_REMOVE_TRANSFORM__success() throws Exception {
+    public void testFlowRemoveTransformSuccess() throws Exception {
         final RpcResult<List<BatchFailedGroupsOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(GroupUtil.GROUP_REMOVE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_UPDATE_TRANSFORM__failure() throws Exception {
+    public void testFlowUpdateTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedGroupsOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(GroupUtil.GROUP_UPDATE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_UPDATE_TRANSFORM__success() throws Exception {
+    public void testFlowUpdateTransformSuccess() throws Exception {
         final RpcResult<List<BatchFailedGroupsOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(GroupUtil.GROUP_UPDATE_TRANSFORM.apply(input));
     }
 
-    private <T extends BatchGroupOutputListGrouping> void checkBatchSuccessOutcomeTransformation(final RpcResult<T> output) {
+    private <T extends BatchGroupOutputListGrouping> void checkBatchSuccessOutcomeTransformation(
+            final RpcResult<T> output) {
         Assert.assertTrue(output.isSuccessful());
         Assert.assertEquals(0, output.getResult().getBatchFailedGroupsOutput().size());
         Assert.assertEquals(0, output.getErrors().size());
@@ -138,7 +140,8 @@ public class GroupUtilTest {
                 .build();
     }
 
-    private <T extends BatchGroupOutputListGrouping> void checkBatchErrorOutcomeTransformation(final RpcResult<T> output) {
+    private <T extends BatchGroupOutputListGrouping> void checkBatchErrorOutcomeTransformation(
+            final RpcResult<T> output) {
         Assert.assertFalse(output.isSuccessful());
         Assert.assertEquals(1, output.getResult().getBatchFailedGroupsOutput().size());
         Assert.assertEquals(DUMMY_GROUP_ID, output.getResult().getBatchFailedGroupsOutput().get(0).getGroupId());
@@ -148,12 +151,13 @@ public class GroupUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_success() throws Exception {
-        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>> compositeFunction =
-                GroupUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
+                compositeFunction = GroupUtil.createComposingFunction();
 
         final RpcResult<AddGroupsBatchOutput> addGroupBatchOutput = createAddGroupsBatchSuccessOutput();
         final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input = Pair.of(addGroupBatchOutput, barrierOutput);
+        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input =
+                Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddGroupsBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertTrue(composite.isSuccessful());
@@ -163,12 +167,13 @@ public class GroupUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_success() throws Exception {
-        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>> compositeFunction =
-                GroupUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
+                compositeFunction = GroupUtil.createComposingFunction();
 
         final RpcResult<AddGroupsBatchOutput> addGroupBatchOutput = createAddGroupsBatchFailureOutcome();
         final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input = Pair.of(addGroupBatchOutput, barrierOutput);
+        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input =
+                Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddGroupsBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
@@ -178,12 +183,13 @@ public class GroupUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_failure() throws Exception {
-        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>> compositeFunction =
-                GroupUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
+                compositeFunction = GroupUtil.createComposingFunction();
 
         final RpcResult<AddGroupsBatchOutput> addGroupBatchOutput = createAddGroupsBatchSuccessOutput();
         final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input = Pair.of(addGroupBatchOutput, barrierOutput);
+        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input =
+                Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddGroupsBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
@@ -193,12 +199,13 @@ public class GroupUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_failure() throws Exception {
-        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>> compositeFunction =
-                GroupUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>>, RpcResult<AddGroupsBatchOutput>>
+                compositeFunction = GroupUtil.createComposingFunction();
 
         final RpcResult<AddGroupsBatchOutput> addGroupBatchOutput = createAddGroupsBatchFailureOutcome();
         final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input = Pair.of(addGroupBatchOutput, barrierOutput);
+        final Pair<RpcResult<AddGroupsBatchOutput>, RpcResult<Void>> input =
+                Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddGroupsBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
@@ -208,8 +215,10 @@ public class GroupUtilTest {
 
     @Test
     public void testExtractGroupActionsSupportBitmap() {
-        ActionType actionSupported = new ActionType(true,true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-        final List<Long> groupActionsSupportBitmap = GroupUtil.extractGroupActionsSupportBitmap(Lists.newArrayList(actionSupported));
+        ActionType actionSupported = new ActionType(true,true, true, true, true, true, true, true, true, true, true,
+                true, true, true, true, true, true);
+        final List<Long> groupActionsSupportBitmap =
+                GroupUtil.extractGroupActionsSupportBitmap(Lists.newArrayList(actionSupported));
         assertEquals(1, groupActionsSupportBitmap.size());
         final Long bitmap = groupActionsSupportBitmap.get(0);
         assertEquals(GROUP_ACTION_BITMAP, bitmap);
index 4057c19cd6c3d5e56473a29c0ace1d7034b6dad1..fd346c478672912bd8c9a483e8686f56bfdfbdf4 100644 (file)
@@ -97,8 +97,10 @@ public class MatchNormalizationUtilTest {
                         .setTunnelIpv4Destination(new Ipv4Prefix(destination))
                         .build()));
 
-        assertEquals("192.168.1.0/24", TunnelIpv4Match.class.cast(matchBuilder.getLayer3Match()).getTunnelIpv4Source().getValue());
-        assertEquals("192.168.2.0/24", TunnelIpv4Match.class.cast(matchBuilder.getLayer3Match()).getTunnelIpv4Destination().getValue());
+        assertEquals("192.168.1.0/24",
+                TunnelIpv4Match.class.cast(matchBuilder.getLayer3Match()).getTunnelIpv4Source().getValue());
+        assertEquals("192.168.2.0/24",
+                TunnelIpv4Match.class.cast(matchBuilder.getLayer3Match()).getTunnelIpv4Destination().getValue());
     }
 
     @Test
@@ -113,7 +115,8 @@ public class MatchNormalizationUtilTest {
                         .build()));
 
         assertEquals("192.168.1.0/24", Ipv4Match.class.cast(matchBuilder.getLayer3Match()).getIpv4Source().getValue());
-        assertEquals("192.168.2.0/24", Ipv4Match.class.cast(matchBuilder.getLayer3Match()).getIpv4Destination().getValue());
+        assertEquals("192.168.2.0/24",
+                Ipv4Match.class.cast(matchBuilder.getLayer3Match()).getIpv4Destination().getValue());
     }
 
     @Test
index 55918ad62445cd1fc361ed483a214f427e37cfd6..18495eab440ff31f3980607430b19a6ac41968e4 100644 (file)
@@ -32,7 +32,7 @@ public class MatchUtilTest {
         Short zeroShort = Short.valueOf("0");
         Integer zeroInteger = Integer.valueOf(0);
         MatchV10Builder matchV10Builder = new MatchV10Builder();
-        matchV10Builder.setDlDst( ZERO_MAC_ADDRESS);
+        matchV10Builder.setDlDst(ZERO_MAC_ADDRESS);
         matchV10Builder.setDlSrc(ZERO_MAC_ADDRESS);
         matchV10Builder.setDlType(zeroInteger);
         matchV10Builder.setDlVlan(zeroInteger);
@@ -46,7 +46,8 @@ public class MatchUtilTest {
         matchV10Builder.setNwTos(zeroShort);
         matchV10Builder.setTpDst(zeroInteger);
         matchV10Builder.setTpSrc(zeroInteger);
-        FlowWildcardsV10 flowWildcardsV10 = new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true);
+        FlowWildcardsV10 flowWildcardsV10 =
+                new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true);
         matchV10Builder.setWildcards(flowWildcardsV10);
         return matchV10Builder;
     }
index 8fd13159e13c46a89787176591a8e98e73ac8338..199ed588565dd993e9a737c5ae81d3041d2984d4 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.openflowplugin.impl.util;
 
-
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -40,7 +39,7 @@ public class MdSalRegistrationUtilsTest {
 
     /**
      * Number of currently registrated services (can be changed)
-     * (RpcContext, DeviceContext)}
+     * (RpcContext, DeviceContext)}.
      */
     private static final int NUMBER_OF_RPC_SERVICE_REGISTRATION = 15;
     private static final int NUMBER_OF_STAT_COMPAT_RPC_SERVICE_REGISTRATION = 5;
@@ -79,7 +78,10 @@ public class MdSalRegistrationUtilsTest {
 
     @Test
     public void registerServiceTest() {
-        MdSalRegistrationUtils.registerServices(mockedRpcContext, mockedDeviceContext, extensionConverterProvider, convertorManager);
+        MdSalRegistrationUtils.registerServices(mockedRpcContext,
+                                                mockedDeviceContext,
+                                                extensionConverterProvider,
+                                                convertorManager);
         verify(mockedRpcContext, times(NUMBER_OF_RPC_SERVICE_REGISTRATION)).registerRpcServiceImplementation(
                 Matchers.any(), any(RpcService.class));
     }
@@ -91,9 +93,12 @@ public class MdSalRegistrationUtilsTest {
 
         when(mockedRpcContext.lookupRpcService(OpendaylightFlowStatisticsService.class)).thenReturn(
                 flowStatService);
-        MdSalRegistrationUtils.registerStatCompatibilityServices(mockedRpcContext, mockedDeviceContext, notificationPublishService, convertorManager);
-        verify(mockedRpcContext, times(NUMBER_OF_STAT_COMPAT_RPC_SERVICE_REGISTRATION)).registerRpcServiceImplementation(
-                Matchers.any(), any(RpcService.class));
+        MdSalRegistrationUtils.registerStatCompatibilityServices(mockedRpcContext,
+                                                                 mockedDeviceContext,
+                                                                 notificationPublishService,
+                                                                 convertorManager);
+        verify(mockedRpcContext, times(NUMBER_OF_STAT_COMPAT_RPC_SERVICE_REGISTRATION))
+                .registerRpcServiceImplementation(Matchers.any(), any(RpcService.class));
     }
 
 }
\ No newline at end of file
index 869f0bb456b1811ca5c80ce791f481c321c15f2c..a83eaab74b42b15f17bc94b0fc94c29d4d205ea3 100644 (file)
@@ -73,49 +73,51 @@ public class MeterUtilTest {
         Assert.assertEquals(1, output.getResult().get(0).getBatchOrder().intValue());
     }
 
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter createBatchMeter(final MeterId meterId) {
+    private org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter createBatchMeter(
+            final MeterId meterId) {
         return new MeterBuilder()
                 .setMeterId(meterId)
                 .build();
     }
 
     @Test
-    public void testMETER_ADD_TRANSFORM__failure() throws Exception {
+    public void testMeterAddTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedMetersOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(MeterUtil.METER_ADD_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testMETER_ADD_TRANSFORM__success() throws Exception {
+    public void testMeterAddTransformSuccess() throws Exception {
         final RpcResult<List<BatchFailedMetersOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(MeterUtil.METER_ADD_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testMETER_REMOVE_TRANSFORM__failure() throws Exception {
+    public void testMeterRemoveTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedMetersOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(MeterUtil.METER_REMOVE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_REMOVE_TRANSFORM__success() throws Exception {
+    public void testFlowRemoveTransformSuccess() throws Exception {
         final RpcResult<List<BatchFailedMetersOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(MeterUtil.METER_REMOVE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_UPDATE_TRANSFORM__failure() throws Exception {
+    public void testFlowUpdateTransformFailure() throws Exception {
         final RpcResult<List<BatchFailedMetersOutput>> input = createBatchOutcomeWithError();
         checkBatchErrorOutcomeTransformation(MeterUtil.METER_UPDATE_TRANSFORM.apply(input));
     }
 
     @Test
-    public void testFLOW_UPDATE_TRANSFORM__success() throws Exception {
+    public void testFlowUpdateTransformSuccess() throws Exception {
         final RpcResult<List<BatchFailedMetersOutput>> input = createEmptyBatchOutcome();
         checkBatchSuccessOutcomeTransformation(MeterUtil.METER_UPDATE_TRANSFORM.apply(input));
     }
 
-    private <T extends BatchMeterOutputListGrouping> void checkBatchSuccessOutcomeTransformation(final RpcResult<T> output) {
+    private <T extends BatchMeterOutputListGrouping> void checkBatchSuccessOutcomeTransformation(
+            final RpcResult<T> output) {
         Assert.assertTrue(output.isSuccessful());
         Assert.assertEquals(0, output.getResult().getBatchFailedMetersOutput().size());
         Assert.assertEquals(0, output.getErrors().size());
@@ -136,7 +138,8 @@ public class MeterUtilTest {
                 .build();
     }
 
-    private <T extends BatchMeterOutputListGrouping> void checkBatchErrorOutcomeTransformation(final RpcResult<T> output) {
+    private <T extends BatchMeterOutputListGrouping> void checkBatchErrorOutcomeTransformation(
+            final RpcResult<T> output) {
         Assert.assertFalse(output.isSuccessful());
         Assert.assertEquals(1, output.getResult().getBatchFailedMetersOutput().size());
         Assert.assertEquals(DUMMY_METER_ID, output.getResult().getBatchFailedMetersOutput().get(0).getMeterId());
@@ -146,12 +149,13 @@ public class MeterUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_success() throws Exception {
-        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>> compositeFunction =
-                MeterUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
+                compositeFunction = MeterUtil.createComposingFunction();
 
         final RpcResult<AddMetersBatchOutput> addGroupBatchOutput = createAddMetersBatchSuccessOutput();
         final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input = Pair.of(addGroupBatchOutput, barrierOutput);
+        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input =
+                Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddMetersBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertTrue(composite.isSuccessful());
@@ -161,12 +165,13 @@ public class MeterUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_success() throws Exception {
-        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>> compositeFunction =
-                MeterUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
+                compositeFunction = MeterUtil.createComposingFunction();
 
         final RpcResult<AddMetersBatchOutput> addGroupBatchOutput = createAddMetersBatchFailureOutcome();
         final RpcResult<Void> barrierOutput = RpcResultBuilder.<Void>success().build();
-        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input = Pair.of(addGroupBatchOutput, barrierOutput);
+        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input =
+                Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddMetersBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
@@ -176,12 +181,13 @@ public class MeterUtilTest {
 
     @Test
     public void testCreateComposingFunction_success_failure() throws Exception {
-        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>> compositeFunction =
-                MeterUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
+                compositeFunction = MeterUtil.createComposingFunction();
 
         final RpcResult<AddMetersBatchOutput> addGroupBatchOutput = createAddMetersBatchSuccessOutput();
         final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input = Pair.of(addGroupBatchOutput, barrierOutput);
+        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input =
+                Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddMetersBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
@@ -191,12 +197,13 @@ public class MeterUtilTest {
 
     @Test
     public void testCreateComposingFunction_failure_failure() throws Exception {
-        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>> compositeFunction =
-                MeterUtil.createComposingFunction();
+        final Function<Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>>, RpcResult<AddMetersBatchOutput>>
+                compositeFunction = MeterUtil.createComposingFunction();
 
         final RpcResult<AddMetersBatchOutput> addGroupBatchOutput = createAddMetersBatchFailureOutcome();
         final RpcResult<Void> barrierOutput = createBarrierFailureOutcome();
-        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input = Pair.of(addGroupBatchOutput, barrierOutput);
+        final Pair<RpcResult<AddMetersBatchOutput>, RpcResult<Void>> input =
+                Pair.of(addGroupBatchOutput, barrierOutput);
         final RpcResult<AddMetersBatchOutput> composite = compositeFunction.apply(input);
 
         Assert.assertFalse(composite.isSuccessful());
index f72ba9ac03668bf58344ceef260ac4a3f4cd1ff8..75b499dd5404e5d1a8dfcaea699ff96739b385ce 100644 (file)
@@ -27,19 +27,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketIn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder;
 
-/**
- * Created by Tomas Slusny on 24.3.2016.
- */
 @RunWith(MockitoJUnitRunner.class)
 public class NodeConnectorRefToPortTranslatorTest extends TestCase {
 
-    static final String PACKET_DATA = "Test_Data";
-    static final Long PORT_NO = 5l;
-    static final Long SECOND_PORT_NO = 6l;
-    static final BigInteger DATA_PATH_ID = BigInteger.TEN;
-    static final short OF_VERSION = OFConstants.OFP_VERSION_1_3;
-    static final String ID_VALUE = "openflow:" + DATA_PATH_ID;
-    static final Long TABLE_ID = 42L;
+    private static final String PACKET_DATA = "Test_Data";
+    private static final Long PORT_NO = 5L;
+    private static final BigInteger DATA_PATH_ID = BigInteger.TEN;
+    private static final short OF_VERSION = OFConstants.OFP_VERSION_1_3;
+    private static final Long TABLE_ID = 42L;
 
     private static PacketIn createPacketIn(long portNo) {
         InPortBuilder inPortBuilder = new InPortBuilder()
index beaba7505ac20940cf85e0811ff357c4e94df859..fc943e8ee0090dd4ebd1ed340e99f42a19637192 100644 (file)
@@ -24,7 +24,8 @@ public class PathUtilTest {
 
     private static final NodeId NODE_ID = new NodeId("ut-dummy-node");
     private static final NodeKey NODE_KEY = new NodeKey(NODE_ID);
-    private static final InstanceIdentifier<Node> NODE_II = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY);
+    private static final InstanceIdentifier<Node> NODE_II
+            = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY);
     private static final NodeRef NODE_REF = new NodeRef(NODE_II);
 
     @Test
index 862f01a9a43fd8b2bbdcce03e2e3d1feca16a6e5..fe90faf3a1ff50eaed428c02f625563fd62b0bcf 100644 (file)
@@ -55,30 +55,30 @@ public class TranslatorLibratyUtilTest {
         TranslatorLibrary translatorLibrary = translatorLibrarian.oook();
 
         TranslatorKeyFactory of13TranslatorKeyFactory = new TranslatorKeyFactory(OFP_VERSION_1_3);
-        TranslatorKeyFactory of10TranslatorKeyFactory = new TranslatorKeyFactory(OFP_VERSION_1_0);
 
         MessageTranslator<Object, Object> translator;
-        translator = translatorLibrary.lookupTranslator(of13TranslatorKeyFactory
-                .createTranslatorKey(PacketIn.class));
+        translator = translatorLibrary.lookupTranslator(of13TranslatorKeyFactory.createTranslatorKey(PacketIn.class));
         assertNotNull(translator);
 
-        translator = translatorLibrary.lookupTranslator(of13TranslatorKeyFactory.createTranslatorKey(PortGrouping
-                .class));
+        translator = translatorLibrary
+                .lookupTranslator(of13TranslatorKeyFactory.createTranslatorKey(PortGrouping.class));
         assertNotNull(translator);
 
-        translator = translatorLibrary.lookupTranslator(of13TranslatorKeyFactory.createTranslatorKey
-                (MultipartReplyAggregateCase
-                .class));
+        translator = translatorLibrary
+                .lookupTranslator(of13TranslatorKeyFactory.createTranslatorKey(MultipartReplyAggregateCase.class));
         assertNotNull(translator);
 
+        TranslatorKeyFactory of10TranslatorKeyFactory = new TranslatorKeyFactory(OFP_VERSION_1_0);
+
         translator = translatorLibrary.lookupTranslator(of10TranslatorKeyFactory.createTranslatorKey(PacketIn.class));
         assertNotNull(translator);
 
-        translator = translatorLibrary.lookupTranslator(of10TranslatorKeyFactory.createTranslatorKey(PortGrouping.class));
+        translator = translatorLibrary
+                .lookupTranslator(of10TranslatorKeyFactory.createTranslatorKey(PortGrouping.class));
         assertNotNull(translator);
 
-        translator = translatorLibrary.lookupTranslator(of10TranslatorKeyFactory.createTranslatorKey(MultipartReplyAggregateCase
-                .class));
+        translator = translatorLibrary
+                .lookupTranslator(of10TranslatorKeyFactory.createTranslatorKey(MultipartReplyAggregateCase.class));
         assertNotNull(translator);
     }