Package org.sonar.batch.issue.ignore.pattern

Examples of org.sonar.batch.issue.ignore.pattern.IssuePattern


  }

  @Test
  public void shouldMatchJavaFile() {
    String javaFile = "org.foo.Bar";
    assertThat(new IssuePattern("org.foo.Bar", "*").matchResource(javaFile)).isTrue();
    assertThat(new IssuePattern("org.foo.*", "*").matchResource(javaFile)).isTrue();
    assertThat(new IssuePattern("*Bar", "*").matchResource(javaFile)).isTrue();
    assertThat(new IssuePattern("*", "*").matchResource(javaFile)).isTrue();
    assertThat(new IssuePattern("org.*.?ar", "*").matchResource(javaFile)).isTrue();

    assertThat(new IssuePattern("org.other.Hello", "*").matchResource(javaFile)).isFalse();
    assertThat(new IssuePattern("org.foo.Hello", "*").matchResource(javaFile)).isFalse();
    assertThat(new IssuePattern("org.*.??ar", "*").matchResource(javaFile)).isFalse();
    assertThat(new IssuePattern("org.*.??ar", "*").matchResource(null)).isFalse();
    assertThat(new IssuePattern("org.*.??ar", "*").matchResource("plop")).isFalse();
  }
View Full Code Here

TOP

Related Classes of org.sonar.batch.issue.ignore.pattern.IssuePattern

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.