1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * 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 libcore.test.reasons; 18 19 /** 20 * Reasons for {@link libcore.test.annotation.NonCts}. 21 */ 22 public class NonCtsReasons { 23 24 /** 25 * Internal APIs are not required to be tested in CTS. Even worse, it stops customization / 26 * method signature change even though they are internal APIs. 27 * 28 * Libcore's tests by default uses these internal APIs to verify the result. 29 * 30 * Occasionally, unit test for internal APIs are put into the CTS. This is the reason why 31 * you want to annotate the test with {@link libcore.test.annotation.NonCts}. 32 */ 33 public static final String INTERNAL_APIS = "Test for internal APIs."; 34 35 /** 36 * Some libcore's tests for i18n APIs, java.text, depends on locales and CLDR locale-specific 37 * data. However, the data is not stable, and usage changes over time, but the test often 38 * asserts the localized output. 39 * 40 * We don't want to stop customization or improvement of these data. This is the reason why 41 * you want to annotate the test with {@link libcore.test.annotation.NonCts}. 42 */ 43 public static final String CLDR_DATA_DEPENDENCY = "The test depends on locale, but " 44 + "manufacturers / CLDR improves the locale data over time."; 45 46 /** 47 * If a bug has been fixed, and the fix doesn't change the API contract, 48 * you can annotate the test with {@link libcore.test.annotation.NonCts} and this reason. 49 * 50 * This is mainly needed to fix a bug in an ART / Conscrypt / Time Zone module version 51 * and skip this test. 52 * 53 * Note that you still need a test for the basic API behavior, because every public API 54 * needs to be tested in CTS. 55 */ 56 public static final String NON_BREAKING_BEHAVIOR_FIX = "The test asserts buggy or non-breaking " 57 + "behaviors, but the behavior has been fixed in a new mainline module version."; 58 59 NonCtsReasons()60 private NonCtsReasons() {} 61 } 62