harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r463152 - /incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
Date Thu, 12 Oct 2006 08:21:11 GMT
Author: smishura
Date: Thu Oct 12 01:21:08 2006
New Revision: 463152

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

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java?view=diff&rev=463152&r1=463151&r2=463152
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
Thu Oct 12 01:21:08 2006
@@ -24,7 +24,6 @@
 
 import java.io.BufferedInputStream;
 import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.security.InvalidAlgorithmParameterException;
@@ -47,6 +46,8 @@
 import java.util.List;
 import java.util.Set;
 
+import tests.support.resource.Support_Resources;
+
 /**
  * java.security.cert test utilities
  * 
@@ -57,9 +58,8 @@
     // Key store type used during testing
     private static final String keyStoreType = "BKS";
     // The file name prefix to load keystore from
-    private static final String keyStoreFileName =
-        org.apache.harmony.security.tests.support.TestUtils.TEST_ROOT +
-        "test." + keyStoreType + ".ks";
+    private static final String keyStoreFileName = "test." + keyStoreType
+            + ".ks";
     //
     // The file name suffixes to load keystore from
     //  *.ks1 - keystore containing untrusted cerificates only
@@ -151,9 +151,8 @@
             KeyStore ks = KeyStore.getInstance(keyStoreType);
             if (initialize) {
                 String fileName = keyStoreFileName + testKeyStoreType;
-                bis = new BufferedInputStream(
-                            new FileInputStream(fileName));
-                ks.load(bis, storepass);
+                ks.load(Support_Resources.getResourceStream(fileName),
+                        storepass);
             }
             return ks;
         } catch (Exception e) {



Mime
View raw message