We are on home stretch now, update a few more tests.
Change-Id: Ibdf7ccac8d8d5b212ab9c7c2903f69098df2768b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class MatchTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
public void testSerialize() {
final Match property = new MatchBuilder()
- .setMatchSetfield(new MatchSetfieldBuilder()
- .setSetFieldMatch(ImmutableList
- .<SetFieldMatch>builder()
- .add(new SetFieldMatchBuilder()
- .setMatchType(ArpOp.class)
- .setHasMask(false)
- .build())
- .build())
- .build())
- .build();
+ .setMatchSetfield(new MatchSetfieldBuilder()
+ .setSetFieldMatch(BindingMap.of(new SetFieldMatchBuilder()
+ .setMatchType(ArpOp.class)
+ .setHasMask(false)
+ .build()))
+ .build())
+ .build();
assertProperty(property, out -> {
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
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.WriteSetfield;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class WriteSetfieldTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
@Test
public void testSerialize() {
final WriteSetfield property = new WriteSetfieldBuilder()
- .setWriteSetfield(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
- .prop.type.table.feature.prop.type.write.setfield
- .WriteSetfieldBuilder()
- .setSetFieldMatch(ImmutableList
- .<SetFieldMatch>builder()
- .add(new SetFieldMatchBuilder()
- .setMatchType(ArpOp.class)
- .setHasMask(false)
- .build())
- .build())
- .build())
- .build();
+ .setWriteSetfield(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature
+ .prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder()
+ .setSetFieldMatch(BindingMap.of(new SetFieldMatchBuilder()
+ .setMatchType(ArpOp.class)
+ .setHasMask(false)
+ .build()))
+ .build())
+ .build();
assertProperty(property, out -> {
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapKey;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.Uint32;
public class NodeConnectorDirectStatisticsServiceTest extends AbstractDirectStatisticsServiceTest {
final MultipartReply reply = new MultipartReplyBuilder()
.setMultipartReplyBody(new MultipartReplyPortStatsBuilder()
- .setNodeConnectorStatisticsAndPortNumberMap(Collections.singletonList(portStat))
+ .setNodeConnectorStatisticsAndPortNumberMap(BindingMap.of(portStat))
.build())
.build();
package org.opendaylight.openflowplugin.impl.util;
import com.google.common.collect.Lists;
-import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
.withError(RpcError.ErrorType.APPLICATION, "ut-rpcError")
.withResult(output_1).build();
final RpcResult<ProcessFlatBatchOutput> rpcResultSuccess = RpcResultBuilder.<ProcessFlatBatchOutput>success()
- .withResult(new ProcessFlatBatchOutputBuilder().setBatchFailure(new ArrayList<>())).build();
+ .withResult(new ProcessFlatBatchOutputBuilder().setBatchFailure(Map.of())).build();
final RpcResult<ProcessFlatBatchOutput> rpcResult1
= FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultFailed, rpcResultSuccess));