This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/main by this push:
new 4d2a2661a1 Fix `log4j-osgi-test` tests (#2621)
4d2a2661a1 is described below
commit 4d2a2661a12a35a605d2d1209dbd97049f5b5187
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Tue May 28 09:07:39 2024 +0200
Fix `log4j-osgi-test` tests (#2621)
---
.../log4j/osgi/tests/AbstractLoadBundleTest.java | 39 ----------------------
.../logging/log4j/osgi/tests/CoreOsgiTest.java | 1 -
2 files changed, 40 deletions(-)
diff --git
a/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
b/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
index 5a957cda94..6f7d4510f7 100644
---
a/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
+++
b/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
@@ -19,7 +19,6 @@ package org.apache.logging.log4j.osgi.tests;
import static org.junit.Assert.assertEquals;
import java.util.List;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -88,10 +87,6 @@ abstract class AbstractLoadBundleTest {
return installBundle("org.apache.logging.log4j.core");
}
- private Bundle get12ApiBundle() throws BundleException {
- return installBundle("org.apache.logging.log4j.1.2.api");
- }
-
private Bundle getApiTestsBundle() throws BundleException {
return installBundle("org.apache.logging.log4j.api.test");
}
@@ -162,40 +157,6 @@ abstract class AbstractLoadBundleTest {
uninstall(spiFly);
}
- /**
- * Tests the loading of the 1.2 Compatibility API bundle, its classes
should be loadable from the Core bundle,
- * and the class loader should be the same between a class from core and a
class from compat
- */
- @Test
- public void testLog4J12Fragement() throws BundleException,
ReflectiveOperationException {
-
- final List<Bundle> spiFly = startApacheSpiFly();
- final Bundle api = getApiBundle();
- final Bundle kit = getKitBundle();
- final Bundle plugins = getPluginsBundle();
- final Bundle core = getCoreBundle();
- final Bundle compat = get12ApiBundle();
-
- doOnBundlesAndVerifyState(Bundle::start, Bundle.ACTIVE, api, kit,
plugins, core);
-
- final Class<?> coreClassFromCore =
core.loadClass("org.apache.logging.log4j.core.Core");
- final Class<?> levelClassFrom12API =
core.loadClass("org.apache.log4j.Level");
- final Class<?> levelClassFromAPI =
core.loadClass("org.apache.logging.log4j.Level");
-
- assertEquals(
- "expected 1.2 API Level to have the same class loader as Core",
- levelClassFrom12API.getClassLoader(),
- coreClassFromCore.getClassLoader());
- Assert.assertNotEquals(
- "expected 1.2 API Level NOT to have the same class loader as
API Level",
- levelClassFrom12API.getClassLoader(),
- levelClassFromAPI.getClassLoader());
-
- doOnBundlesAndVerifyState(Bundle::stop, Bundle.RESOLVED, core,
plugins, kit, api);
- doOnBundlesAndVerifyState(Bundle::uninstall, Bundle.UNINSTALLED,
compat, core, plugins, kit, api);
- uninstall(spiFly);
- }
-
private static void doOnBundlesAndVerifyState(
final ThrowingConsumer<Bundle> operation, final int expectedState,
final Bundle... bundles) {
for (final Bundle bundle : bundles) {
diff --git
a/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/CoreOsgiTest.java
b/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/CoreOsgiTest.java
index 12f273cc58..709c3fffa9 100644
---
a/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/CoreOsgiTest.java
+++
b/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/CoreOsgiTest.java
@@ -50,7 +50,6 @@ public class CoreOsgiTest {
linkBundle("org.apache.logging.log4j.plugins"),
linkBundle("org.apache.logging.log4j.kit"),
linkBundle("org.apache.logging.log4j.core"),
- linkBundle("org.apache.logging.log4j.1.2.api").start(false),
// required by Pax Exam's logging
linkBundle("org.objectweb.asm"),
linkBundle("org.objectweb.asm.commons"),