Skip to content

Commit a7786d8

Browse files
committed
add testSpring3 test suite
1 parent fcef9b4 commit a7786d8

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ configurations {
3131
}
3232
}
3333

34-
tasks {
35-
named<JavaCompile>("compileJavaSpring3Java") {
36-
sourceCompatibility = "17"
37-
targetCompatibility = "17"
38-
options.release.set(17)
39-
}
40-
41-
withType(Jar::class) {
42-
from(sourceSets["javaSpring3"].output)
43-
}
44-
}
45-
4634
dependencies {
4735
compileOnly("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion")
4836
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor:$springBootVersion")
@@ -106,15 +94,15 @@ dependencies {
10694
testImplementation("io.opentelemetry:opentelemetry-exporter-zipkin")
10795
testImplementation(project(":instrumentation-annotations"))
10896

97+
// needed for the Spring Boot 3 support
98+
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
99+
109100
// give access to common classes, e.g. InstrumentationConfigUtil
110101
add("javaSpring3CompileOnly", files(sourceSets.main.get().output.classesDirs))
111102
add("javaSpring3CompileOnly", "org.springframework.boot:spring-boot-starter-web:3.2.4")
112103
add("javaSpring3CompileOnly", "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
113104
add("javaSpring3CompileOnly", project(":instrumentation:spring:spring-web:spring-web-3.1:library"))
114105
add("javaSpring3CompileOnly", project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
115-
116-
// needed for the Spring Boot 3 support
117-
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
118106
}
119107

120108
val latestDepTest = findProperty("testLatestDeps") as Boolean
@@ -151,9 +139,7 @@ testing {
151139
}
152140
}
153141
}
154-
}
155142

156-
suites {
157143
val testLogbackMissing by registering(JvmTestSuite::class) {
158144
dependencies {
159145
implementation(project())
@@ -166,6 +152,27 @@ testing {
166152
}
167153
}
168154
}
155+
156+
val testSpring3 by registering(JvmTestSuite::class) {
157+
dependencies {
158+
implementation(project())
159+
//implementation(sourceSets["javaSpring3"].output)
160+
implementation("org.springframework.boot:spring-boot-starter-web:3.2.4")
161+
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
162+
implementation(project(":instrumentation:spring:spring-web:spring-web-3.1:library"))
163+
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
164+
implementation("jakarta.servlet:jakarta.servlet-api:5.0.0")
165+
implementation("org.springframework.boot:spring-boot-starter-test:3.2.4") {
166+
exclude("org.junit.vintage", "junit-vintage-engine")
167+
}
168+
169+
// implementation("org.slf4j:slf4j-api") {
170+
// version {
171+
// strictly("1.7.32")
172+
// }
173+
// }
174+
}
175+
}
169176
}
170177
}
171178

@@ -191,4 +198,20 @@ tasks {
191198
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
192199
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
193200
}
201+
202+
named<JavaCompile>("compileJavaSpring3Java") {
203+
sourceCompatibility = "17"
204+
targetCompatibility = "17"
205+
options.release.set(17)
206+
}
207+
208+
named<JavaCompile>("compileTestSpring3Java") {
209+
sourceCompatibility = "17"
210+
targetCompatibility = "17"
211+
options.release.set(17)
212+
}
213+
214+
withType(Jar::class) {
215+
from(sourceSets["javaSpring3"].output)
216+
}
194217
}

0 commit comments

Comments
 (0)