mirror of
https://gitlab.uni-marburg.de/langbeid/powersort.git
synced 2025-01-21 19:50:35 +01:00
add Mockito
This commit is contained in:
parent
9a6359d576
commit
e631d5161e
@ -18,6 +18,7 @@ repositories {
|
||||
}
|
||||
|
||||
val latestJmhVersion = "1.37"
|
||||
val mockitoAgent = configurations.create("mockitoAgent")
|
||||
|
||||
dependencies {
|
||||
// Use JUnit Jupiter for testing.
|
||||
@ -27,6 +28,11 @@ dependencies {
|
||||
// Required to use the IntelliJ plugin "JMH Java Microbenchmark Harness".
|
||||
// https://stackoverflow.com/a/71286156/6334421
|
||||
jmhAnnotationProcessor("org.openjdk.jmh:jmh-generator-annprocess:$latestJmhVersion")
|
||||
|
||||
// Use Mockito for mocking.
|
||||
// https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#mockito-instrumentation
|
||||
testImplementation(libs.mockito)
|
||||
mockitoAgent(libs.mockito) { isTransitive = false }
|
||||
}
|
||||
|
||||
// Apply a specific Java toolchain to ease working on different environments.
|
||||
@ -60,7 +66,8 @@ tasks.register<JavaExec>("runCbmCompetition") {
|
||||
mainClass = "de.uni_marburg.powersort.benchmark.CbmCompetition"
|
||||
}
|
||||
|
||||
tasks.named<Test>("test") {
|
||||
tasks {
|
||||
test {
|
||||
// Use JUnit Platform for unit tests.
|
||||
useJUnitPlatform()
|
||||
|
||||
@ -70,6 +77,11 @@ tasks.named<Test>("test") {
|
||||
// HTML reports to view with a webbrowser.
|
||||
html.required.set(true)
|
||||
}
|
||||
|
||||
// Mockito JDK21+ config
|
||||
// https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#mockito-instrumentation
|
||||
jvmArgs("-javaagent:${mockitoAgent.asPath}")
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/melix/jmh-gradle-plugin/blob/master/README.adoc#configuration-options
|
||||
|
@ -2,9 +2,9 @@
|
||||
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
|
||||
|
||||
[versions]
|
||||
guava = "32.1.3-jre"
|
||||
junit-jupiter = "5.10.1"
|
||||
junit-jupiter = "5.10.3"
|
||||
mockito = "5.14.0"
|
||||
|
||||
[libraries]
|
||||
guava = { module = "com.google.guava:guava", version.ref = "guava" }
|
||||
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
|
||||
mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user