Deprecate NetconfMessageHeader test class
[controller.git] / opendaylight / netconf / netconf-impl / src / test / java / org / opendaylight / controller / netconf / impl / MessageHeaderTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.netconf.impl;
10
11 import static org.junit.Assert.assertArrayEquals;
12 import static org.junit.Assert.assertEquals;
13
14 import org.junit.Test;
15 import org.opendaylight.controller.netconf.util.messages.NetconfMessageHeader;
16
17 @Deprecated
18 public class MessageHeaderTest {
19     @Test
20     public void testFromBytes() {
21         final byte[] raw = new byte[] { (byte) 0x0a, (byte) 0x23, (byte) 0x35, (byte) 0x38, (byte) 0x0a };
22         NetconfMessageHeader header = NetconfMessageHeader.fromBytes(raw);
23         assertEquals(58, header.getLength());
24     }
25
26     @Test
27     public void testToBytes() {
28         NetconfMessageHeader header = new NetconfMessageHeader(123);
29         assertArrayEquals(new byte[] { (byte) 0x0a, (byte) 0x23, (byte) 0x31, (byte) 0x32, (byte) 0x33, (byte) 0x0a },
30                 header.toBytes());
31     }
32 }