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 com.google.common.collect.Lists;
14 import io.netty.buffer.Unpooled;
15 import java.util.ArrayList;
16 import org.junit.Test;
18 public class NetconfXMLToMessageDecoderTest {
21 public void testDecodeNoMoreContent() throws Exception {
22 final ArrayList<Object> out = Lists.newArrayList();
23 new NetconfXMLToMessageDecoder().decode(null, Unpooled.buffer(), out);
24 assertEquals(0, out.size());
28 public void testDecode() throws Exception {
29 final ArrayList<Object> out = Lists.newArrayList();
30 new NetconfXMLToMessageDecoder().decode(null, Unpooled.wrappedBuffer("<msg/>".getBytes()), out);
31 assertEquals(1, out.size());