Replaced usage of BytebufUtils.padBuffer() as it is deprecated
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / MultipartReplyMessageFactoryTest.java
index 24985bb8a87e5811945655f5b4a88cb6fea04623..1920e07d897e7e5081a7adce0b703bbb184d366f 100644 (file)
@@ -21,7 +21,6 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
@@ -125,31 +124,31 @@ public class MultipartReplyMessageFactoryTest {
         byte[] mfrDescBytes = new byte[256];
         mfrDescBytes = mfrDesc.getBytes();
         bb.writeBytes(mfrDescBytes);
-        ByteBufUtils.padBuffer((DESC_STR_LEN - mfrDescBytes.length), bb);
+        bb.writeZero(DESC_STR_LEN - mfrDescBytes.length);
         
         String hwDesc = "Hardware description";
         byte[] hwDescBytes = new byte[256];
         hwDescBytes = hwDesc.getBytes();
         bb.writeBytes(hwDescBytes);
-        ByteBufUtils.padBuffer((DESC_STR_LEN - hwDescBytes.length), bb);
+        bb.writeZero(DESC_STR_LEN - hwDescBytes.length);
         
         String swDesc = "Software description";
         byte[] swDescBytes = new byte[256];
         swDescBytes = swDesc.getBytes();
         bb.writeBytes(swDescBytes);
-        ByteBufUtils.padBuffer((DESC_STR_LEN - swDescBytes.length), bb);
+        bb.writeZero(DESC_STR_LEN - swDescBytes.length);
         
         String serialNum = "SN0123456789";
         byte[] serialNumBytes = new byte[32];
         serialNumBytes = serialNum.getBytes();
         bb.writeBytes(serialNumBytes);
-        ByteBufUtils.padBuffer((SERIAL_NUM_LEN - serialNumBytes.length), bb);
+        bb.writeZero(SERIAL_NUM_LEN - serialNumBytes.length);
         
         String dpDesc = "switch3 in room 3120";
         byte[] dpDescBytes = new byte[256];
         dpDescBytes = dpDesc.getBytes();
         bb.writeBytes(dpDescBytes);
-        ByteBufUtils.padBuffer((DESC_STR_LEN - dpDescBytes.length), bb);
+        bb.writeZero(DESC_STR_LEN - dpDescBytes.length);
         
         MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb);
         
@@ -827,7 +826,7 @@ public class MultipartReplyMessageFactoryTest {
         byte[] portNameBytes = new byte[MAX_PORT_NAME_LEN];
         portNameBytes = portName.getBytes();
         bb.writeBytes(portNameBytes);
-        ByteBufUtils.padBuffer((MAX_PORT_NAME_LEN - portNameBytes.length), bb);
+        bb.writeZero(MAX_PORT_NAME_LEN - portNameBytes.length);
         
         ByteBuf bb2 =  BufferHelper.buildBuffer("00 00 00 41 " + //port config
                                                 "00 00 00 05 " + //port state