1 /* 2 * Copyright (C) 2024 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 android.platform.test.annotations; 18 19 import java.lang.annotation.ElementType; 20 import java.lang.annotation.Inherited; 21 import java.lang.annotation.Retention; 22 import java.lang.annotation.RetentionPolicy; 23 import java.lang.annotation.Target; 24 25 /** 26 * Tests marked with this annotation are enabled when running under a Ravenwood test environment. 27 * 28 * A more specific method-level annotation always takes precedence over any class-level 29 * annotation, and an {@link EnabledOnRavenwood} annotation always takes precedence over 30 * an {@link DisabledOnRavenwood} annotation. 31 * 32 * This annotation only takes effect when the containing class has a {@code 33 * RavenwoodRule} or {@code RavenwoodClassRule} configured. Ignoring is accomplished by 34 * throwing an {@code org.junit.AssumptionViolatedException} which test infrastructure treats as 35 * being ignored. 36 * 37 * This annotation has no effect on any other non-Ravenwood test environments. 38 * 39 * @hide 40 */ 41 @Inherited 42 @Target({ElementType.METHOD, ElementType.TYPE}) 43 @Retention(RetentionPolicy.RUNTIME) 44 public @interface EnabledOnRavenwood { 45 } 46