import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
import java.math.BigInteger;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Gauge64;
-/**
- * Created by cgasparini on 19.5.2015.
- */
public class TlvUtilTest {
private static final byte[] TLV_IN = {(byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05};
}
@Test
- public void testFormatTlvASCII() throws Exception {
+ public void testFormatTlvAscii() throws Exception {
ByteBuf out = Unpooled.buffer(TLV_ASCII_OUT.length);
TlvUtil.formatTlvAscii(1, "Name", out);
Assert.assertArrayEquals(TLV_ASCII_OUT, ByteArray.getAllBytes(out));
TlvUtil.formatTlvAscii(1, null, out);
Assert.assertFalse(out.isReadable());
}
-
- @Test(expected=UnsupportedOperationException.class)
- public void testBmpMessageConstantsPrivateConstructor() throws Throwable {
- final Constructor<BmpMessageConstants> c = BmpMessageConstants.class.getDeclaredConstructor();
- c.setAccessible(true);
- try {
- c.newInstance();
- } catch (final InvocationTargetException e) {
- throw e.getCause();
- }
- }
-
- @Test(expected=UnsupportedOperationException.class)
- public void testTlvUtilPrivateConstructor() throws Throwable {
- final Constructor<TlvUtil> c = TlvUtil.class.getDeclaredConstructor();
- c.setAccessible(true);
- try {
- c.newInstance();
- } catch (final InvocationTargetException e) {
- throw e.getCause();
- }
- }
}
\ No newline at end of file