Deprecate DEFAULT_MAXIMUM_CHUNK_SIZE
[netconf.git] / netconf / netconf-impl / src / test / java / org / opendaylight / netconf / impl / MessageParserTest.java
index 88f4f1133726a3e8877fab7ccc3be161a5048b81..06b76a213dff55ba3753d508e834d1d01f7c2be5 100644 (file)
@@ -5,15 +5,12 @@
  * 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.impl;
 
 import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -35,7 +32,6 @@ import org.opendaylight.netconf.util.messages.FramingMechanism;
 import org.opendaylight.netconf.util.test.XmlFileLoader;
 
 public class MessageParserTest {
-
     private NetconfMessage msg;
 
     @Before
@@ -48,13 +44,12 @@ public class MessageParserTest {
         EmbeddedChannel testChunkChannel = new EmbeddedChannel(
                 FramingMechanismHandlerFactory.createHandler(FramingMechanism.CHUNK),
                 new NetconfMessageToXMLEncoder(),
-
-                new NetconfChunkAggregator(),
+                new NetconfChunkAggregator(ChunkedFramingMechanismEncoder.MAX_CHUNK_SIZE),
                 new NetconfXMLToMessageDecoder());
 
         testChunkChannel.writeOutbound(msg);
         Queue<Object> messages = testChunkChannel.outboundMessages();
-        assertFalse(messages.isEmpty());
+        assertEquals(1, messages.size());
 
         final NetconfMessageToXMLEncoder enc = new NetconfMessageToXMLEncoder();
         final ByteBuf out = Unpooled.buffer();
@@ -83,7 +78,7 @@ public class MessageParserTest {
 
             testChunkChannel.writeInbound(recievedOutbound);
         }
-        assertTrue(messages.isEmpty());
+        assertEquals(0, messages.size());
 
         NetconfMessage receivedMessage = testChunkChannel.readInbound();
         assertNotNull(receivedMessage);