harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r776008 - in /harmony/enhanced/classlib/trunk/modules/security/src/test: impl/java/org/apache/harmony/security/tests/provider/crypto/ support/common/java/org/apache/harmony/security/tests/support/provider/cert/
Date Mon, 18 May 2009 17:04:40 GMT
Author: odeakin
Date: Mon May 18 17:04:39 2009
New Revision: 776008

URL: http://svn.apache.org/viewvc?rev=776008&view=rev
Log:
Ensure test data remains in a comparable character set.

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/crypto/SHA1ImplTest.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/provider/cert/CertFactoryTestData.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/crypto/SHA1ImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/crypto/SHA1ImplTest.java?rev=776008&r1=776007&r2=776008&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/crypto/SHA1ImplTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/crypto/SHA1ImplTest.java
Mon May 18 17:04:39 2009
@@ -19,6 +19,8 @@
 package org.apache.harmony.security.tests.provider.crypto;
 
 
+import java.io.UnsupportedEncodingException;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -99,13 +101,13 @@
      * The test checks out that SHA1Impl computes correct value
      * if data supplied takes exactly fourteen words of sixteen word buffer.
      */
-    public final void testMultiBlockMessage() {
+    public final void testMultiBlockMessage() throws UnsupportedEncodingException {
 
         // values defined in examples in Secure Hash Standard
         int[] hash  = {0x84983e44, 0x1c3bd26e, 0xbaae4aa1, 0xf95129e5, 0xe54670f1 };
 
         // string defined in examples in Secure Hash Standard
-        md.update("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq".getBytes());
+        md.update("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq".getBytes("UTF-8"));
         byte[] dgst = md.digest();
 
         for ( int k = 0; k < 5; k++ ) {

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/provider/cert/CertFactoryTestData.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/provider/cert/CertFactoryTestData.java?rev=776008&r1=776007&r2=776008&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/provider/cert/CertFactoryTestData.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/provider/cert/CertFactoryTestData.java
Mon May 18 17:04:39 2009
@@ -22,6 +22,8 @@
 
 package org.apache.harmony.security.tests.support.provider.cert;
 
+import java.io.UnsupportedEncodingException;
+
 import org.apache.harmony.luni.util.Base64;
 
 /**
@@ -293,28 +295,28 @@
         "-----END X509 CRL-----\n";
 
     
-    public static byte[] getCertPathPKCS7Encoding() {
-        return Base64.decode(certPathPKCS7Base64.getBytes());
+    public static byte[] getCertPathPKCS7Encoding() throws UnsupportedEncodingException {
+        return Base64.decode(certPathPKCS7Base64.getBytes("UTF-8"));
     }
 
-    public static byte[] getCertPathPkiPathEncoding() {
-        return Base64.decode(certPathPkiPathBase64.getBytes());
+    public static byte[] getCertPathPkiPathEncoding() throws UnsupportedEncodingException
{
+        return Base64.decode(certPathPkiPathBase64.getBytes("UTF-8"));
     }
 
-    public static byte[] getCertEncoding() {
-        return Base64.decode(certEncodingBase64.getBytes());
+    public static byte[] getCertEncoding() throws UnsupportedEncodingException {
+        return Base64.decode(certEncodingBase64.getBytes("UTF-8"));
     }
 
-    public static byte[] getBase64CertEncoding() {
-        return base64certEncoding.getBytes();
+    public static byte[] getBase64CertEncoding() throws UnsupportedEncodingException {
+        return base64certEncoding.getBytes("UTF-8");
     }
 
-    public static byte[] getBase64CRLEncoding() {
-        return crlEncodingPEM.getBytes();
+    public static byte[] getBase64CRLEncoding() throws UnsupportedEncodingException {
+        return crlEncodingPEM.getBytes("UTF-8");
     }
 
-    public static byte[] getCRLEncoding() {
-        return Base64.decode(crlEncodingBase64.getBytes());
+    public static byte[] getCRLEncoding() throws UnsupportedEncodingException {
+        return Base64.decode(crlEncodingBase64.getBytes("UTF-8"));
     }
 }
 



Mime
View raw message