/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.netconf.nettyutil.handler;
import static org.junit.Assert.assertEquals;
import com.google.common.collect.Lists;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.nio.charset.StandardCharsets;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Test;
public class NetconfChunkAggregatorTest {
private static final String CHUNKED_MESSAGE = "\n#4\n"
+ "\n"
+ " \n"
+ ""
+ "\n##\n";
public static final String EXPECTED_MESSAGE = "\n"
+ " \n"
+ "";
private static final String CHUNKED_MESSAGE_ONE = "\n#101\n" + EXPECTED_MESSAGE + "\n##\n";
private static NetconfChunkAggregator agr;
@BeforeClass
public static void setUp() throws Exception {
agr = new NetconfChunkAggregator();
}
@Test
public void testMultipleChunks() throws Exception {
final List