package org.kordamp.json.processors;

import junit.framework.TestCase;
import org.kordamp.json.JSONArray;
import org.kordamp.json.JSONFunction;
import org.kordamp.json.JSONNull;
import org.kordamp.json.JSONObject;
import org.kordamp.json.sample.ObjectJSONStringBean;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collections;

import static java.util.Collections.emptyList;

/**
 * @author Andres Almiray
 */
public class TestJsonVerifier extends TestCase {
    public void testBoolean() {
        assertTrue(JsonVerifier.isValidJsonValue(true));
    }

    public void testByte() {
        assertTrue(JsonVerifier.isValidJsonValue((byte) 0));
    }

    public void testShort() {
        assertTrue(JsonVerifier.isValidJsonValue((short) 0));
    }

    public void testInteger() {
        assertTrue(JsonVerifier.isValidJsonValue( 0));
    }

    public void testLong() {
        assertTrue(JsonVerifier.isValidJsonValue(0L));
    }

    public void testFloat() {
        assertFalse(JsonVerifier.isValidJsonValue(0f));
    }

    public void testDouble() {
        assertTrue(JsonVerifier.isValidJsonValue(0d));
    }

    public void testString() {
        assertTrue(JsonVerifier.isValidJsonValue(""));
    }

    public void testBigInteger() {
        assertTrue(JsonVerifier.isValidJsonValue(BigInteger.ONE));
    }

    public void testBigDecimal() {
        assertTrue(JsonVerifier.isValidJsonValue(BigDecimal.ONE));
    }

    public void testJSONNull() {
        assertTrue(JsonVerifier.isValidJsonValue(JSONNull.getInstance()));
    }

    public void testJSONObject() {
        assertTrue(JsonVerifier.isValidJsonValue(JSONObject.fromObject(null)));
    }

    public void testJSONArray() {
        assertTrue(JsonVerifier.isValidJsonValue(JSONArray.fromObject(emptyList())));
    }

    public void testJSONFunction() {
        assertTrue(JsonVerifier.isValidJsonValue(JSONFunction.parse("function() {}")));
    }

    public void testJSONString() {
        assertTrue(JsonVerifier.isValidJsonValue(new ObjectJSONStringBean()));
    }
}

@@ -1,8 +1,797 @@
+/*%0A * Copyright 2006-2016 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A * This product includes software developed by Douglas Crockford%0A * (http://www.crockford.com) and released under the Apache Software%0A * License version 2.0 in 2006.%0A */%0A
 package 
@@ -1079,16 +1079,16 @@
 ecimal;%0A
+
 import j
@@ -1111,38 +1111,8 @@
 ger;
-%0Aimport java.util.Collections;
 %0A%0Aim

Fix build breakage