Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Java LTS versions #536

Merged
merged 5 commits into from Mar 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 46 additions & 0 deletions lib/build.gradle
Expand Up @@ -55,6 +55,10 @@ dependencies {
testImplementation 'org.mockito:mockito-core:2.18.3'
}

jacoco {
toolVersion = "0.8.7"
}

jacocoTestReport {
reports {
xml.enabled = true
Expand Down Expand Up @@ -87,6 +91,48 @@ task compileModuleInfoJava(type: JavaCompile) {
}
}

compileTestJava {
options.compilerArgs = ['--release', "8"]
}

def testJava8 = tasks.register('testJava8', Test) {
description = 'Runs unit tests on Java 8.'
group = 'verification'

javaLauncher.set(javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(8)
})
shouldRunAfter(tasks.named('test'))
}

def testJava17 = tasks.register('testJava17', Test) {
description = 'Runs unit tests on Java 17.'
group = 'verification'

javaLauncher.set(javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
})
shouldRunAfter(tasks.named('test'))

//Following Tests are excluded in Java 17 since secp256k1 curve is disabled Java 15+
filter {
excludeTestsMatching "*.jwt.ConcurrentVerifyTest.shouldPassECDSA256KVerificationWithJOSESignature"
excludeTestsMatching "*.jwt.JWTCreatorTest.shouldAddKeyIdIfAvailableFromECDSAKAlgorithms"
excludeTestsMatching "*.jwt.JWTCreatorTest.shouldNotOverwriteKeyIdIfAddedFromECDSAKAlgorithms"
excludeTestsMatching "*.jwt.JWTTest.shouldCreateAnEmptyECDSA256KSignedToken"
excludeTestsMatching "*.jwt.algorithms.ECDSAAlgorithmTest.shouldPassECDSA256KVerificationWithJOSESignature"
excludeTestsMatching "*.jwt.algorithms.ECDSAAlgorithmTest.shouldPassECDSA256KVerificationWithJOSESignatureWithBothKeys"
excludeTestsMatching "*.jwt.algorithms.ECDSAAlgorithmTest.shouldPassECDSA256KVerificationWithProvidedPublicKey"
excludeTestsMatching "*.jwt.ECDSABouncyCastleProviderTests.shouldPassECDSA256KVerificationWithJOSESignatureWithBothKeys"
excludeTestsMatching "*.jwt.ECDSABouncyCastleProviderTests.shouldPassECDSA256KVerificationWithProvidedPublicKey"
}
}

tasks.named('check') {
dependsOn(testJava8)
dependsOn(testJava17)
}

jar {
manifest.attributes('Multi-Release': 'true')
}
Expand Down