-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration tests for diktat-maven-plugin (#607)
### What's done: * Added integration tests via maven-itf for diktat-maven-plugin
- Loading branch information
Showing
4 changed files
with
126 additions
and
6 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
32 changes: 32 additions & 0 deletions
32
...n-plugin/src/test/kotlin/org/cqfn/diktat/plugin/maven/DiktatMavenPluginIntegrationTest.kt
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,32 @@ | ||
package org.cqfn.diktat.plugin.maven | ||
|
||
import com.soebes.itf.jupiter.extension.MavenGoal | ||
import com.soebes.itf.jupiter.extension.MavenJupiterExtension | ||
import com.soebes.itf.jupiter.extension.MavenTest | ||
import com.soebes.itf.jupiter.maven.MavenExecutionResult | ||
import org.junit.jupiter.api.Assertions | ||
import kotlin.io.path.ExperimentalPathApi | ||
import kotlin.io.path.readText | ||
|
||
/** | ||
* Integration tests for diktat-maven-plugin. | ||
* Run against the project from diktat-examples. | ||
* Note: for maven itf test name should equal example project's directory name, which we have in pom.xml. | ||
*/ | ||
@OptIn(ExperimentalPathApi::class) | ||
@MavenJupiterExtension | ||
class DiktatMavenPluginIntegrationTest { | ||
@MavenTest | ||
@MavenGoal("diktat:check@diktat") | ||
fun maven(result: MavenExecutionResult) { | ||
Assertions.assertEquals(1, result.returnCode) | ||
Assertions.assertFalse(result.isError) | ||
Assertions.assertFalse(result.isSuccesful) | ||
Assertions.assertTrue(result.isFailure) | ||
|
||
val mavenLog = result.mavenLog.stdout.readText() | ||
Assertions.assertTrue( | ||
mavenLog.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]") | ||
) | ||
} | ||
} |
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
c73048a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base and submit them to GitHub. If you think that it's a bug on our side, please submit it to yegor256/0pdd:
Please, copy and paste this stack trace to GitHub: