Search in sources :

Example 1 with BugCollection

use of edu.umd.cs.findbugs.BugCollection in project guava-helper-for-java-8 by KengoTODA.

the class DependencyOnDeprecatedGuavaClassDetectorTest method detectFieldWithInitializationGuava.

@Test
public void detectFieldWithInitializationGuava() {
    spotbugs.addAuxClasspathEntry(Paths.get(System.getProperty("user.home"), ".m2/repository/com/google/guava/guava/21.0/guava-21.0.jar"));
    BugCollection detected = spotbugs.performAnalysis(Paths.get("target", "test-classes", "jp", "skypencil", "guava", "GuavaOptionalFieldWithInitialization.class"));
    assertThat(detected, containsExactly(1, MATCHER));
}
Also used : BugCollection(edu.umd.cs.findbugs.BugCollection) Test(org.junit.Test)

Example 2 with BugCollection

use of edu.umd.cs.findbugs.BugCollection in project guava-helper-for-java-8 by KengoTODA.

the class DependencyOnDeprecatedGuavaClassDetectorTest method detectInvoking.

@Test
public void detectInvoking() {
    spotbugs.addAuxClasspathEntry(Paths.get(System.getProperty("user.home"), ".m2/repository/com/google/guava/guava/21.0/guava-21.0.jar"));
    BugCollection detected = spotbugs.performAnalysis(Paths.get("target", "test-classes", "jp", "skypencil", "guava", "Java8OptionalMethodInvoking.class"));
    assertThat(detected, containsExactly(0, MATCHER));
}
Also used : BugCollection(edu.umd.cs.findbugs.BugCollection) Test(org.junit.Test)

Example 3 with BugCollection

use of edu.umd.cs.findbugs.BugCollection in project guava-helper-for-java-8 by KengoTODA.

the class DependencyOnDeprecatedGuavaClassDetectorTest method detectField.

@Test
public void detectField() {
    spotbugs.addAuxClasspathEntry(Paths.get(System.getProperty("user.home"), ".m2/repository/com/google/guava/guava/21.0/guava-21.0.jar"));
    BugCollection detected = spotbugs.performAnalysis(Paths.get("target", "test-classes", "jp", "skypencil", "guava", "Java8OptionalField.class"));
    assertThat(detected, containsExactly(0, MATCHER));
}
Also used : BugCollection(edu.umd.cs.findbugs.BugCollection) Test(org.junit.Test)

Example 4 with BugCollection

use of edu.umd.cs.findbugs.BugCollection in project guava-helper-for-java-8 by KengoTODA.

the class DependencyOnDeprecatedGuavaClassDetectorTest method detectReturnedTypeInInterfaceGuava.

@Test
public void detectReturnedTypeInInterfaceGuava() {
    spotbugs.addAuxClasspathEntry(Paths.get(System.getProperty("user.home"), ".m2/repository/com/google/guava/guava/21.0/guava-21.0.jar"));
    BugCollection detected = spotbugs.performAnalysis(Paths.get("target", "test-classes", "jp", "skypencil", "guava", "GuavaOptionalInterfaceReturn.class"));
    assertThat(detected, containsExactly(1, MATCHER));
}
Also used : BugCollection(edu.umd.cs.findbugs.BugCollection) Test(org.junit.Test)

Example 5 with BugCollection

use of edu.umd.cs.findbugs.BugCollection in project guava-helper-for-java-8 by KengoTODA.

the class DependencyOnDeprecatedGuavaClassDetectorTest method detectMethodArgument.

@Test
public void detectMethodArgument() {
    spotbugs.addAuxClasspathEntry(Paths.get(System.getProperty("user.home"), ".m2/repository/com/google/guava/guava/21.0/guava-21.0.jar"));
    BugCollection detected = spotbugs.performAnalysis(Paths.get("target", "test-classes", "jp", "skypencil", "guava", "Java8OptionalMethodArgument.class"));
    assertThat(detected, containsExactly(0, MATCHER));
}
Also used : BugCollection(edu.umd.cs.findbugs.BugCollection) Test(org.junit.Test)

Aggregations

BugCollection (edu.umd.cs.findbugs.BugCollection)80 Test (org.junit.Test)69 BugInstanceMatcher (edu.umd.cs.findbugs.test.matcher.BugInstanceMatcher)40 BugInstanceMatcherBuilder (edu.umd.cs.findbugs.test.matcher.BugInstanceMatcherBuilder)40 Path (java.nio.file.Path)35 SortedBugCollection (edu.umd.cs.findbugs.SortedBugCollection)9 Ignore (org.junit.Ignore)7 BugInstance (edu.umd.cs.findbugs.BugInstance)5 AppVersion (edu.umd.cs.findbugs.AppVersion)3 PackageStats (edu.umd.cs.findbugs.PackageStats)2 IOException (java.io.IOException)2 CheckForNull (javax.annotation.CheckForNull)2 CoreException (org.eclipse.core.runtime.CoreException)2 FindBugsJob (de.tobject.findbugs.FindBugsJob)1 AbstractIntegrationTest (edu.umd.cs.findbugs.AbstractIntegrationTest)1 ClassAnnotation (edu.umd.cs.findbugs.ClassAnnotation)1 ClassStats (edu.umd.cs.findbugs.PackageStats.ClassStats)1 Project (edu.umd.cs.findbugs.Project)1 ProjectStats (edu.umd.cs.findbugs.ProjectStats)1 SloppyBugComparator (edu.umd.cs.findbugs.SloppyBugComparator)1