Package org.raml.parser.visitor

Examples of org.raml.parser.visitor.IncludeInfo


        assertThat(validationResults.get(0).getLine() + 1, is(4));
        assertThat(validationResults.get(0).getStartColumn(), is(UNKNOWN));
        assertThat(validationResults.get(0).getEndColumn(), is(UNKNOWN));
        ContextPath includeContext = validationResults.get(0).getIncludeContext();
        assertThat(includeContext.size(), is(2));
        IncludeInfo includeInfo = includeContext.pop();
        assertThat(includeInfo.getLine() + 1, is(7));
        assertThat(includeInfo.getStartColumn() + 1, is(25));
        assertThat(includeInfo.getEndColumn() + 1, is(46));
        assertThat(includeInfo.getIncludeName(), is(resource));
    }
View Full Code Here


        assertThat(validationResults.get(0).getLine() + 1, is(4));
        assertThat(validationResults.get(0).getStartColumn(), is(UNKNOWN));
        assertThat(validationResults.get(0).getEndColumn(), is(UNKNOWN));
        ContextPath includeContext = validationResults.get(0).getIncludeContext();
        assertThat(includeContext.size(), is(2));
        IncludeInfo includeInfo = includeContext.pop();
        assertThat(includeInfo.getLine() + 1, is(4));
        assertThat(includeInfo.getStartColumn() + 1, is(15));
        assertThat(includeInfo.getEndColumn() + 1, is(36));
        assertThat(includeInfo.getIncludeName(), is(resource));
    }
View Full Code Here

        assertThat(validationResults.get(0).getLine() + 1, is(5));
        assertThat(validationResults.get(0).getStartColumn(), is(UNKNOWN));
        assertThat(validationResults.get(0).getEndColumn(), is(UNKNOWN));
        ContextPath includeContext = validationResults.get(0).getIncludeContext();
        assertThat(includeContext.size(), is(2));
        IncludeInfo includeInfo = includeContext.pop();
        assertThat(includeInfo.getLine() + 1, is(4));
        assertThat(includeInfo.getStartColumn() + 1, is(15));
        assertThat(includeInfo.getEndColumn() + 1, is(52));
        assertThat(includeInfo.getIncludeName(), is(resource));
    }
View Full Code Here

        assertThat(validationResults.get(0).getLine() + 1, is(8));
        assertThat(validationResults.get(0).getStartColumn(), is(UNKNOWN));
        assertThat(validationResults.get(0).getEndColumn(), is(UNKNOWN));
        ContextPath includeContext = validationResults.get(0).getIncludeContext();
        assertThat(includeContext.size(), is(2));
        IncludeInfo includeInfo = includeContext.pop();
        assertThat(includeInfo.getLine() + 1, is(7));
        assertThat(includeInfo.getStartColumn() + 1, is(25));
        assertThat(includeInfo.getEndColumn() + 1, is(45));
        assertThat(includeInfo.getIncludeName(), is(resource));
    }
View Full Code Here

        assertThat(errors.get(1).getLine() + 1, is(2));
        assertThat(errors.get(1).getStartColumn() + 1, is(1));
        assertThat(errors.get(1).getEndColumn() + 1, is(12));
        ContextPath contextPath = errors.get(1).getIncludeContext();
        assertThat(contextPath.size(), is(2));
        IncludeInfo includeInfo = contextPath.pop();
        assertThat(includeInfo.getLine() + 1, is(7));
        assertThat(includeInfo.getStartColumn() + 1, is(14));
        assertThat(includeInfo.getEndColumn() + 1, is(47));
        assertThat(includeInfo.getIncludeName(), is(includedResource1));
        assertThat(contextPath.size(), is(1));

        assertThat(errors.get(2).getMessage(), containsString("Unknown key: invalidKey2"));
        assertThat(errors.get(2).getIncludeName(), is(includedResource2));
        assertThat(errors.get(2).getLine() + 1, is(3));
        assertThat(errors.get(2).getStartColumn() + 1, is(1));
        assertThat(errors.get(2).getEndColumn() + 1, is(12));
        contextPath = errors.get(2).getIncludeContext();
        assertThat(contextPath.size(), is(3));
        includeInfo = contextPath.pop();
        assertThat(includeInfo.getLine() + 1, is(3));
        assertThat(includeInfo.getStartColumn() + 1, is(6));
        assertThat(includeInfo.getEndColumn() + 1, is(41));
        assertThat(includeInfo.getIncludeName(), is(includedResource2));
        includeInfo = contextPath.pop();
        assertThat(includeInfo.getLine() + 1, is(7));
        assertThat(includeInfo.getStartColumn() + 1, is(14));
        assertThat(includeInfo.getEndColumn() + 1, is(47));
        assertThat(includeInfo.getIncludeName(), is(includedResource1));
        assertThat(contextPath.size(), is(1));
    }
View Full Code Here

        assertThat(validationResults.size(), is(1));
        assertThat(validationResults.get(0).getMessage(), is("Circular reference detected"));
        assertThat(validationResults.get(0).getLine() + 1, is(1));
        ContextPath includeContext = validationResults.get(0).getIncludeContext();
        assertThat(includeContext.size(), is(4));
        IncludeInfo includeInfo = includeContext.pop();
        assertThat(includeInfo.getIncludeName(), containsString("circular1.raml"));
        assertThat(includeInfo.getLine() + 1, is(2));
        includeInfo = includeContext.pop();
        assertThat(includeInfo.getIncludeName(), containsString("circular2.raml"));
        assertThat(includeInfo.getLine() + 1, is(2));
        includeInfo = includeContext.pop();
        assertThat(includeInfo.getIncludeName(), containsString("circular1.raml"));
        assertThat(includeInfo.getLine() + 1, is(3));
    }
View Full Code Here

    {
        if (includeStack.size() > 0)
        {
            throw new IllegalStateException("Non empty stack");
        }
        includeStack.add(new IncludeInfo(absoluteFile));
    }
View Full Code Here

        includeStack.push(includeInfo);
    }

    public void push(ScalarNode node)
    {
        push(new IncludeInfo(node, getPartentPath()));
    }
View Full Code Here

        push(new IncludeInfo(node, getPartentPath()));
    }

    public void push(Tag tag)
    {
        push(new IncludeInfo(tag));
    }
View Full Code Here

    public List<ValidationResult> doValidateValue(ScalarNode node)
    {
        String value = node.getValue();
        List<ValidationResult> validationResults = super.doValidateValue(node);

        IncludeInfo globaSchemaIncludeInfo = null;
        ScalarNode schemaNode = getGlobalSchemaNode(value);
        if (schemaNode == null)
        {
            schemaNode = node;
        }
        else
        {
            value = schemaNode.getValue();
            if (schemaNode.getTag().startsWith(INCLUDE_APPLIED_TAG))
            {
                globaSchemaIncludeInfo = new IncludeInfo(schemaNode.getTag());
            }
        }
        if (value == null || isCustomTag(schemaNode.getTag()))
        {
            return validationResults;
View Full Code Here

TOP

Related Classes of org.raml.parser.visitor.IncludeInfo

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.