File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7474
7575configurations {
7676 asciidoctorExt
77+ mockitoAgent
7778}
7879
7980dependencies {
@@ -89,6 +90,10 @@ dependencies {
8990
9091 testImplementation platform(testLibs. mockito. bom)
9192 testImplementation testLibs. bundles. mockito
93+ mockitoAgent platform(testLibs. mockito. bom)
94+ mockitoAgent(testLibs. mockito. core) {
95+ transitive = false
96+ }
9297
9398 testImplementation testLibs. awaitility
9499 // A lot (if not all) tests for jaybird-native are in the main project given dependencies on test infrastructure
@@ -212,6 +217,11 @@ test {
212217 println " Running tests for type ${ project.'test.gds_type'} "
213218 // Use junit platform for unit tests
214219 useJUnitPlatform()
220+ jvmArgumentProviders. add(
221+ objects. newInstance(JavaAgentProvider ). tap {
222+ agent = configurations. mockitoAgent. asPath
223+ }
224+ )
215225
216226 // Test configuration, defaults specified in gradle.properties (modify through ext, or use -P<prop>=<value>)
217227 systemProperties(
Original file line number Diff line number Diff line change 1+ // SPDX-FileCopyrightText: Copyright 2026 Mark Rotteveel
2+ // SPDX-License-Identifier: LGPL-2.1-or-later
3+ plugins {
4+ id ' groovy-gradle-plugin'
5+ }
6+
7+ repositories {
8+ gradlePluginPortal()
9+ }
Original file line number Diff line number Diff line change 1+ // SPDX-FileCopyrightText: Copyright 2026 Mark Rotteveel
2+ // SPDX-License-Identifier: LGPL-2.1-or-later
3+ import org.gradle.api.provider.Property
4+ import org.gradle.api.tasks.InputFile
5+ import org.gradle.api.tasks.PathSensitive
6+ import org.gradle.api.tasks.PathSensitivity
7+ import org.gradle.process.CommandLineArgumentProvider
8+
9+ /**
10+ * Provider for {@code -javaagent:some.jar } command line arguments.
11+ */
12+ abstract class JavaAgentProvider implements CommandLineArgumentProvider {
13+
14+ @InputFile
15+ @PathSensitive (PathSensitivity .RELATIVE )
16+ abstract Property<String > getAgent ()
17+
18+ @Override
19+ Iterable<String > asArguments () {
20+ [" -javaagent:${ agent.get()} " ]
21+ }
22+
23+ }
You can’t perform that action at this time.
0 commit comments