This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests to test JUnit5 support
The tests will test the default entry point for JUnit 5 runner. #160
- Loading branch information
Showing
5 changed files
with
80 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3' | ||
} | ||
} | ||
|
||
apply plugin: 'com.github.johnrengelman.shadow' | ||
|
||
dependencies { | ||
jar { | ||
manifest { | ||
attributes 'Main-Class': 'org.tatools.sunshine.junit5.Sunshine' | ||
attributes "Class-Path": configurations.runtime.collect { | ||
"deps/" + it.getName() | ||
}.join(' ') | ||
} | ||
} | ||
} | ||
|
||
task storeDependencies(type: Copy) { | ||
into "$buildDir/libs/deps" | ||
from configurations.runtime | ||
} | ||
|
||
build.dependsOn(storeDependencies) | ||
|
||
task runIntegrationTests { Task task -> | ||
doLast { | ||
task.project.exec { | ||
executable "sh" | ||
args "-c", "cd build/libs/ && java -jar ${project.name}-${version}.jar " + | ||
"| grep \"Total tests run: 1, Failures: 0, Skips: 0\"" | ||
} | ||
task.project.exec { | ||
executable "sh" | ||
args "-c", "cd build/libs/ && " + | ||
"java -Dtests-regex=\"(org.tatools.junit5tests)(.+)?\" -jar ${project.name}-${version}-all.jar " + | ||
"| grep \"Total tests run: 1, Failures: 0, Skips: 0\"" | ||
} | ||
} | ||
} | ||
runIntegrationTests.dependsOn(build) | ||
runIntegrationTests.dependsOn(shadowJar) | ||
|
||
task ready(dependsOn: runIntegrationTests) { | ||
doLast { | ||
println("Sunshine Junit5 integration testing is completed.") | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
sunshine-junit5-integration-tests/src/main/java/org/tatools/junit5tests/PassedTest.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.tatools.junit5tests; | ||
|
||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* @author Dmytro Serdiuk | ||
* @version $Id$ | ||
*/ | ||
public class PassedTest { | ||
@Test | ||
public void test() { | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
sunshine-junit5-integration-tests/src/main/java/org/tatools/junit5tests/package-info.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* The package is used to hold the classes for integration testing of the sunshine-junit5. | ||
* | ||
* @author Dmytro Serdiuk | ||
* @version $Id$ | ||
*/ | ||
package org.tatools.junit4tests; |