2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.netconf.nettyutil.handler;
11 import static org.junit.Assert.assertEquals;
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;
18 public class EOMFramingMechanismEncoderTest {
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);
27 assertEquals(Unpooled.wrappedBuffer(source.array(), NetconfMessageConstants.END_OF_MESSAGE), destination);