harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r400235 - /incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/tests/api/javax/crypto/CipherTest.java
Date Sat, 06 May 2006 04:32:37 GMT
Author: smishura
Date: Fri May  5 21:32:35 2006
New Revision: 400235

URL: http://svn.apache.org/viewcvs?rev=400235&view=rev
Log:
Use Support_Resources utility method instead of private one to load resource files.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/tests/api/javax/crypto/CipherTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/tests/api/javax/crypto/CipherTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/tests/api/javax/crypto/CipherTest.java?rev=400235&r1=400234&r2=400235&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/tests/api/javax/crypto/CipherTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/tests/api/javax/crypto/CipherTest.java
Fri May  5 21:32:35 2006
@@ -34,6 +34,8 @@
 import javax.crypto.spec.DESedeKeySpec;
 import javax.crypto.spec.IvParameterSpec;
 
+import tests.support.resource.Support_Resources;
+
 public class CipherTest extends junit.framework.TestCase {
 
     /**
@@ -380,7 +382,7 @@
             byte[] input = new byte[256];
             String resPath = "hyts_" + "des-ede3-cbc.test" + index
                     + ".ciphertext";
-            InputStream is = getStream(resPath);
+            InputStream is = Support_Resources.getResourceStream(resPath);
 
             int bytesRead = is.read(input, 0, 256);
             while (bytesRead > 0) {
@@ -429,7 +431,7 @@
             byte[] input = new byte[256];
             String resPath = "hyts_" + "des-ede3-cbc.test" + index
                     + ".plaintext";
-            InputStream is = getStream(resPath);
+            InputStream is = Support_Resources.getResourceStream(resPath);
 
             int bytesRead = is.read(input, 0, 256);
             while (bytesRead > 0) {
@@ -455,7 +457,7 @@
 
     private byte[] loadBytes(String resPath) {
         try {
-            InputStream is = getStream(resPath);
+            InputStream is = Support_Resources.getResourceStream(resPath);
 
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             byte[] buff = new byte[1024];
@@ -468,14 +470,5 @@
         } catch (IOException e) {
             return null;
         }
-    }
-
-    public InputStream getStream(String name) {
-
-        InputStream is = ClassLoader.getSystemClassLoader()
-                .getResourceAsStream(name);
-
-        assertNotNull("Failed to load resource: " + name, is);
-        return is;
     }
 }



Mime
View raw message