Merge "Added feature for sal-mdsal-xsql"
[controller.git] / opendaylight / netconf / netconf-netty-util / src / test / java / org / opendaylight / controller / netconf / nettyutil / handler / EOMFramingMechanismEncoderTest.java
1 /*
2  * Copyright (c) 2014 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.nettyutil.handler;
10
11 import static org.junit.Assert.assertEquals;
12
13 import io.netty.buffer.ByteBuf;
14 import io.netty.buffer.Unpooled;
15 import org.junit.Test;
16 import org.opendaylight.controller.netconf.util.messages.NetconfMessageConstants;
17
18 public class EOMFramingMechanismEncoderTest {
19
20     @Test
21     public void testEncode() throws Exception {
22         final byte[] content = new byte[50];
23         final ByteBuf source = Unpooled.wrappedBuffer(content);
24         final ByteBuf destination = Unpooled.buffer();
25         new EOMFramingMechanismEncoder().encode(null, source, destination);
26
27         assertEquals(Unpooled.wrappedBuffer(source.array(), NetconfMessageConstants.END_OF_MESSAGE), destination);
28     }
29 }