X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fserialization%2Fmatch%2FOxmVlanPcpSerializerTest.java;h=ecadb71cc610b1011a894ce4c0e0e09f23ef22a8;hb=29a2a074c78708f6d18583779ece96bb6573f0c6;hp=b96e0d7694796abd4e9429f02485a7401dc5c338;hpb=07de1ed897da9d7dc70c6d550f38c59339ed751e;p=openflowjava.git diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java index b96e0d76..ecadb71c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java @@ -16,11 +16,11 @@ import io.netty.buffer.PooledByteBufAllocator; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpMatchEntry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpMatchEntryBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.pcp._case.VlanPcpBuilder; /** * @author michal.polkorab @@ -35,7 +35,7 @@ public class OxmVlanPcpSerializerTest { */ @Test public void testSerialize() { - MatchEntriesBuilder builder = prepareVlanPcpMatchEntry((short) 42); + MatchEntryBuilder builder = prepareVlanPcpMatchEntry((short) 42); ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -50,7 +50,7 @@ public class OxmVlanPcpSerializerTest { */ @Test public void testSerializeHeader() { - MatchEntriesBuilder builder = prepareVlanPcpHeader(false); + MatchEntryBuilder builder = prepareVlanPcpHeader(false); ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -83,16 +83,18 @@ public class OxmVlanPcpSerializerTest { assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength()); } - private static MatchEntriesBuilder prepareVlanPcpMatchEntry(short value) { - MatchEntriesBuilder builder = prepareVlanPcpHeader(false); - VlanPcpMatchEntryBuilder pcpBuilder = new VlanPcpMatchEntryBuilder(); - pcpBuilder.setVlanPcp(value); - builder.addAugmentation(VlanPcpMatchEntry.class, pcpBuilder.build()); + private static MatchEntryBuilder prepareVlanPcpMatchEntry(short value) { + MatchEntryBuilder builder = prepareVlanPcpHeader(false); + VlanPcpCaseBuilder casebuilder = new VlanPcpCaseBuilder(); + VlanPcpBuilder valueBuilder = new VlanPcpBuilder(); + valueBuilder.setVlanPcp(value); + casebuilder.setVlanPcp(valueBuilder.build()); + builder.setMatchEntryValue(casebuilder.build()); return builder; } - private static MatchEntriesBuilder prepareVlanPcpHeader(boolean hasMask) { - MatchEntriesBuilder builder = new MatchEntriesBuilder(); + private static MatchEntryBuilder prepareVlanPcpHeader(boolean hasMask) { + MatchEntryBuilder builder = new MatchEntryBuilder(); builder.setOxmClass(OpenflowBasicClass.class); builder.setOxmMatchField(VlanPcp.class); builder.setHasMask(hasMask);