Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Add integration tests to test JUnit5 support
Browse files Browse the repository at this point in the history
The tests will test the default entry point for JUnit 5 runner.

#160
  • Loading branch information
extsoft committed Oct 31, 2019
1 parent ee7cd0d commit b35e836
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 1 deletion.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ project(':sunshine-junit5') {
}
}

project(':sunshine-junit5-integration-tests') {
dependencies {
compile project(':sunshine-junit5')
}
}

defaultTasks 'clean', 'ready'

//task to write the version parameter given via command line into the "gradle.properties" files.
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ rootProject.name = 'sunshine'
include 'sunshine-core-deps', 'sunshine-core'
include 'sunshine-testng', 'sunshine-testng-integration-tests'
include 'sunshine-junit4', 'sunshine-junit4-integration-tests'
include 'sunshine-junit5'
include 'sunshine-junit5', 'sunshine-junit5-integration-tests'
52 changes: 52 additions & 0 deletions sunshine-junit5-integration-tests/build.gradle
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.")
}
}
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() {
}
}
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;

0 comments on commit b35e836

Please sign in to comment.