X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2FMessageHeaderTest.java;h=eb975216e25f65f25124074be05d63071e1a8da7;hb=cccc148d3cd2b5a2a7c86da2e74f2ea43fa00b93;hp=aa3c5d4d9ba539167dd08aa3117dc45fbb7cc9b8;hpb=a92d9d6a21a0f6ca8d2153795721f500eaf29ee9;p=controller.git diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageHeaderTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageHeaderTest.java index aa3c5d4d9b..eb975216e2 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageHeaderTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageHeaderTest.java @@ -8,33 +8,25 @@ package org.opendaylight.controller.netconf.impl; -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.controller.netconf.util.messages.NetconfMessageHeader; - import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; -public class MessageHeaderTest { - - private NetconfMessageHeader header = null; - - @Before - public void setUp() { - this.header = new NetconfMessageHeader(); - } +import org.junit.Test; +import org.opendaylight.controller.netconf.util.messages.NetconfMessageHeader; +@Deprecated +public class MessageHeaderTest { @Test public void testFromBytes() { final byte[] raw = new byte[] { (byte) 0x0a, (byte) 0x23, (byte) 0x35, (byte) 0x38, (byte) 0x0a }; - this.header.fromBytes(raw); - assertEquals(58, this.header.getLength()); + NetconfMessageHeader header = NetconfMessageHeader.fromBytes(raw); + assertEquals(58, header.getLength()); } @Test public void testToBytes() { - this.header.setLength(123); + NetconfMessageHeader header = new NetconfMessageHeader(123); assertArrayEquals(new byte[] { (byte) 0x0a, (byte) 0x23, (byte) 0x31, (byte) 0x32, (byte) 0x33, (byte) 0x0a }, - this.header.toBytes()); + header.toBytes()); } }