equal
deleted
inserted
replaced
32 |
32 |
33 import static java.nio.charset.StandardCharsets.US_ASCII; |
33 import static java.nio.charset.StandardCharsets.US_ASCII; |
34 |
34 |
35 /** |
35 /** |
36 * @test |
36 * @test |
37 * @bug 8007799 |
37 * @bug 8007799 8176379 |
38 * @summary test Encoder with linemax == 0, line separator should not appear in encoded data |
38 * @summary test Encoder with linemax == 0, line separator should not appear in encoded data |
39 */ |
39 */ |
40 |
40 |
41 public class Base64GetEncoderTest { |
41 public class Base64GetEncoderTest { |
42 |
42 |
43 public static void main(String args[]) throws Throwable { |
43 public static void main(String args[]) throws Throwable { |
44 final Base64.Encoder encoder = Base64.getMimeEncoder(0, "$$$".getBytes(US_ASCII)); |
|
45 |
44 |
46 testEncodeToString(encoder); |
45 for (int maxlen = -4; maxlen < 4; maxlen++) { |
47 |
46 |
48 testWrapEncode1(encoder); |
47 final Base64.Encoder encoder = Base64.getMimeEncoder(maxlen, "$$$".getBytes(US_ASCII)); |
49 |
48 |
50 testEncodeToStringWithLongInputData(encoder); |
49 testEncodeToString(encoder); |
51 |
50 testWrapEncode1(encoder); |
52 testWrapEncode2(encoder); |
51 testEncodeToStringWithLongInputData(encoder); |
53 |
52 testWrapEncode2(encoder); |
|
53 } |
54 } |
54 } |
55 |
55 |
56 private static void testWrapEncode2(final Base64.Encoder encoder) |
56 private static void testWrapEncode2(final Base64.Encoder encoder) |
57 throws IOException { |
57 throws IOException { |
58 System.err.println("\nEncoder.wrap test II "); |
58 System.err.println("\nEncoder.wrap test II "); |