1/* Licensed to the Apache Software Foundation (ASF) under one or more 2 * contributor license agreements. See the NOTICE file distributed with 3 * this work for additional information regarding copyright ownership. 4 * The ASF licenses this file to You under the Apache License, Version 2.0 5 * (the "License"); you may not use this file except in compliance with 6 * the License. You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package org.apache.harmony.tests.java.nio.charset; 18 19/** 20 * Test ISO-8859-1. 21 */ 22public class ISOCharsetTest extends AbstractCharsetTestCase { 23 24 /** 25 * Constructor. 26 */ 27 public ISOCharsetTest(String arg0) { 28 super(arg0, "ISO-8859-1", new String[] { "iso-ir-100", "8859_1", 29 "ISO_8859-1", "ISO8859_1", "819", "csISOLatin1", "IBM-819", 30 "ISO_8859-1:1987", "latin1", "cp819", "ISO8859-1", "IBM819", 31 "ISO_8859_1", "l1" }, true, true); 32 } 33 34 /* 35 * (non-Javadoc) 36 * 37 * @see tests.api.java.nio.charset.ConcreteCharsetTest#testEncode_Normal() 38 */ 39 public void testEncode_Normal() { 40 String input = "ab\u5D14\u654F"; 41 byte[] output = new byte[] { 97, 98, 42 this.testingCharset.newEncoder().replacement()[0], 43 this.testingCharset.newEncoder().replacement()[0] }; 44 internalTestEncode(input, output); 45 } 46 47 /* 48 * (non-Javadoc) 49 * 50 * @see tests.api.java.nio.charset.ConcreteCharsetTest#testDecode_Normal() 51 */ 52 public void testDecode_Normal() { 53 byte[] input = new byte[] { 97, 98, 63, 63 }; 54 char[] output = "ab??".toCharArray(); 55 internalTestDecode(input, output); 56 } 57 58} 59