Home | History | Annotate | Download | only in charset
      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 
     17 package org.apache.harmony.tests.java.nio.charset;
     18 
     19 /**
     20  * Test UTF-16BE.
     21  */
     22 public class UTF16BECharsetTest extends AbstractCharsetTestCase {
     23 
     24 	/**
     25 	 * Constructor.
     26 	 */
     27 	public UTF16BECharsetTest(String arg0) {
     28 		super(arg0, "UTF-16BE", new String[] { "X-UTF-16BE", "UTF_16BE" },
     29 				true, true); // "ISO-10646-UCS-2"
     30 	}
     31 
     32 	/*
     33 	 * (non-Javadoc)
     34 	 *
     35 	 * @see tests.api.java.nio.charset.ConcreteCharsetTest#testEncode_Normal()
     36 	 */
     37 	public void testEncode_Normal() {
     38 		String input = "ab\u5D14\u654F";
     39 		byte[] output = new byte[] { 0, 97, 0, 98, 93, 20, 101, 79 };
     40 		internalTestEncode(input, output);
     41 	}
     42 
     43 	/*
     44 	 * (non-Javadoc)
     45 	 *
     46 	 * @see tests.api.java.nio.charset.ConcreteCharsetTest#testDecode_Normal()
     47 	 */
     48 	public void testDecode_Normal() {
     49 		byte[] input = new byte[] { 0, 97, 0, 98, 93, 20, 101, 79 };
     50 		char[] output = "ab\u5D14\u654F".toCharArray();
     51 		internalTestDecode(input, output);
     52 	}
     53 }
     54