Package org.apache.maven.model

Examples of org.apache.maven.model.InputLocation


  }
 
  @Test
  public void shouldFindSuppressionInMultiLineComment() {
    Assert.assertEquals("<!-- foo\n      NOLINT:IDENTIFIER\n      shouldFindSuppressionInMultiLineComment\n      bar -->",
        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE, DUMMY_MESSAGE, new InputLocation(25, 16, source))));
  }
View Full Code Here


  }
 
  @Test
  public void shouldFindSuppressionInMultiLineCommentStartingOnNextLine() {
    Assert.assertEquals("<!-- foo\n      NOLINT:IDENTIFIER\n      shouldFindSuppressionInMultiLineCommentStartingOnNextLine\n      bar -->",
        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE, DUMMY_MESSAGE, new InputLocation(29, 19, source))));
  }
View Full Code Here

  }
 
  @Test
  public void shouldFindMultipleSuppressionsInSingleComment() {
    Assert.assertEquals("<!-- NOLINT:RULEID1 NOLINT:RULEID2 shouldFindMultipleSuppressionsInSingleComment -->",
        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE1, DUMMY_MESSAGE, new InputLocation(34, 16, source))));
    Assert.assertEquals("<!-- NOLINT:RULEID1 NOLINT:RULEID2 shouldFindMultipleSuppressionsInSingleComment -->",
        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE2, DUMMY_MESSAGE, new InputLocation(34, 16, source))));
  }
View Full Code Here

  }
 
  @Test
  public void shouldFindMultipleSuppressionsInMultiLineComment() {
    Assert.assertEquals("<!-- NOLINT:RuleID1\n      NOLINT:RuleID2\n      shouldFindMultipleSuppressionsInMultiLineComment -->",
        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE1, DUMMY_MESSAGE, new InputLocation(37, 16, source))));
    Assert.assertEquals("<!-- NOLINT:RuleID1\n      NOLINT:RuleID2\n      shouldFindMultipleSuppressionsInMultiLineComment -->",
        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE2, DUMMY_MESSAGE, new InputLocation(37, 16, source))));
  }
View Full Code Here

  }
 
  @Test
  public void shouldFindMultipleSuppressionsInMultipleComments() {
    Assert.assertEquals("<!-- NOLINT:RuleId1 -->",
        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE1, DUMMY_MESSAGE, new InputLocation(40, 19, source))));
    Assert.assertEquals("<!-- NOLINT:RuleId2 shouldFindMultipleSuppressionsInMultipleComments -->",
        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE2, DUMMY_MESSAGE, new InputLocation(40, 19, source))));
  }
View Full Code Here

        violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE2, DUMMY_MESSAGE, new InputLocation(40, 19, source))));
  }
 
  @Test
  public void shouldNotFindSuppressionAfterTooManyClosingTags() {
    Assert.assertNull(violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE, DUMMY_MESSAGE, new InputLocation(44, 16, source))));
 
View Full Code Here

    Assert.assertNull(violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE, DUMMY_MESSAGE, new InputLocation(44, 16, source))));
 
 
  @Test
  public void shouldNotFindSuppressionBeforeViolation() {
    Assert.assertNull(violationSuppressor.findSuppressionComment(new Violation(DUMMY_MAVEN_PROJECT, RULE, DUMMY_MESSAGE, new InputLocation(50, 19, source))));
  }
View Full Code Here

   
    writer.startNode("description");
    writer.setValue(violation.getRule().getDescription());
    writer.endNode();
   
    final InputLocation location = violation.getInputLocation();
   
    writer.startNode("location");
    writer.addAttribute("file", location.getSource().getLocation());
    writer.addAttribute("line", Integer.toString(location.getLineNumber()));
    writer.addAttribute("column", Integer.toString(location.getColumnNumber()));
    writer.endNode();
   
    writer.endNode();
  }
View Full Code Here

            .setMessage( buffer.toString() ).setLocation( getLocation( fieldName, tracker ) ) );
    }

    private static InputLocation getLocation( String fieldName, InputLocationTracker tracker )
    {
        InputLocation location = null;

        if ( tracker != null )
        {
            if ( fieldName != null )
            {
View Full Code Here

        for ( String key : versions.keySet() )
        {
            if ( versions.get( key ) == null && managedVersions.get( key ) == null )
            {
                InputLocation location = plugins.get( key ).getLocation( "" );
                problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V20 )
                        .setMessage( "'build.plugins.plugin.version' for " + key + " is missing." )
                        .setLocation( location ) );
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.model.InputLocation

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.