Package com.github.fge.jsonschema.core.tree

Examples of com.github.fge.jsonschema.core.tree.SimpleJsonTree


    )
    public final void instanceIsCorrectlyAnalyzed(final JsonNode instance,
        final boolean valid, final String msg, final ObjectNode msgData)
        throws ProcessingException
    {
        final JsonTree tree = new SimpleJsonTree(instance);
        final FullData data = new FullData(SCHEMA_TREE, tree);

        attribute.validate(report, BUNDLE, data);

        if (valid) {
View Full Code Here


    {
        final ObjectNode schema = FACTORY.objectNode();
        schema.put("format", FMT);
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final JsonTree instance = new SimpleJsonTree(node);
        final FullData data = new FullData(tree, instance);
        final SchemaContext context = new SchemaContext(data);
        final ValidatorList in = new ValidatorList(context,
            Collections.<KeywordValidator>emptyList());
View Full Code Here

        throws IllegalAccessException, InvocationTargetException,
        InstantiationException, ProcessingException
    {
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final JsonTree instance = new SimpleJsonTree(node);
        final FullData data = new FullData(tree, instance);

        final ProcessingReport report = mock(ProcessingReport.class);
        @SuppressWarnings("unchecked")
        final Processor<FullData, FullData> processor =  mock(Processor.class);
View Full Code Here

        InstantiationException, ProcessingException
    {
        // FIXME: dummy, but we have no choice
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), digest);
        final JsonTree instance = new SimpleJsonTree(node);
        final FullData data = new FullData(tree, instance);

        final ProcessingReport report = mock(ProcessingReport.class);
        @SuppressWarnings("unchecked")
        final Processor<FullData, FullData> processor = mock(Processor.class);
View Full Code Here

        final ObjectNode schema = FACTORY.objectNode();
        schema.put("extends", FACTORY.objectNode());
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);

        final JsonTree instance = new SimpleJsonTree(FACTORY.nullNode());
        data = new FullData(tree, instance);

        report = mock(ProcessingReport.class);
        msg = new ProcessingMessage().setMessage(FOO);
    }
View Full Code Here

        final ObjectNode schema = FACTORY.objectNode();
        schema.put("not", FACTORY.objectNode());

        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final JsonTree instance = new SimpleJsonTree(FACTORY.nullNode());
        data = new FullData(tree, instance);
        report = mock(ProcessingReport.class);
        when(report.getLogLevel()).thenReturn(LogLevel.DEBUG);
    }
View Full Code Here

    public void childrenAreNotExploredByDefaultIfContainerFails()
        throws ProcessingException
    {
        final SchemaTree schema
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), RAWSCHEMA);
        final JsonTree instance = new SimpleJsonTree(RAWINSTANCE);
        final FullData data = new FullData(schema, instance);
        final ProcessingReport report = mock(ProcessingReport.class);
        processor.process(report, data);
        assertEquals(COUNT.get(), 0);
    }
View Full Code Here

    public void childrenAreExploredOnDemandEvenIfContainerFails()
        throws ProcessingException
    {
        final SchemaTree schema
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), RAWSCHEMA);
        final JsonTree instance = new SimpleJsonTree(RAWINSTANCE);
        final FullData data = new FullData(schema, instance, true);
        final ProcessingReport report = mock(ProcessingReport.class);
        processor.process(report, data);
        assertEquals(COUNT.get(), 1);
    }
View Full Code Here

        dataProvider = "negativeValues"
    )
    public void userIsWarnedAboutNegativeEpochs(final JsonNode input)
        throws ProcessingException
    {
        final JsonTree tree = new SimpleJsonTree(input);
        final FullData data = new FullData(SCHEMA_TREE, tree);

        attribute.validate(report, BUNDLE, data);

        final ArgumentCaptor<ProcessingMessage> captor
View Full Code Here

        dataProvider = "overflows"
    )
    public void userIsWarnedAboutPotentialOverflows(final JsonNode input)
        throws ProcessingException
    {
        final JsonTree tree = new SimpleJsonTree(input);
        final FullData data = new FullData(SCHEMA_TREE, tree);

        attribute.validate(report, BUNDLE, data);

        final ArgumentCaptor<ProcessingMessage> captor
View Full Code Here

TOP

Related Classes of com.github.fge.jsonschema.core.tree.SimpleJsonTree

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.