Skip to content

Commit

Permalink
Better assertion message
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jan 23, 2025
1 parent 25ca5a5 commit f518421
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ public void testCanLoadBundle() {

@Test
public void testProperlyDetectsRunningInsideOsgiEnv() throws Exception {
final Class<?> osgiUtils = loadBundle().loadClass("org.apache.commons.compress.utils.OsgiUtils");
assertNotNull("Can load OsgiUtils via bundle", osgiUtils);
final String className = "org.apache.commons.compress.utils.OsgiUtils";
final Class<?> osgiUtils = loadBundle().loadClass(className);
assertNotNull("Can't load " + className + " via bundle", osgiUtils);
final Method method = osgiUtils.getMethod("isRunningInOsgiEnvironment");
assertNotNull("Can access isRunningInOsgiEnvironment method", method);
assertTrue("Compress detects OSGi environment", (Boolean) method.invoke(null));
assertNotNull("Can't access isRunningInOsgiEnvironment method", method);
assertTrue("Compress can't detect OSGi environment", (Boolean) method.invoke(null));
}
}

0 comments on commit f518421

Please sign in to comment.