2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. 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
8 package org.opendaylight.yangtools.yang.data.codec.gson;
10 import static org.junit.Assert.assertEquals;
12 import java.io.IOException;
13 import org.junit.AfterClass;
14 import org.junit.BeforeClass;
15 import org.junit.Test;
17 public class RFC7951YT1027Test extends AbstractYT1027Test {
18 private static JSONCodecFactory CODEC_FACTORY;
21 public static void createFactory() {
22 CODEC_FACTORY = JSONCodecFactorySupplier.RFC7951.getShared(SCHEMA_CONTEXT);
26 public static void destroyFactory() {
31 public void testDecimalUnquotedParsing() throws IOException {
32 assertEquals(DECIMAL_DATA, fromJSON(UNQUOTED_DECIMAL));
36 public void testInt64UnquotedParsing() throws IOException {
37 assertEquals(INT64_DATA, fromJSON(UNQUOTED_INT64));
41 public void testUint64UnquotedParsing() throws IOException {
42 assertEquals(UINT64_DATA, fromJSON(UNQUOTED_UINT64));
46 JSONCodecFactory codecFactory() {
51 Class<?> wrapperClass() {
52 return QuotedJSONCodec.class;
56 String expectedDecimal() {
58 + " \"yt1027:decimal\": \"1.1\"\n"
63 String expectedInt64() {
65 + " \"yt1027:int64\": \"2\"\n"
70 String expectedUint64() {
72 + " \"yt1027:uint64\": \"1\"\n"