Skip to content

Commit

Permalink
upgrade to gradle 4.1 and junit5-M4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schäfer committed Aug 20, 2017
1 parent 4040c23 commit 3993d1a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
16 changes: 8 additions & 8 deletions build.gradle
Expand Up @@ -12,9 +12,8 @@ buildscript {
}

plugins {
id "com.gradle.build-scan" version "1.2"
id 'com.github.ben-manes.versions' version '0.14.0'
id "org.sonarqube" version "2.0.1"
id "org.sonarqube" version "2.5"
id "ru.vyarus.animalsniffer" version "1.3.0"
}

Expand All @@ -26,7 +25,7 @@ apply plugin: 'io.codearte.nexus-staging'
description = 'JGiven - BDD in plain Java'

task wrapper(type: Wrapper) {
gradleVersion = '3.3'
gradleVersion = '4.1'
}

allprojects {
Expand Down Expand Up @@ -121,7 +120,7 @@ configure(subprojects.findAll { !it.name.contains("android") }) {
systemProperty 'org.slf4j.simpleLogger.defaultLogLevel', 'warn'
jacoco {
destinationFile = file("${rootProject.projectDir}/build/jacoco/jacocoTest.exec")
classDumpFile = file("${rootProject.projectDir}/build/jacoco/classpathdumps")
classDumpDir = file("${rootProject.projectDir}/build/jacoco/classpathdumps")
}
testLogging {
showStandardStreams = true
Expand Down Expand Up @@ -360,8 +359,9 @@ coveralls.jacocoReportPath = 'build/reports/jacoco/overallJacocoReport/overallJa
coveralls.sourceDirs = ["jgiven-core/src/main/java"]
coveralls.saveAsFile = true

buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
}

//buildScan {
// licenseAgreementUrl = 'https://gradle.com/terms-of-service'
//licenseAgree = 'yes'
//}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
#Fri Apr 28 09:06:19 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
6 changes: 3 additions & 3 deletions gradlew
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
8 changes: 4 additions & 4 deletions jgiven-junit5/build.gradle
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4'
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-RC2'
}
}

Expand Down Expand Up @@ -35,9 +35,9 @@ afterEvaluate {
dependencies {
compile project(':jgiven-core')

compileOnly 'org.junit.jupiter:junit-jupiter-api:5.0.0-M4'
compileOnly 'org.junit.jupiter:junit-jupiter-api:5.0.0-RC2'

testCompile project(':jgiven-html5-report')
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.0.0-M4'
testCompile 'org.junit.platform:junit-platform-runner:1.0.0-M4'
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.0.0-RC2'
testCompile 'org.junit.platform:junit-platform-runner:1.0.0-RC2'
}
Expand Up @@ -15,9 +15,7 @@
import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ContainerExtensionContext;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.TestExtensionContext;
import org.junit.jupiter.api.extension.TestInstancePostProcessor;
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;

Expand Down Expand Up @@ -56,7 +54,7 @@ public class JGivenExtension implements
private static final String REPORT_MODEL = "report-model";

@Override
public void beforeAll( ContainerExtensionContext context ) throws Exception {
public void beforeAll( ExtensionContext context ) throws Exception {
ReportModel reportModel = new ReportModel();
reportModel.setTestClass( context.getTestClass().get() );
if( !context.getDisplayName().equals( context.getTestClass().get().getSimpleName() ) ) {
Expand All @@ -71,24 +69,24 @@ public void beforeAll( ContainerExtensionContext context ) throws Exception {
}

@Override
public void afterAll( ContainerExtensionContext context ) throws Exception {
public void afterAll( ExtensionContext context ) throws Exception {
new CommonReportHelper().finishReport( (ReportModel) context.getStore( NAMESPACE ).get( REPORT_MODEL ) );
}

@Override
public void beforeEach( TestExtensionContext context ) throws Exception {
public void beforeEach( ExtensionContext context ) throws Exception {
List<NamedArgument> args = new ArrayList<NamedArgument>();
getScenario().startScenario( context.getTestClass().get(), context.getTestMethod().get(), args );

}

@Override
public void afterEach( TestExtensionContext context ) throws Exception {
public void afterEach( ExtensionContext context ) throws Exception {

ScenarioBase scenario = getScenario();
try {
if( context.getTestException().isPresent() ) {
scenario.getExecutor().failed( context.getTestException().get() );
if( context.getExecutionException().isPresent() ) {
scenario.getExecutor().failed( context.getExecutionException().get() );
}
scenario.finished();

Expand Down

0 comments on commit 3993d1a

Please sign in to comment.