test/java/util/Base64/TestBase64Golden.java

Print this page

        

*** 38,50 **** import java.util.Base64.Decoder; import java.util.Base64.Encoder; import java.util.Objects; import java.util.Random; - import sun.misc.BASE64Decoder; - import sun.misc.BASE64Encoder; - public class TestBase64Golden { public static void main(String[] args) throws Exception { test0(Base64Type.BASIC, Base64.getEncoder(), Base64.getDecoder(), "plain.txt", "baseEncode.txt"); --- 38,47 ----
*** 136,155 **** // test byte[] decode(String) resArr = decoder.decode(encodedStr); assertEqual(resArr, srcArr); - // test compatible with sun.misc.Base64Encoder - if (type == Base64Type.MIME) { - sun.misc.BASE64Encoder miscEncoder = new BASE64Encoder(); - sun.misc.BASE64Decoder miscDecoder = new BASE64Decoder(); - resArr = decoder.decode(miscEncoder.encode(srcArr)); - assertEqual(resArr, srcArr); - - resArr = encoder.encode(miscDecoder.decodeBuffer(encodedStr)); - assertEqual(new String(resArr, DEF_CHARSET), encodedStr); - } } } private static void test1() throws Exception { byte[] src = new byte[] { --- 133,142 ----