Package com.gatehill.apib.parser.model.result

Examples of com.gatehill.apib.parser.model.result.SourceAnnotation


                continue;
            }
            LOGGER.trace("Attempt to parse result line: {}", line);

            if (RESULT_OK.equals(line)) {
                astResult.setError(new SourceAnnotation(AstResult.ErrorCode.NoError.getErrorCode(), null, null));

            } else if (line.startsWith(RESULT_ERROR)) {
                line = line.substring(RESULT_ERROR.length() + 1).trim();
                astResult.setError(getSourceAnnotation(line));
View Full Code Here


            } else {
                // fall back to using all of detail as message
                message = detail;
            }

            return new SourceAnnotation(resultCode, message.trim(), range);
        }

        LOGGER.warn("Result line did not match expected source annotation format: {}" + line);
        return null;
    }
View Full Code Here

        // assert warnings
        Assert.assertNotNull(actual.getWarnings());
        Assert.assertEquals(3, actual.getWarnings().length);

        final SourceAnnotation warning1 = actual.getWarnings()[0];
        Assert.assertNotNull(warning1);
        Assert.assertEquals(WARNING_MESSAGE, warning1.getMessage());
        Assert.assertEquals(AstResult.WarningCode.EmptyDefinitionWarning.getWarningCode(), warning1.getCode());
        Assert.assertNotNull(warning1.getLocation());
        Assert.assertEquals(641, warning1.getLocation().getLocation());
        Assert.assertEquals(34, warning1.getLocation().getLength());

        final SourceAnnotation warning2 = actual.getWarnings()[1];
        Assert.assertNotNull(warning2);
        Assert.assertEquals(WARNING_MESSAGE, warning2.getMessage());
        Assert.assertEquals(AstResult.WarningCode.IgnoringWarning.getWarningCode(), warning2.getCode());
        Assert.assertNotNull(warning2.getLocation());
        Assert.assertEquals(642, warning2.getLocation().getLocation());
        Assert.assertEquals(35, warning2.getLocation().getLength());

        final SourceAnnotation warning3 = actual.getWarnings()[2];
        Assert.assertNotNull(warning3);
        Assert.assertEquals(WARNING_MESSAGE, warning3.getMessage());
        Assert.assertEquals(AstResult.WarningCode.RedefinitionWarning.getWarningCode(), warning3.getCode());
        Assert.assertNotNull(warning3.getLocation());
        Assert.assertEquals(643, warning3.getLocation().getLocation());
        Assert.assertEquals(36, warning3.getLocation().getLength());
    }
View Full Code Here

TOP

Related Classes of com.gatehill.apib.parser.model.result.SourceAnnotation

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.