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 {
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());
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();
}
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();
}
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();