import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
-import java.util.Collections;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class ApplyActionsInstructionSerializerTest extends AbstractInstructionSerializerTest {
@Test
final Instruction instruction = new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
- .setAction(Collections.singletonList(new ActionBuilder()
+ .setAction(BindingMap.of(new ActionBuilder()
.setOrder(order)
.withKey(new ActionKey(order))
.setAction(new SetNwSrcActionCaseBuilder()
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
-import java.util.Collections;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteActionsCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteActionsCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.actions._case.WriteActionsBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class WriteActionsInstructionSerializerTest extends AbstractInstructionSerializerTest {
@Test
final Instruction instruction = new WriteActionsCaseBuilder()
.setWriteActions(new WriteActionsBuilder()
- .setAction(Collections.singletonList(new ActionBuilder()
+ .setAction(BindingMap.of(new ActionBuilder()
.setOrder(order)
.withKey(new ActionKey(order))
.setAction(new SetNwSrcActionCaseBuilder()
import io.netty.buffer.ByteBuf;
import io.netty.buffer.UnpooledByteBufAllocator;
-import java.util.Arrays;
-import java.util.Collections;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModCommand;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint64;
private static final Uint16 TP_SRC_PORT = Uint16.valueOf(22);
private static final Uint16 TP_DST_PORT = Uint16.valueOf(23);
private static final Instructions INSTRUCTIONS = new InstructionsBuilder()
- .setInstruction(Arrays.asList(
+ .setInstruction(BindingMap.ordered(
new InstructionBuilder()
.setOrder(0)
.withKey(new InstructionKey(0))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
- .setAction(Collections.singletonList(new ActionBuilder()
+ .setAction(BindingMap.of(new ActionBuilder()
.setOrder(0)
.withKey(new ActionKey(0))
.setAction(new SetVlanIdActionCaseBuilder()
.withKey(new InstructionKey(2))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
- .setAction(Collections.singletonList(new ActionBuilder()
+ .setAction(BindingMap.of(new ActionBuilder()
.setOrder(1)
.withKey(new ActionKey(1))
.setAction(new SetTpDstActionCaseBuilder()
.withKey(new InstructionKey(1))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
- .setAction(Collections.singletonList(new ActionBuilder()
+ .setAction(BindingMap.of(new ActionBuilder()
.setOrder(2)
.withKey(new ActionKey(2))
.setAction(new SetTpSrcActionCaseBuilder()
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupModCommand;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint8;
);
private static final Buckets BUCKETS = new BucketsBuilder()
- .setBucket(Collections.singletonList(new BucketBuilder()
+ .setBucket(BindingMap.of(new BucketBuilder()
.setBucketId(BUCKET_ID)
.withKey(BUCKET_KEY)
.setWatchGroup(BUCKET_WATCH_GROUP)
import io.netty.buffer.ByteBuf;
import io.netty.buffer.UnpooledByteBufAllocator;
-import java.util.Arrays;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.meter.band.header.MeterBandTypesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterBandType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterModCommand;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint8;
.setVersion(EncodeConstants.OF_VERSION_1_3)
.setMeterName(METER_NAME)
.setMeterBandHeaders(new MeterBandHeadersBuilder()
- .setMeterBandHeader(Arrays.asList(
+ .setMeterBandHeader(BindingMap.ordered(
new MeterBandHeaderBuilder()
.setMeterBandTypes(new MeterBandTypesBuilder()
.setFlags(new org.opendaylight.yang.gen.v1.urn.opendaylight
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.TablePropertiesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesKey;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint64;
import org.opendaylight.yangtools.yang.common.Uint8;
.build())
.build();
private static final MultipartRequestTableFeatures BODY = new MultipartRequestTableFeaturesBuilder()
- .setTableFeatures(Collections.singletonList(new TableFeaturesBuilder()
+ .setTableFeatures(BindingMap.of(new TableFeaturesBuilder()
.setTableId(TABLE_ID)
.setName(NAME)
.setMetadataMatch(METADATA_MATCH)
.setConfig(new TableConfig(IS_DEPRECATED_MASK))
.setMaxEntries(MAX_ENTRIES)
.setTableProperties(new TablePropertiesBuilder()
- .setTableFeatureProperties(Collections.singletonList(new TableFeaturePropertiesBuilder()
+ .setTableFeatureProperties(BindingMap.of(new TableFeaturePropertiesBuilder()
.setOrder(0)
- .withKey(new TableFeaturePropertiesKey(0))
.setTableFeaturePropType(NEXT_TABLE)
.build()))
.build())
import static org.junit.Assert.assertEquals;
-import java.util.Collections;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMiss;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class ApplyActionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
.setApplyActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight
.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.miss
.ApplyActionsMissBuilder()
- .setAction(Collections.singletonList(new ActionBuilder()
+ .setAction(BindingMap.of(new ActionBuilder()
.setOrder(0)
- .setAction(new SetNwSrcActionCaseBuilder()
- .build())
+ .setAction(new SetNwSrcActionCaseBuilder().build())
.build()))
.build())
.build();
import static org.junit.Assert.assertEquals;
-import java.util.Collections;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class ApplyActionsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
.setApplyActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
.prop.type.table.feature.prop.type.apply.actions
.ApplyActionsBuilder()
- .setAction(Collections.singletonList(new ActionBuilder()
+ .setAction(BindingMap.of(new ActionBuilder()
.setOrder(0)
- .setAction(new SetNwSrcActionCaseBuilder()
- .build())
+ .setAction(new SetNwSrcActionCaseBuilder().build())
.build()))
.build())
.build();
import static org.junit.Assert.assertEquals;
-import java.util.Collections;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMiss;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class InstructionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
.setInstructionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight
.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss
.InstructionsMissBuilder()
- .setInstruction(Collections.singletonList(new InstructionBuilder()
+ .setInstruction(BindingMap.of(new InstructionBuilder()
.setOrder(0)
- .setInstruction(new ApplyActionsCaseBuilder()
- .build())
+ .setInstruction(new ApplyActionsCaseBuilder().build())
.build()))
.build())
.build();
import static org.junit.Assert.assertEquals;
-import java.util.Collections;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Instructions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class InstructionsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
.setInstructions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
.prop.type.table.feature.prop.type.instructions
.InstructionsBuilder()
- .setInstruction(Collections.singletonList(new InstructionBuilder()
+ .setInstruction(BindingMap.of(new InstructionBuilder()
.setOrder(0)
- .setInstruction(new ApplyActionsCaseBuilder()
- .build())
+ .setInstruction(new ApplyActionsCaseBuilder().build())
.build()))
.build())
.build();
import static org.junit.Assert.assertEquals;
-import com.google.common.collect.ImmutableList;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Wildcards;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WildcardsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.wildcards.WildcardSetfieldBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class WildcardsTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
public void testSerialize() {
final Wildcards property = new WildcardsBuilder()
.setWildcardSetfield(new WildcardSetfieldBuilder()
- .setSetFieldMatch(ImmutableList
- .<SetFieldMatch>builder()
- .add(new SetFieldMatchBuilder()
- .setMatchType(ArpOp.class)
- .setHasMask(false)
- .build())
- .build())
+ .setSetFieldMatch(BindingMap.of(
+ new SetFieldMatchBuilder().setMatchType(ArpOp.class).setHasMask(false).build()))
.build())
.build();
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.ListenableFuture;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
ProcessFlatBatchInput batchInput = new ProcessFlatBatchInputBuilder()
.setNode(NODE_REF)
- .setBatch(Lists.newArrayList(
+ .setBatch(BindingMap.ordered(
createFlowAddBatch(0, "f1"),
createFlowRemoveBatch(1, "f2"),
createFlowUpdateBatch(2, "f3"),
int idx = 0;
ProcessFlatBatchInput batchInput = new ProcessFlatBatchInputBuilder()
.setNode(NODE_REF)
- .setBatch(Lists.newArrayList(
+ .setBatch(BindingMap.ordered(
createFlowAddBatch(idx++, "f1", 2),
createFlowRemoveBatch(idx++, "f2"),
createFlowUpdateBatch(idx++, "f3"),
Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.any()))
.thenReturn(RpcResultBuilder.<RemoveFlowsBatchOutput>failed()
.withResult(new RemoveFlowsBatchOutputBuilder()
- .setBatchFailedFlowsOutput(Lists.newArrayList(
+ .setBatchFailedFlowsOutput(BindingMap.ordered(
new BatchFailedFlowsOutputBuilder()
.setBatchOrder(Uint16.ONE)
.setFlowId(new FlowId("123"))
return map;
}
- private static <T> List<T> repeatInList(final T item, final int amount) {
- final List<T> list = new ArrayList<>();
- for (int i = 0; i < amount; i++) {
- list.add(item);
- }
- return list;
- }
-
private static Batch createFlowRemoveBatch(final int batchOrder, final String flowIdValue) {
return new BatchBuilder()
.setBatchOrder(Uint16.valueOf(batchOrder))
private static ProcessFlatBatchOutput createFlatBatchOutput(final BatchFailure... batchFailures) {
return new ProcessFlatBatchOutputBuilder()
- .setBatchFailure(Lists.newArrayList(batchFailures))
+ .setBatchFailure(BindingMap.ordered(batchFailures))
.build();
}
.thenReturn(RpcResultBuilder
.<AddFlowsBatchOutput>failed()
.withResult(new AddFlowsBatchOutputBuilder()
- .setBatchFailedFlowsOutput(Lists.newArrayList(
+ .setBatchFailedFlowsOutput(BindingMap.ordered(
new BatchFailedFlowsOutputBuilder()
.setBatchOrder(Uint16.ZERO)
.setFlowId(new FlowId("f1"))
package org.opendaylight.openflowplugin.impl.services.sal;
-import com.google.common.collect.Lists;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Future;
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.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
final RemoveFlowsBatchInput input = new RemoveFlowsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchRemoveFlows(Lists.newArrayList(batchFlow1, batchFlow2))
+ .setBatchRemoveFlows(BindingMap.ordered(batchFlow1, batchFlow2))
.build();
final Future<RpcResult<RemoveFlowsBatchOutput>> resultFuture = salFlowsBatchService.removeFlowsBatch(input);
final RemoveFlowsBatchInput input = new RemoveFlowsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchRemoveFlows(Lists.newArrayList(batchFlow1, batchFlow2))
+ .setBatchRemoveFlows(BindingMap.ordered(batchFlow1, batchFlow2))
.build();
final Future<RpcResult<RemoveFlowsBatchOutput>> resultFuture = salFlowsBatchService.removeFlowsBatch(input);
final AddFlowsBatchInput input = new AddFlowsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchAddFlows(Lists.newArrayList(
+ .setBatchAddFlows(BindingMap.ordered(
createEmptyBatchAddFlow("ut-dummy-flow1", 42),
createEmptyBatchAddFlow("ut-dummy-flow2", 43)))
.build();
final AddFlowsBatchInput input = new AddFlowsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchAddFlows(Lists.newArrayList(
+ .setBatchAddFlows(BindingMap.ordered(
createEmptyBatchAddFlow(FLOW_ID_VALUE_1, 42),
createEmptyBatchAddFlow(FLOW_ID_VALUE_2, 43)))
.build();
final UpdateFlowsBatchInput input = new UpdateFlowsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchUpdateFlows(Lists.newArrayList(
+ .setBatchUpdateFlows(BindingMap.ordered(
createEmptyBatchUpdateFlow(FLOW_ID_VALUE_1, 42),
createEmptyBatchUpdateFlow(FLOW_ID_VALUE_2, 44)))
.build();
final UpdateFlowsBatchInput input = new UpdateFlowsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchUpdateFlows(Lists.newArrayList(
+ .setBatchUpdateFlows(BindingMap.ordered(
createEmptyBatchUpdateFlow(FLOW_ID_VALUE_1, 42),
createEmptyBatchUpdateFlow(FLOW_ID_VALUE_2, 44)))
.build();
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.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
final AddGroupsBatchInput input = new AddGroupsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchAddGroups(Lists.newArrayList(
+ .setBatchAddGroups(BindingMap.ordered(
createEmptyBatchAddGroup(42L),
createEmptyBatchAddGroup(43L)))
.build();
final AddGroupsBatchInput input = new AddGroupsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchAddGroups(Lists.newArrayList(
+ .setBatchAddGroups(BindingMap.ordered(
createEmptyBatchAddGroup(42L),
createEmptyBatchAddGroup(43L)))
.build();
final RemoveGroupsBatchInput input = new RemoveGroupsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchRemoveGroups(Lists.newArrayList(
+ .setBatchRemoveGroups(BindingMap.ordered(
createEmptyBatchRemoveGroup(42L),
createEmptyBatchRemoveGroup(43L)))
.build();
final RemoveGroupsBatchInput input = new RemoveGroupsBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchRemoveGroups(Lists.newArrayList(
+ .setBatchRemoveGroups(BindingMap.ordered(
createEmptyBatchRemoveGroup(42L),
createEmptyBatchRemoveGroup(43L)))
.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.update.meters.batch.input.BatchUpdateMeters;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.update.meters.batch.input.BatchUpdateMetersBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
final AddMetersBatchInput input = new AddMetersBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchAddMeters(Lists.newArrayList(
+ .setBatchAddMeters(BindingMap.ordered(
createEmptyBatchAddMeter(42L),
createEmptyBatchAddMeter(43L)))
.build();
final AddMetersBatchInput input = new AddMetersBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchAddMeters(Lists.newArrayList(
+ .setBatchAddMeters(BindingMap.ordered(
createEmptyBatchAddMeter(42L),
createEmptyBatchAddMeter(43L)))
.build();
final RemoveMetersBatchInput input = new RemoveMetersBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchRemoveMeters(Lists.newArrayList(
+ .setBatchRemoveMeters(BindingMap.ordered(
createEmptyBatchRemoveMeter(42L),
createEmptyBatchRemoveMeter(43L)))
.build();
final RemoveMetersBatchInput input = new RemoveMetersBatchInputBuilder()
.setNode(NODE_REF)
.setBarrierAfter(true)
- .setBatchRemoveMeters(Lists.newArrayList(
+ .setBatchRemoveMeters(BindingMap.ordered(
createEmptyBatchRemoveMeter(42L),
createEmptyBatchRemoveMeter(43L)))
.build();
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowplugin.impl.services.batch.BatchPlanStep;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.output.BatchFailureKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.output.batch.failure.batch.item.id.choice.FlatBatchFailureFlowIdCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
.build();
}
- private static List<FlatBatchAddGroup> repeatFlatBatchAddGroupIntoList(final int size) {
- final List<FlatBatchAddGroup> list = new ArrayList<>();
+ private static Map<FlatBatchAddGroupKey, FlatBatchAddGroup> repeatFlatBatchAddGroupIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchAddGroupKey, FlatBatchAddGroup>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchAddGroupBuilder().withKey(new FlatBatchAddGroupKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
- private static List<FlatBatchUpdateGroup> repeatFlatBatchUpdateGroupIntoList(final int size) {
- final List<FlatBatchUpdateGroup> list = new ArrayList<>();
+ private static Map<FlatBatchUpdateGroupKey, FlatBatchUpdateGroup> repeatFlatBatchUpdateGroupIntoList(
+ final int size) {
+ final var list = BindingMap.<FlatBatchUpdateGroupKey, FlatBatchUpdateGroup>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchUpdateGroupBuilder().withKey(new FlatBatchUpdateGroupKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
- private static List<FlatBatchRemoveGroup> repeatFlatBatchRemoveGroupIntoList(final int size) {
- final List<FlatBatchRemoveGroup> list = new ArrayList<>();
+ private static Map<FlatBatchRemoveGroupKey, FlatBatchRemoveGroup> repeatFlatBatchRemoveGroupIntoList(
+ final int size) {
+ final var list = BindingMap.<FlatBatchRemoveGroupKey, FlatBatchRemoveGroup>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchRemoveGroupBuilder().withKey(new FlatBatchRemoveGroupKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
- private static List<FlatBatchAddFlow> repeatFlatBatchAddFlowIntoList(final int size) {
- final List<FlatBatchAddFlow> list = new ArrayList<>();
+ private static Map<FlatBatchAddFlowKey, FlatBatchAddFlow> repeatFlatBatchAddFlowIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchAddFlowKey, FlatBatchAddFlow>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchAddFlowBuilder().withKey(new FlatBatchAddFlowKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
- private static List<FlatBatchUpdateFlow> repeatFlatBatchUpdateFlowIntoList(final int size) {
- final List<FlatBatchUpdateFlow> list = new ArrayList<>();
+ private static Map<FlatBatchUpdateFlowKey, FlatBatchUpdateFlow> repeatFlatBatchUpdateFlowIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchUpdateFlowKey, FlatBatchUpdateFlow>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchUpdateFlowBuilder().withKey(new FlatBatchUpdateFlowKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
- private static List<FlatBatchRemoveFlow> repeatFlatBatchRemoveFlowIntoList(final int size) {
- final List<FlatBatchRemoveFlow> list = new ArrayList<>();
+ private static Map<FlatBatchRemoveFlowKey, FlatBatchRemoveFlow> repeatFlatBatchRemoveFlowIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchRemoveFlowKey, FlatBatchRemoveFlow>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchRemoveFlowBuilder().withKey(new FlatBatchRemoveFlowKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
- private static List<FlatBatchAddMeter> repeatFlatBatchAddMeterIntoList(final int size) {
- final List<FlatBatchAddMeter> list = new ArrayList<>();
+ private static Map<FlatBatchAddMeterKey, FlatBatchAddMeter> repeatFlatBatchAddMeterIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchAddMeterKey, FlatBatchAddMeter>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchAddMeterBuilder().withKey(new FlatBatchAddMeterKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
- private static List<FlatBatchUpdateMeter> repeatFlatBatchUpdateMeterIntoList(final int size) {
- final List<FlatBatchUpdateMeter> list = new ArrayList<>();
+ private static Map<FlatBatchUpdateMeterKey, FlatBatchUpdateMeter> repeatFlatBatchUpdateMeterIntoList(
+ final int size) {
+ final var list = BindingMap.<FlatBatchUpdateMeterKey, FlatBatchUpdateMeter>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchUpdateMeterBuilder().withKey(new FlatBatchUpdateMeterKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
- private static List<FlatBatchRemoveMeter> repeatFlatBatchRemoveMeterIntoList(final int size) {
- final List<FlatBatchRemoveMeter> list = new ArrayList<>();
+ private static Map<FlatBatchRemoveMeterKey, FlatBatchRemoveMeter> repeatFlatBatchRemoveMeterIntoList(
+ final int size) {
+ final var list = BindingMap.<FlatBatchRemoveMeterKey, FlatBatchRemoveMeter>orderedBuilder(size);
for (int i = 0; i < size; i++) {
list.add(new FlatBatchRemoveMeterBuilder().withKey(new FlatBatchRemoveMeterKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
}
@Test
.build();
final ProcessFlatBatchOutput output
- = new ProcessFlatBatchOutputBuilder().setBatchFailure(Lists.newArrayList(batchFailure)).build();
+ = new ProcessFlatBatchOutputBuilder().setBatchFailure(BindingMap.of(batchFailure)).build();
final ProcessFlatBatchOutput output_1
- = new ProcessFlatBatchOutputBuilder().setBatchFailure(Lists.newArrayList(batchFailure_1)).build();
+ = new ProcessFlatBatchOutputBuilder().setBatchFailure(BindingMap.of(batchFailure_1)).build();
final RpcResult<ProcessFlatBatchOutput> rpcResultFailed = RpcResultBuilder.<ProcessFlatBatchOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-rpcError")
private static RpcResult<AddFlowsBatchOutput> createAddFlowsBatchSuccessOutput() {
return RpcResultBuilder
.success(new AddFlowsBatchOutputBuilder()
- .setBatchFailedFlowsOutput(Collections.emptyList())
+ .setBatchFailedFlowsOutput(Collections.emptyMap())
.build())
.build();
}
private static RpcResult<AddGroupsBatchOutput> createAddGroupsBatchSuccessOutput() {
return RpcResultBuilder
.success(new AddGroupsBatchOutputBuilder()
- .setBatchFailedGroupsOutput(Collections.emptyList())
+ .setBatchFailedGroupsOutput(Collections.emptyMap())
.build())
.build();
}