Skip to content

Commit 40cd805

Browse files
vlsikrmahadevan
authored andcommitted
chore: use pax-logging for osgi tests so it does not require runtime bytecode waving for services
Previously, java services required bytecode waving in the runtime to expose as osgi servies. Now we use pax-logging module so it does it automatically
1 parent 0fdf868 commit 40cd805

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

testng-test-osgi/src/test/java/org/testng/test/osgi/DefaultTestngOsgiOptions.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public static ModifiableCompositeOption defaultTestngOsgiOptions() {
4040
.versionAsInProject(),
4141
systemProperty("logback.configurationFile")
4242
.value(System.getProperty("logback.configurationFile")),
43-
mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
44-
mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
45-
mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject());
43+
mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
44+
mavenBundle("org.ops4j.pax.logging", "pax-logging-logback").versionAsInProject());
4645
}
4746
}

testng-test-osgi/testng-test-osgi-build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,19 @@ dependencies {
3838
testImplementation("org.ops4j.pax.exam:pax-exam-link-mvn:4.14.0")
3939
testImplementation("org.ops4j.pax.url:pax-url-aether:2.6.12")
4040
testImplementation("org.apache.felix:org.apache.felix.framework:7.0.5")
41-
testImplementation("ch.qos.logback:logback-core:1.4.11")
42-
testImplementation("ch.qos.logback:logback-classic:1.4.11")
4341
testRuntimeOnly("org.assertj:assertj-core:3.23.1")
4442
testRuntimeOnly("org.apache.servicemix.bundles:org.apache.servicemix.bundles.aopalliance:1.0_6") {
4543
because("Guice requires org.aopalliance.intercept package in osgi, however, aopalliance:aopalliance has no osgi headers")
4644
}
4745
testRuntimeOnly("com.google.errorprone:error_prone_annotations:2.36.0") {
4846
because("It is needed for Guava, only recent version of error_prone_annotations have osgi headers")
4947
}
48+
testRuntimeOnly("org.ops4j.pax.logging:pax-logging-api:2.2.8") {
49+
because("It will actually be used in osgi for logging")
50+
}
51+
testRuntimeOnly("org.ops4j.pax.logging:pax-logging-logback:2.2.8") {
52+
because("It will actually be used in osgi for logging, basic slf4j+logback is hard to launch in osgi, see https://stackoverflow.com/a/77867804")
53+
}
5054
testRuntimeOnly("org.apache.aries.spifly:org.apache.aries.spifly.dynamic.framework.extension:1.3.7") {
5155
because("slf4j-api 2.0 requires osgi.serviceloader.processor, see https://stackoverflow.com/a/77867804")
5256
}

0 commit comments

Comments
 (0)