harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r463151 - /incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java
Date Thu, 12 Oct 2006 08:13:23 GMT
Author: smishura
Date: Thu Oct 12 01:13:22 2006
New Revision: 463151

URL: http://svn.apache.org/viewvc?view=rev&rev=463151
Log:
Get resources for testing from classpath

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java?view=diff&rev=463151&r1=463150&r2=463151
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java
Thu Oct 12 01:13:22 2006
@@ -34,6 +34,8 @@
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 import org.apache.harmony.security.tests.support.TestUtils;
 
+import tests.support.resource.Support_Resources;
+
 
 /**
  * Tests for <code>Provider</code> constructor and methods
@@ -54,20 +56,10 @@
     /*
      * Class under test for void load(InputStream)
      */
-    public final void testLoadInputStream() {
-        FileInputStream fis = null;
-        String fileName = SpiEngUtils.getFileName(TestUtils.TEST_ROOT,
-                "java/security/Provider.prop.dat");
-        try {
-            fis = new FileInputStream(fileName);
-        } catch (FileNotFoundException e) {
-            fail(e.toString());
-        }
-        try {
-            p.load(fis);    
-        } catch (IOException e) {
-            fail(e.toString());
-        }
+    public final void testLoadInputStream() throws IOException {
+
+        p.load(Support_Resources
+                .getResourceStream("java/security/Provider.prop.dat"));    
 
         if (!"value 1".equals(p.getProperty("Property 1").trim()) ||
                 !"className".equals(p.getProperty("serviceName.algName").trim()) ||    



Mime
View raw message