// Path: src/test/java/com/nebhale/jsonpath/testutils/JsonUtils.java
// public static final JsonNode NODE;
// 
// Path: src/test/java/com/nebhale/jsonpath/testutils/JsonUtils.java
// public static final String STRING_INVALID;
// 
// Path: src/test/java/com/nebhale/jsonpath/testutils/JsonUtils.java
// public static final String STRING_VALID;
// 
// Path: src/main/java/com/nebhale/jsonpath/internal/util/Sets.java
// public final class Sets {
// 
//     private Sets() {
//     }
// 
//     /**
//      * Creates a {@link Set} from a collection of items
//      *
//      * @param items The items to create the set from
//      * @return The set created from the collection of items
//      */
//     public static <T> Set<T> asSet(T... items) {
//         Set<T> set = new HashSet<T>();
//         for (T item : items) {
//             set.add(item);
//         }
//         return set;
//     }
// }


import static com.nebhale.jsonpath.testutils.JsonUtils.NODE;
import static com.nebhale.jsonpath.testutils.JsonUtils.STRING_INVALID;
import static com.nebhale.jsonpath.testutils.JsonUtils.STRING_VALID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.junit.Test;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.TextNode;
import com.fasterxml.jackson.databind.type.CollectionType;
import com.fasterxml.jackson.databind.type.SimpleType;
import com.nebhale.jsonpath.internal.util.Sets;
/*
 * Copyright 2013 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.nebhale.jsonpath;





public final class JsonPathTest {

    @Test
    public void compileValid() {
        assertNotNull(JsonPath.compile("$"));
    }

    @Test(expected = InvalidJsonPathExpressionException.class)
    public void compileInvalid() {
        JsonPath.compile(".");
    }

    @Test
    public void stringInputClassOutputStatic() {
        assertNotNull(JsonPath.read("$", STRING_VALID, Map.class));
    }

    @Test
    public void stringInputTypeReferenceOutputStatic() {
        assertNotNull(JsonPath.read("$", STRING_VALID, new TypeReference<JsonNode>() {
        }));
    }

    @Test
    public void stringInputJavaTypeOutputStatic() {
        assertNotNull(JsonPath.read("$", STRING_VALID, SimpleType.construct(Object.class)));
    }

    @Test
    public void jsonNodeInputClassOutputStatic() {
// Path: src/test/java/com/nebhale/jsonpath/testutils/JsonUtils.java
// public static final JsonNode NODE;
// 
// Path: src/test/java/com/nebhale/jsonpath/testutils/JsonUtils.java
// public static final String STRING_INVALID;
// 
// Path: src/test/java/com/nebhale/jsonpath/testutils/JsonUtils.java
// public static final String STRING_VALID;
// 
// Path: src/main/java/com/nebhale/jsonpath/internal/util/Sets.java
// public final class Sets {
// 
//     private Sets() {
//     }
// 
//     /**
//      * Creates a {@link Set} from a collection of items
//      *
//      * @param items The items to create the set from
//      * @return The set created from the collection of items
//      */
//     public static <T> Set<T> asSet(T... items) {
//         Set<T> set = new HashSet<T>();
//         for (T item : items) {
//             set.add(item);
//         }
//         return set;
//     }
// }


// Path: src/test/java/com/nebhale/jsonpath/JsonPathTest.java
import static com.nebhale.jsonpath.testutils.JsonUtils.NODE;
import static com.nebhale.jsonpath.testutils.JsonUtils.STRING_INVALID;
import static com.nebhale.jsonpath.testutils.JsonUtils.STRING_VALID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.junit.Test;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.TextNode;
import com.fasterxml.jackson.databind.type.CollectionType;
import com.fasterxml.jackson.databind.type.SimpleType;
import com.nebhale.jsonpath.internal.util.Sets;

/*
 * Copyright 2013 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.nebhale.jsonpath;





public final class JsonPathTest {

    @Test
    public void compileValid() {
        assertNotNull(JsonPath.compile("$"));
    }

    @Test(expected = InvalidJsonPathExpressionException.class)
    public void compileInvalid() {
        JsonPath.compile(".");
    }

    @Test
    public void stringInputClassOutputStatic() {
        assertNotNull(JsonPath.read("$", STRING_VALID, Map.class));
    }

    @Test
    public void stringInputTypeReferenceOutputStatic() {
        assertNotNull(JsonPath.read("$", STRING_VALID, new TypeReference<JsonNode>() {
        }));
    }

    @Test
    public void stringInputJavaTypeOutputStatic() {
        assertNotNull(JsonPath.read("$", STRING_VALID, SimpleType.construct(Object.class)));
    }

    @Test
    public void jsonNodeInputClassOutputStatic() {
        assertNotNull(JsonPath.read("$", NODE, Map.class));