forked from WorksApplications/findbugs-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- test-driven-detectors4findbugs returned in the POM-File
- Tests using test-driven-detectors4findbugs are commented in, but ignored (!) - the reason for this: - test-driven-detectors4findbugs does not work with FB3.0 - Ignored tests are still better as commented-out ones
- Loading branch information
Showing
13 changed files
with
154 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
src/test/java/jp/co/worksap/oss/findbugs/jpa/ColumnDefinitionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
package jp.co.worksap.oss.findbugs.jpa; | ||
|
||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertBugReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertNoBugsReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.bugReporterForTesting; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.ofType; | ||
|
||
import org.junit.Before; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import edu.umd.cs.findbugs.BugReporter; | ||
|
||
@Ignore("test-driven-detectors4findbugs dependency is removed") | ||
@Ignore("test-driven-detectors4findbugs is not compatible with FB3.0") | ||
public class ColumnDefinitionTest { | ||
|
||
private BugReporter bugReporter; | ||
private ColumnDefinitionDetector detector; | ||
|
||
@Before | ||
public void setup() { | ||
// bugReporter = bugReporterForTesting(); | ||
// detector = new ColumnDefinitionDetector(bugReporter); | ||
bugReporter = bugReporterForTesting(); | ||
detector = new ColumnDefinitionDetector(bugReporter); | ||
} | ||
|
||
@Test | ||
public void testNormalClass() throws Exception { | ||
// assertNoBugsReported(ShortColumnName.class, detector, bugReporter); | ||
assertNoBugsReported(ShortColumnName.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testWithColumnDefinition() throws Exception { | ||
// assertBugReported(UseColumnDefinition.class, detector, bugReporter, ofType("USE_COLUMN_DEFINITION")); | ||
assertBugReported(UseColumnDefinition.class, detector, bugReporter, ofType("USE_COLUMN_DEFINITION")); | ||
} | ||
} |
20 changes: 12 additions & 8 deletions
20
src/test/java/jp/co/worksap/oss/findbugs/jpa/ColumnNameLengthTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,48 @@ | ||
package jp.co.worksap.oss.findbugs.jpa; | ||
|
||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertBugReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertNoBugsReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.bugReporterForTesting; | ||
|
||
import org.junit.Before; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import edu.umd.cs.findbugs.BugReporter; | ||
|
||
@Ignore("test-driven-detectors4findbugs dependency is removed") | ||
@Ignore("test-driven-detectors4findbugs is not compatible with FB3.0") | ||
public class ColumnNameLengthTest { | ||
private BugReporter bugReporter; | ||
private LongColumnNameDetector detector; | ||
|
||
@Before | ||
public void setup() { | ||
// bugReporter = bugReporterForTesting(); | ||
// detector = new LongColumnNameDetector(bugReporter); | ||
bugReporter = bugReporterForTesting(); | ||
detector = new LongColumnNameDetector(bugReporter); | ||
} | ||
|
||
@Test | ||
public void testShortName() throws Exception { | ||
// assertNoBugsReported(ShortColumnName.class, detector, bugReporter); | ||
assertNoBugsReported(ShortColumnName.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testShortNameWithoutAnnotationParameter() throws Exception { | ||
// assertNoBugsReported(ShortColumnNameWithoutAnnotationParameter.class, detector, bugReporter); | ||
assertNoBugsReported(ShortColumnNameWithoutAnnotationParameter.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testLongName() throws Exception { | ||
// assertBugReported(LongColumnName.class, detector, bugReporter); | ||
assertBugReported(LongColumnName.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testLongNameWithoutAnnotationParameter() throws Exception { | ||
// assertBugReported(LongColumnNameWithoutAnnotationParameter.class, detector, bugReporter); | ||
assertBugReported(LongColumnNameWithoutAnnotationParameter.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testLongColumnNameByAnnotatedMethod() throws Exception { | ||
// assertBugReported(LongColumnNameByAnnotatedMethod.class, detector, bugReporter); | ||
assertBugReported(LongColumnNameByAnnotatedMethod.class, detector, bugReporter); | ||
} | ||
} |
30 changes: 16 additions & 14 deletions
30
src/test/java/jp/co/worksap/oss/findbugs/jpa/ImplicitLengthTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,52 @@ | ||
package jp.co.worksap.oss.findbugs.jpa; | ||
|
||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertBugReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertNoBugsReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.bugReporterForTesting; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.ofType; | ||
|
||
import org.junit.Before; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import edu.umd.cs.findbugs.BugReporter; | ||
|
||
@Ignore("test-driven-detectors4findbugs dependency is removed") | ||
@Ignore("test-driven-detectors4findbugs is not compatible with FB3.0") | ||
public class ImplicitLengthTest { | ||
private BugReporter bugReporter; | ||
private ImplicitLengthDetector detector; | ||
|
||
@Before | ||
public void before() { | ||
// this.bugReporter = bugReporterForTesting(); | ||
// this.detector = new ImplicitLengthDetector(bugReporter); | ||
bugReporter = bugReporterForTesting(); | ||
detector = new ImplicitLengthDetector(bugReporter); | ||
} | ||
|
||
@Test | ||
public void testNegativeLength() throws Exception { | ||
// assertBugReported(ColumnWithNegativeLength.class, detector, | ||
// bugReporter, ofType("ILLEGAL_LENGTH")); | ||
assertBugReported(ColumnWithNegativeLength.class, detector, bugReporter, ofType("ILLEGAL_LENGTH")); | ||
} | ||
|
||
@Test | ||
public void testTooLongLength() throws Exception { | ||
// assertBugReported(ColumnWithTooLongLength.class, detector, | ||
// bugReporter, ofType("ILLEGAL_LENGTH")); | ||
// assertBugReported(GetterWithTooLongLength.class, detector, | ||
// bugReporter, ofType("ILLEGAL_LENGTH")); | ||
assertBugReported(ColumnWithTooLongLength.class, detector, bugReporter, ofType("ILLEGAL_LENGTH")); | ||
assertBugReported(GetterWithTooLongLength.class, detector, bugReporter, ofType("ILLEGAL_LENGTH")); | ||
} | ||
|
||
@Test | ||
public void testLongLengthWithLob() throws Exception { | ||
// assertNoBugsReported(ColumnWithLongLengthAndLob.class, detector, bugReporter); | ||
// assertNoBugsReported(GetterWithLongLengthAndLob.class, detector, bugReporter); | ||
assertNoBugsReported(ColumnWithLongLengthAndLob.class, detector, bugReporter); | ||
assertNoBugsReported(GetterWithLongLengthAndLob.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testExplicitLength() throws Exception { | ||
// assertNoBugsReported(ColumnWithLength.class, detector, bugReporter); | ||
assertNoBugsReported(ColumnWithLength.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testImplicitLength() throws Exception { | ||
// assertBugReported(ColumnWithoutElement.class, detector, bugReporter, ofType("IMPLICIT_LENGTH")); | ||
// assertBugReported(GetterWithoutElement.class, detector, bugReporter, ofType("IMPLICIT_LENGTH")); | ||
assertBugReported(ColumnWithoutElement.class, detector, bugReporter, ofType("IMPLICIT_LENGTH")); | ||
assertBugReported(GetterWithoutElement.class, detector, bugReporter, ofType("IMPLICIT_LENGTH")); | ||
} | ||
} |
16 changes: 10 additions & 6 deletions
16
src/test/java/jp/co/worksap/oss/findbugs/jpa/ImplicitNullnessTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
package jp.co.worksap.oss.findbugs.jpa; | ||
|
||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertBugReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertNoBugsReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.bugReporterForTesting; | ||
|
||
import org.junit.Before; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import edu.umd.cs.findbugs.BugReporter; | ||
|
||
@Ignore("test-driven-detectors4findbugs dependency is removed") | ||
@Ignore("test-driven-detectors4findbugs is not compatible with FB3.0") | ||
public class ImplicitNullnessTest { | ||
private BugReporter bugReporter; | ||
private ImplicitNullnessDetector detector; | ||
|
||
@Before | ||
public void before() { | ||
// bugReporter = bugReporterForTesting(); | ||
// detector = new ImplicitNullnessDetector(bugReporter); | ||
bugReporter = bugReporterForTesting(); | ||
detector = new ImplicitNullnessDetector(bugReporter); | ||
} | ||
|
||
@Test | ||
public void testExplicitNullness() throws Exception { | ||
// assertNoBugsReported(ColumnWithNullable.class, detector, bugReporter); | ||
assertNoBugsReported(ColumnWithNullable.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testImplicitNullness() throws Exception { | ||
// assertBugReported(ColumnWithoutElement.class, detector, bugReporter); | ||
// assertBugReported(GetterWithoutElement.class, detector, bugReporter); | ||
assertBugReported(ColumnWithoutElement.class, detector, bugReporter); | ||
assertBugReported(GetterWithoutElement.class, detector, bugReporter); | ||
} | ||
} |
18 changes: 11 additions & 7 deletions
18
src/test/java/jp/co/worksap/oss/findbugs/jpa/IndexNameLengthTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
package jp.co.worksap.oss.findbugs.jpa; | ||
|
||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertBugReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.assertNoBugsReported; | ||
import static com.youdevise.fbplugins.tdd4fb.DetectorAssert.bugReporterForTesting; | ||
|
||
import org.junit.Before; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import edu.umd.cs.findbugs.BugReporter; | ||
|
||
@Ignore("test-driven-detectors4findbugs dependency is removed") | ||
@Ignore("test-driven-detectors4findbugs is not compatible with FB3.0") | ||
public class IndexNameLengthTest { | ||
private BugReporter bugReporter; | ||
private LongIndexNameDetector detector; | ||
|
||
@Before | ||
public void setup() { | ||
// bugReporter = bugReporterForTesting(); | ||
// detector = new LongIndexNameDetector(bugReporter); | ||
bugReporter = bugReporterForTesting(); | ||
detector = new LongIndexNameDetector(bugReporter); | ||
} | ||
|
||
@Test | ||
public void testShortNameWithHibernate() throws Exception { | ||
// assertNoBugsReported(ShortIndexNameForHibernate.class, detector, bugReporter); | ||
assertNoBugsReported(ShortIndexNameForHibernate.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testLongNameWithHibernate() throws Exception { | ||
// assertBugReported(LongIndexNameForHibernate.class, detector, bugReporter); | ||
assertBugReported(LongIndexNameForHibernate.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testShortNameWithOpenJPA() throws Exception { | ||
// assertNoBugsReported(ShortIndexNameForOpenJPA.class, detector, bugReporter); | ||
assertNoBugsReported(ShortIndexNameForOpenJPA.class, detector, bugReporter); | ||
} | ||
|
||
@Test | ||
public void testLongNameWithOpenJPA() throws Exception { | ||
// assertBugReported(LongIndexNameForOpenJPA.class, detector, bugReporter); | ||
assertBugReported(LongIndexNameForOpenJPA.class, detector, bugReporter); | ||
} | ||
} |
Oops, something went wrong.