Improve a test case
@@ -34,6 +34,8 @@ import junit.framework.TestCase;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
import org.osgi.framework.launch.Framework;
+import org.osgi.framework.wiring.BundleRevision;
+import org.osgi.framework.wiring.BundleWiring;
public class ResourceLoadingTest extends TestCase
{
@@ -106,6 +108,12 @@ public class ResourceLoadingTest extends TestCase
reader = new BufferedReader(new InputStreamReader(testBundle.getEntry(name).openStream()));
assertEquals("This is a Test", reader.readLine());
+
+ reader = new BufferedReader(new InputStreamReader(testBundle.adapt(BundleWiring.class).getClassLoader().getResourceAsStream(name)));
+ assertEquals("This is a Test", reader.readLine());
+
+ reader = new BufferedReader(new InputStreamReader(testBundle.adapt(BundleWiring.class).getClassLoader().getResource(name).openStream()));
+ assertEquals("This is a Test", reader.readLine());
}
private static void deleteDir(File root) throws IOException
