/*
- * Copyright (C) 2014 Red Hat, Inc.
+ * Copyright (C) 2014 Red Hat, 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
- *
- * Authors : Dave Tucker
*/
-
package org.opendaylight.ovsdb.lib.jsonrpc;
import static io.netty.buffer.Unpooled.copiedBuffer;
import com.google.common.io.Resources;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.DecoderException;
-import io.netty.handler.codec.TooLongFrameException;
import io.netty.util.CharsetUtil;
import java.net.URL;
import org.junit.Before;
import org.junit.Test;
public class JsonRpcDecoderTest {
+
static int testJson_BYTES = 179;
String testJson;
String prettyTestJson;
/**
* Test decoding the Stringified Json text in test.json to
* individual Json node objects.
- * @throws Exception
*/
@Test
public void testDecode() throws Exception {
/**
* Test decoding the Stringified Json text in pretty-test.json to
* individual Json node objects.
- * @throws Exception
*/
@Test
public void testDecodePrettyJson() throws Exception {
/**
* Test decoding the Stringified Json text with large spaces to
* individual Json node objects.
- * @throws Exception
*/
@Test
public void testDecodeSkipSpaces() throws Exception {
* Test whether phased decoding is allowed with JsonRpcDecoder by
* writing Json string over two separate iterations, and checking if
* the decoder collates the record appropriately.
- * @throws Exception
*/
@Test
public void testDecodePartial() throws Exception {
* Test whether decoder throws appropriate DecoderException when
* passing a Json string using an unsupported (i.e., UTF-16)
* character set.
- * @throws Exception
*/
- @Test(expected= DecoderException.class)
+ @Test(expected = DecoderException.class)
public void testDecodeInvalidEncoding() throws Exception {
ch.writeInbound(copiedBuffer(testJson, CharsetUtil.UTF_16));
ch.finish();
}
- /* Disabling this test as the limit was changed
+
+ /* Disabling this test as the limit was changed
* from exception to a log warning...
/**
* Test whether decoder throws appropriate TooLongFrameException