8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 @bug 6636323 6636319 7040220 7096080 7183053
26 @summary Test if StringCoding and NIO result have the same de/encoding result
27 * @run main/othervm/timeout=2000 TestStringCoding
28 */
29
30 import java.util.*;
31 import java.nio.*;
32 import java.nio.charset.*;
33
34 public class TestStringCoding {
35 public static void main(String[] args) throws Throwable {
36
37 for (Boolean hasSM: new boolean[] { false, true }) {
38 if (hasSM)
39 System.setSecurityManager(new PermissiveSecurityManger());
40 for (Charset cs: Charset.availableCharsets().values()) {
41 if ("ISO-2022-CN".equals(cs.name()) ||
42 "x-COMPOUND_TEXT".equals(cs.name()) ||
43 "x-JISAutoDetect".equals(cs.name()))
44 continue;
45 System.out.printf("Testing(sm=%b) " + cs.name() + "....", hasSM);
46 // full bmp first
47 char[] bmpCA = new char[0x10000];
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 @bug 6636323 6636319 7040220 7096080 7183053
26 @summary Test if StringCoding and NIO result have the same de/encoding result
27 * @run main/othervm/timeout=2000 TestStringCoding
28 * @key randomness
29 */
30
31 import java.util.*;
32 import java.nio.*;
33 import java.nio.charset.*;
34
35 public class TestStringCoding {
36 public static void main(String[] args) throws Throwable {
37
38 for (Boolean hasSM: new boolean[] { false, true }) {
39 if (hasSM)
40 System.setSecurityManager(new PermissiveSecurityManger());
41 for (Charset cs: Charset.availableCharsets().values()) {
42 if ("ISO-2022-CN".equals(cs.name()) ||
43 "x-COMPOUND_TEXT".equals(cs.name()) ||
44 "x-JISAutoDetect".equals(cs.name()))
45 continue;
46 System.out.printf("Testing(sm=%b) " + cs.name() + "....", hasSM);
47 // full bmp first
48 char[] bmpCA = new char[0x10000];
|