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 tests.api.java.nio.charset; 18 19import java.nio.charset.CodingErrorAction; 20 21import junit.framework.TestCase; 22 23/** 24 * Test class java.nio.charset.CodingErrorAction 25 */ 26public class CodingErrorActionTest extends TestCase { 27 28 /* 29 * @see TestCase#setUp() 30 */ 31 protected void setUp() throws Exception { 32 super.setUp(); 33 } 34 35 /* 36 * @see TestCase#tearDown() 37 */ 38 protected void tearDown() throws Exception { 39 super.tearDown(); 40 } 41 42 /* 43 * Test the constants. 44 */ 45 public void testIGNORE() { 46 assertNotNull(CodingErrorAction.IGNORE); 47 assertNotNull(CodingErrorAction.REPLACE); 48 assertNotNull(CodingErrorAction.REPORT); 49 assertNotSame(CodingErrorAction.IGNORE, CodingErrorAction.REPLACE); 50 assertNotSame(CodingErrorAction.IGNORE, CodingErrorAction.REPORT); 51 assertNotSame(CodingErrorAction.REPLACE, CodingErrorAction.REPORT); 52 } 53 54 /* 55 * Test the method toString(). 56 */ 57 public void testToString() { 58 assertTrue(CodingErrorAction.IGNORE.toString().indexOf("IGNORE") != -1); 59 assertTrue(CodingErrorAction.REPLACE.toString().indexOf("REPLACE") != -1); 60 assertTrue(CodingErrorAction.REPORT.toString().indexOf("REPORT") != -1); 61 } 62} 63