Package com.mozilla.grouperfish.base.json

Examples of com.mozilla.grouperfish.base.json.JsonValidator


@Test(groups="unit")
public class JsonValidatorTest {

    public void testInvalidDocument() throws IOException {
        assertFalse(new JsonValidator().isValid("Your mom is valit!!!!"));
        assertFalse(new JsonValidator().isValid("{{{}}"));
    }
View Full Code Here


        assertFalse(new JsonValidator().isValid("Your mom is valit!!!!"));
        assertFalse(new JsonValidator().isValid("{{{}}"));
    }

    public void testTooEmptyDocument() throws IOException {
        assertFalse(new JsonValidator().isValid(""));
    }
View Full Code Here

    public void testTooEmptyDocument() throws IOException {
        assertFalse(new JsonValidator().isValid(""));
    }

    public void testValidDocument() throws IOException {
        assertTrue(new JsonValidator().isValid("{}"));
        assertTrue(new JsonValidator().isValid("{\"a\": 1}"));
        assertTrue(new JsonValidator().isValid("{\"a\": 1, \"b\": 2}"));
    }
View Full Code Here

    public boolean allows(final Class<?> resourceType, final Access access) {
        return true;
    }

    public JsonValidator validator(final Class<?> resourceType) {
        return new JsonValidator();
    }
View Full Code Here

TOP

Related Classes of com.mozilla.grouperfish.base.json.JsonValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.