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 package com.android.ravenwoodtest; 17 18 import android.platform.test.annotations.DisabledOnRavenwood; 19 20 import androidx.test.ext.junit.runners.AndroidJUnit4; 21 22 import org.junit.Assert; 23 import org.junit.Assume; 24 import org.junit.Test; 25 import org.junit.runner.RunWith; 26 27 @RunWith(AndroidJUnit4.class) 28 public class RavenwoodMinimumTest { 29 @Test testSimple()30 public void testSimple() { 31 Assert.assertTrue(android.os.Process.isApplicationUid(android.os.Process.myUid())); 32 } 33 34 @Test testAssumeNot()35 public void testAssumeNot() { 36 Assume.assumeFalse(android.os.Process.isApplicationUid(android.os.Process.myUid())); 37 } 38 39 @Test 40 @DisabledOnRavenwood testIgnored()41 public void testIgnored() { 42 throw new RuntimeException("Shouldn't be executed under ravenwood"); 43 } 44 45 @Test testIgnored$noRavenwood()46 public void testIgnored$noRavenwood() { 47 throw new RuntimeException("Shouldn't be executed under ravenwood"); 48 } 49 } 50