import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
-
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
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.PbbIsidCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.pbb.isid._case.PbbIsidBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
- * @author michal.polkorab
+ * Unit tests for OxmPbbIsidSerializer.
*
+ * @author michal.polkorab
*/
public class OxmPbbIsidSerializerTest {
OxmPbbIsidSerializer serializer = new OxmPbbIsidSerializer();
/**
- * Test correct serialization
+ * Test correct serialization.
*/
@Test
public void testSerializeWithMask() {
}
/**
- * Test correct serialization
+ * Test correct serialization.
*/
@Test
public void testSerializeWithoutMask() {
}
/**
- * Test correct header serialization
+ * Test correct header serialization.
*/
@Test
public void testSerializeHeaderWithoutMask() {
}
/**
- * Test correct header serialization
+ * Test correct header serialization.
*/
@Test
public void testSerializeHeaderWithMask() {
}
/**
- * Test correct oxm-class return value
+ * Test correct oxm-class return value.
*/
@Test
public void testGetOxmClassCode() {
}
/**
- * Test correct oxm-field return value
+ * Test correct oxm-field return value.
*/
@Test
public void getOxmFieldCode() {
}
/**
- * Test correct value length return value
+ * Test correct value length return value.
*/
@Test
public void testGetValueLength() {
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_3_BYTES, serializer.getValueLength());
}
- private static MatchEntryBuilder preparePbbIsidMatchEntry(boolean hasMask, long value) {
- MatchEntryBuilder builder = preparePbbIsidHeader(hasMask);
+ private static MatchEntryBuilder preparePbbIsidMatchEntry(boolean hasMask, int value) {
+ final MatchEntryBuilder builder = preparePbbIsidHeader(hasMask);
PbbIsidCaseBuilder casebuilder = new PbbIsidCaseBuilder();
PbbIsidBuilder valueBuilder = new PbbIsidBuilder();
if (hasMask) {
valueBuilder.setMask(new byte[]{0, 15, 10});
}
- valueBuilder.setIsid(value);
+ valueBuilder.setIsid(Uint32.valueOf(value));
casebuilder.setPbbIsid(valueBuilder.build());
builder.setMatchEntryValue(casebuilder.build());
return builder;
assertEquals("Wrong length", EncodeConstants.SIZE_OF_3_BYTES, buffer.readUnsignedByte());
}
}
-}
\ No newline at end of file
+}