Use ByteBuf.readRetainedSlice()
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / util / FlowUtilTest.java
index 8b6f51033f0984ac57d98bb5cc8a268b2a983041..384d9664a4bea8314d389d196538e6ba48388ed6 100644 (file)
@@ -33,9 +33,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcError;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
+import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class FlowUtilTest {
@@ -66,7 +68,7 @@ public class FlowUtilTest {
         final RpcResult<List<BatchFailedFlowsOutput>> summary = function.apply(Lists.newArrayList(
                 RpcResultBuilder.success("a").build(),
                 RpcResultBuilder.<String>failed()
-                        .withError(RpcError.ErrorType.APPLICATION, "action-failed reason")
+                        .withError(ErrorType.APPLICATION, "action-failed reason")
                         .build()));
 
         Assert.assertFalse(summary.isSuccessful());
@@ -135,9 +137,10 @@ public class FlowUtilTest {
 
     private static RpcResult<List<BatchFailedFlowsOutput>> createBatchOutcomeWithError() {
         return RpcResultBuilder.<List<BatchFailedFlowsOutput>>failed()
-                .withError(RpcError.ErrorType.APPLICATION, "ut-flowAddFail")
+                .withError(ErrorType.APPLICATION, "ut-flowAddFail")
                 .withResult(Collections.singletonList(new BatchFailedFlowsOutputBuilder()
                         .setFlowId(DUMMY_FLOW_ID)
+                        .setBatchOrder(Uint16.ZERO)
                         .build()))
                 .build();
     }
@@ -222,14 +225,14 @@ public class FlowUtilTest {
 
     private static RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
         return RpcResultBuilder.<SendBarrierOutput>failed()
-                .withError(RpcError.ErrorType.APPLICATION, "ut-barrier-error")
+                .withError(ErrorType.APPLICATION, "ut-barrier-error")
                 .build();
     }
 
     private static RpcResult<AddFlowsBatchOutput> createAddFlowsBatchSuccessOutput() {
         return RpcResultBuilder
                 .success(new AddFlowsBatchOutputBuilder()
-                        .setBatchFailedFlowsOutput(Collections.emptyList())
+                        .setBatchFailedFlowsOutput(Collections.emptyMap())
                         .build())
                 .build();
     }
@@ -238,7 +241,7 @@ public class FlowUtilTest {
         final RpcResult<List<BatchFailedFlowsOutput>> batchOutcomeWithError = createBatchOutcomeWithError();
         return RpcResultBuilder.<AddFlowsBatchOutput>failed()
                 .withResult(new AddFlowsBatchOutputBuilder()
-                        .setBatchFailedFlowsOutput(batchOutcomeWithError.getResult())
+                        .setBatchFailedFlowsOutput(BindingMap.ordered(batchOutcomeWithError.getResult()))
                         .build())
                 .withRpcErrors(batchOutcomeWithError.getErrors())
                 .build();