This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order to reproduce #199, added kotlin-kapt to all kotlin test proj…
…ects. Added special configuration-only tests that also include kotlin projects even when the tool is Kotlin only.
- Loading branch information
1 parent
4d286a9
commit 239a29e
Showing
10 changed files
with
162 additions
and
49 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...t/groovy/com/novoda/staticanalysis/internal/checkstyle/CheckstyleConfigurationTest.groovy
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.novoda.staticanalysis.internal.checkstyle | ||
|
||
import com.novoda.test.Fixtures | ||
import com.novoda.test.TestProjectRule | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.Parameterized | ||
|
||
@RunWith(Parameterized.class) | ||
class CheckstyleConfigurationTest { | ||
|
||
@Parameterized.Parameters(name = "{0}") | ||
static Iterable<TestProjectRule> rules() { | ||
return [ | ||
TestProjectRule.forJavaProject(), | ||
TestProjectRule.forKotlinProject(), | ||
TestProjectRule.forAndroidProject(), | ||
TestProjectRule.forAndroidKotlinProject(), | ||
] | ||
} | ||
|
||
@Rule | ||
public final TestProjectRule projectRule | ||
|
||
CheckstyleConfigurationTest(TestProjectRule projectRule) { | ||
this.projectRule = projectRule | ||
} | ||
|
||
@Test | ||
void shouldConfigureSuccessFully() { | ||
projectRule.newProject() | ||
.withSourceSet('main', Fixtures.Checkstyle.SOURCES_WITH_WARNINGS) | ||
.withToolsConfig("checkstyle { }") | ||
.build('check', '--dry-run') | ||
} | ||
|
||
@Test | ||
void shouldNotFailBuildWhenCheckstyleIsConfiguredMultipleTimes() { | ||
projectRule.newProject() | ||
.withSourceSet('main', Fixtures.Checkstyle.SOURCES_WITH_WARNINGS) | ||
.withToolsConfig(""" | ||
checkstyle { | ||
configFile new File('${Fixtures.Checkstyle.MODULES.path}') | ||
} | ||
checkstyle { | ||
ignoreFailures = false | ||
} | ||
""") | ||
.build('check', '--dry-run') | ||
} | ||
} |
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
52 changes: 52 additions & 0 deletions
52
.../test/groovy/com/novoda/staticanalysis/internal/findbugs/FindbugsConfigurationTest.groovy
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.novoda.staticanalysis.internal.findbugs | ||
|
||
|
||
import com.novoda.test.TestProjectRule | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.Parameterized | ||
|
||
import static com.novoda.test.Fixtures.Findbugs.SOURCES_WITH_LOW_VIOLATION | ||
|
||
@RunWith(Parameterized.class) | ||
class FindbugsConfigurationTest { | ||
|
||
@Parameterized.Parameters(name = "{0}") | ||
static Iterable<TestProjectRule> rules() { | ||
return [ | ||
TestProjectRule.forJavaProject(), | ||
TestProjectRule.forKotlinProject(), | ||
TestProjectRule.forAndroidProject(), | ||
TestProjectRule.forAndroidKotlinProject(), | ||
] | ||
} | ||
|
||
@Rule | ||
public final TestProjectRule projectRule | ||
|
||
FindbugsConfigurationTest(TestProjectRule projectRule) { | ||
this.projectRule = projectRule | ||
} | ||
|
||
@Test | ||
void shouldConfigureSuccessFully() { | ||
projectRule.newProject() | ||
.withSourceSet('main', SOURCES_WITH_LOW_VIOLATION) | ||
.withToolsConfig("findbugs { }") | ||
.build('check', '--dry-run') | ||
} | ||
|
||
@Test | ||
void shouldNotFailBuildWhenFindbugsIsConfiguredMultipleTimes() { | ||
projectRule.newProject() | ||
.withSourceSet('main', SOURCES_WITH_LOW_VIOLATION) | ||
.withToolsConfig(""" | ||
findbugs { } | ||
findbugs { | ||
ignoreFailures = false | ||
} | ||
""") | ||
.build('check', '--dry-run') | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
plugin/src/test/groovy/com/novoda/staticanalysis/internal/pmd/PmdConfigurationTest.groovy
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.novoda.staticanalysis.internal.pmd | ||
|
||
import com.novoda.test.Fixtures | ||
import com.novoda.test.TestProjectRule | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.Parameterized | ||
|
||
@RunWith(Parameterized.class) | ||
class PmdConfigurationTest { | ||
|
||
@Parameterized.Parameters(name = "{0}") | ||
static Iterable<TestProjectRule> rules() { | ||
return [ | ||
TestProjectRule.forJavaProject(), | ||
TestProjectRule.forKotlinProject(), | ||
TestProjectRule.forAndroidProject(), | ||
TestProjectRule.forAndroidKotlinProject(), | ||
] | ||
} | ||
|
||
@Rule | ||
public final TestProjectRule projectRule | ||
|
||
PmdConfigurationTest(TestProjectRule projectRule) { | ||
this.projectRule = projectRule | ||
} | ||
|
||
@Test | ||
void shouldConfigureSuccessFully() { | ||
projectRule.newProject() | ||
.withSourceSet('main', Fixtures.Pmd.SOURCES_WITH_PRIORITY_1_VIOLATION) | ||
.withToolsConfig("pmd { }") | ||
.build('check', '--dry-run') | ||
} | ||
|
||
@Test | ||
void shouldNotFailBuildWhenPmdIsConfiguredMultipleTimes() { | ||
projectRule.newProject() | ||
.withSourceSet('main', Fixtures.Pmd.SOURCES_WITH_PRIORITY_1_VIOLATION) | ||
.withToolsConfig(""" | ||
pmd { | ||
} | ||
pmd { | ||
ignoreFailures = false | ||
} | ||
""") | ||
.build('check', '--dry-run') | ||
} | ||
} |
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
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