Package org.raml.parser.tagresolver

Examples of org.raml.parser.tagresolver.ContextPath


        assertThat(validationResults.size(), is(1));
        assertThat(validationResults.get(0).getMessage(), containsString("invalid JSON schema (" + resource + ")"));
        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.size(), is(1));
        assertThat(validationResults.get(0).getMessage(), containsString("invalid JSON schema (" + globalSchema + ")"));
        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.size(), is(1));
        assertThat(validationResults.get(0).getMessage(), containsString("invalid JSON schema (" + globalSchema + ")"));
        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.size(), is(1));
        assertThat(validationResults.get(0).getMessage(), containsString("invalid XML schema (" + resource + ")"));
        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).getMessage(), containsString("Unknown key: invalidKey1"));
        assertThat(errors.get(1).getIncludeName(), is(includedResource1));
        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

        String resource = "org/raml/validation/circular-include.yaml";
        List<ValidationResult> validationResults = validateRaml(resource);
        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

        return contextPath;
    }

    public void setIncludeContext(ContextPath contextPath)
    {
        this.contextPath = new ContextPath(contextPath);
        if (extraIncludeInfo != null)
        {
            this.contextPath.push(extraIncludeInfo);
            extraIncludeInfo = null;
        }
View Full Code Here

TOP

Related Classes of org.raml.parser.tagresolver.ContextPath

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.