You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pa...@apache.org on 2020/09/07 10:42:44 UTC
[felix-dev] branch master updated: Improve a test case
This is an automated email from the ASF dual-hosted git repository.
pauls pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git
The following commit(s) were added to refs/heads/master by this push:
new 80ac5ea Improve a test case
80ac5ea is described below
commit 80ac5ea77b1935058b4408e34d162ca2cd59bad4
Author: Karl Pauls <kp...@adobe.com>
AuthorDate: Mon Sep 7 12:42:29 2020 +0200
Improve a test case
---
.../test/java/org/apache/felix/framework/ResourceLoadingTest.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/framework/src/test/java/org/apache/felix/framework/ResourceLoadingTest.java b/framework/src/test/java/org/apache/felix/framework/ResourceLoadingTest.java
index dab3ecd..c9db286 100644
--- a/framework/src/test/java/org/apache/felix/framework/ResourceLoadingTest.java
+++ b/framework/src/test/java/org/apache/felix/framework/ResourceLoadingTest.java
@@ -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