|
19 | 19 | import static org.junit.Assert.assertEquals; |
20 | 20 |
|
21 | 21 | import java.util.List; |
22 | | -import org.junit.Assert; |
23 | 22 | import org.junit.Before; |
24 | 23 | import org.junit.Rule; |
25 | 24 | import org.junit.Test; |
@@ -88,10 +87,6 @@ private Bundle getCoreBundle() throws BundleException { |
88 | 87 | return installBundle("org.apache.logging.log4j.core"); |
89 | 88 | } |
90 | 89 |
|
91 | | - private Bundle get12ApiBundle() throws BundleException { |
92 | | - return installBundle("org.apache.logging.log4j.1.2.api"); |
93 | | - } |
94 | | - |
95 | 90 | private Bundle getApiTestsBundle() throws BundleException { |
96 | 91 | return installBundle("org.apache.logging.log4j.api.test"); |
97 | 92 | } |
@@ -162,40 +157,6 @@ public void testClassNotFoundErrorLogger() throws BundleException { |
162 | 157 | uninstall(spiFly); |
163 | 158 | } |
164 | 159 |
|
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 | | - |
199 | 160 | private static void doOnBundlesAndVerifyState( |
200 | 161 | final ThrowingConsumer<Bundle> operation, final int expectedState, final Bundle... bundles) { |
201 | 162 | for (final Bundle bundle : bundles) { |
|
0 commit comments