Skip to content

Commit 4d2a266

Browse files
committed
Fix log4j-osgi-test tests (#2621)
1 parent 7b0d158 commit 4d2a266

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static org.junit.Assert.assertEquals;
2020

2121
import java.util.List;
22-
import org.junit.Assert;
2322
import org.junit.Before;
2423
import org.junit.Rule;
2524
import org.junit.Test;
@@ -88,10 +87,6 @@ private Bundle getCoreBundle() throws BundleException {
8887
return installBundle("org.apache.logging.log4j.core");
8988
}
9089

91-
private Bundle get12ApiBundle() throws BundleException {
92-
return installBundle("org.apache.logging.log4j.1.2.api");
93-
}
94-
9590
private Bundle getApiTestsBundle() throws BundleException {
9691
return installBundle("org.apache.logging.log4j.api.test");
9792
}
@@ -162,40 +157,6 @@ public void testClassNotFoundErrorLogger() throws BundleException {
162157
uninstall(spiFly);
163158
}
164159

165-
/**
166-
* Tests the loading of the 1.2 Compatibility API bundle, its classes should be loadable from the Core bundle,
167-
* and the class loader should be the same between a class from core and a class from compat
168-
*/
169-
@Test
170-
public void testLog4J12Fragement() throws BundleException, ReflectiveOperationException {
171-
172-
final List<Bundle> spiFly = startApacheSpiFly();
173-
final Bundle api = getApiBundle();
174-
final Bundle kit = getKitBundle();
175-
final Bundle plugins = getPluginsBundle();
176-
final Bundle core = getCoreBundle();
177-
final Bundle compat = get12ApiBundle();
178-
179-
doOnBundlesAndVerifyState(Bundle::start, Bundle.ACTIVE, api, kit, plugins, core);
180-
181-
final Class<?> coreClassFromCore = core.loadClass("org.apache.logging.log4j.core.Core");
182-
final Class<?> levelClassFrom12API = core.loadClass("org.apache.log4j.Level");
183-
final Class<?> levelClassFromAPI = core.loadClass("org.apache.logging.log4j.Level");
184-
185-
assertEquals(
186-
"expected 1.2 API Level to have the same class loader as Core",
187-
levelClassFrom12API.getClassLoader(),
188-
coreClassFromCore.getClassLoader());
189-
Assert.assertNotEquals(
190-
"expected 1.2 API Level NOT to have the same class loader as API Level",
191-
levelClassFrom12API.getClassLoader(),
192-
levelClassFromAPI.getClassLoader());
193-
194-
doOnBundlesAndVerifyState(Bundle::stop, Bundle.RESOLVED, core, plugins, kit, api);
195-
doOnBundlesAndVerifyState(Bundle::uninstall, Bundle.UNINSTALLED, compat, core, plugins, kit, api);
196-
uninstall(spiFly);
197-
}
198-
199160
private static void doOnBundlesAndVerifyState(
200161
final ThrowingConsumer<Bundle> operation, final int expectedState, final Bundle... bundles) {
201162
for (final Bundle bundle : bundles) {

log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/CoreOsgiTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public Option[] config() {
5050
linkBundle("org.apache.logging.log4j.plugins"),
5151
linkBundle("org.apache.logging.log4j.kit"),
5252
linkBundle("org.apache.logging.log4j.core"),
53-
linkBundle("org.apache.logging.log4j.1.2.api").start(false),
5453
// required by Pax Exam's logging
5554
linkBundle("org.objectweb.asm"),
5655
linkBundle("org.objectweb.asm.commons"),

0 commit comments

Comments
 (0)