Loading ravenwood/TEST_MAPPING +11 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,17 @@ }, { "name": "RavenwoodBivalentTest_device" }, { "name": "SystemUIGoogleTests", "options": [ { "exclude-annotation": "org.junit.Ignore" }, { "exclude-annotation": "androidx.test.filters.FlakyTest" } ] } ], "ravenwood-presubmit": [ Loading ravenwood/bivalenttest/test/com/android/platform/test/ravenwood/bivalenttest/RavenwoodAndroidApiTest.java 0 → 100644 +47 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.platform.test.ravenwood.bivalenttest; import static org.junit.Assert.assertEquals; import android.util.ArrayMap; import android.util.Size; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import java.util.Map; // Tests for calling simple Android APIs. @RunWith(AndroidJUnit4.class) public class RavenwoodAndroidApiTest { @Test public void testArrayMapSimple() { final Map<String, String> map = new ArrayMap<>(); map.put("key1", "value1"); assertEquals("value1", map.get("key1")); } @Test public void testSizeSimple() { final var size = new Size(1, 2); assertEquals(2, size.getHeight()); } } ravenwood/bivalenttest/test/com/android/platform/test/ravenwood/bivalenttest/RavenwoodClassRuleDeviceOnlyTest.java 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.platform.test.ravenwood.bivalenttest; import android.platform.test.annotations.DisabledOnRavenwood; import android.platform.test.ravenwood.RavenwoodClassRule; import android.platform.test.ravenwood.RavenwoodRule; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @DisabledOnRavenwood public class RavenwoodClassRuleDeviceOnlyTest { @ClassRule public static final RavenwoodClassRule sRavenwood = new RavenwoodClassRule(); @Test public void testDeviceOnly() { Assert.assertFalse(RavenwoodRule.isOnRavenwood()); } } ravenwood/bivalenttest/test/com/android/platform/test/ravenwood/bivalenttest/RavenwoodClassRuleRavenwoodOnlyTest.java 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.platform.test.ravenwood.bivalenttest; import android.platform.test.ravenwood.RavenwoodClassRule; import android.platform.test.ravenwood.RavenwoodRule; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) // TODO: atest RavenwoodBivalentTest_device fails with the following message. // `RUNNER ERROR: Instrumentation reported numtests=7 but only ran 6` // @android.platform.test.annotations.DisabledOnNonRavenwood // Figure it out and then make DisabledOnNonRavenwood support TYPEs as well. @Ignore public class RavenwoodClassRuleRavenwoodOnlyTest { @ClassRule public static final RavenwoodClassRule sRavenwood = new RavenwoodClassRule(); @Test public void testRavenwoodOnly() { Assert.assertTrue(RavenwoodRule.isOnRavenwood()); } } ravenwood/coretest/test/com/android/platform/test/ravenwood/coretest/RavenwoodTestRunnerValidationTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public class RavenwoodTestRunnerValidationTest { public final RuleChain chain = RuleChain.outerRule(mThrown).around(mRavenwood); public RavenwoodTestRunnerValidationTest() { Assume.assumeTrue(mRavenwood._ravenwood_private$isOptionalValidationEnabled()); Assume.assumeTrue(RavenwoodRule._$RavenwoodPrivate.isOptionalValidationEnabled()); // Because RavenwoodRule will throw this error before executing the test method, // we can't do it in the test method itself. // So instead, we initialize it here. Loading Loading
ravenwood/TEST_MAPPING +11 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,17 @@ }, { "name": "RavenwoodBivalentTest_device" }, { "name": "SystemUIGoogleTests", "options": [ { "exclude-annotation": "org.junit.Ignore" }, { "exclude-annotation": "androidx.test.filters.FlakyTest" } ] } ], "ravenwood-presubmit": [ Loading
ravenwood/bivalenttest/test/com/android/platform/test/ravenwood/bivalenttest/RavenwoodAndroidApiTest.java 0 → 100644 +47 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.platform.test.ravenwood.bivalenttest; import static org.junit.Assert.assertEquals; import android.util.ArrayMap; import android.util.Size; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import java.util.Map; // Tests for calling simple Android APIs. @RunWith(AndroidJUnit4.class) public class RavenwoodAndroidApiTest { @Test public void testArrayMapSimple() { final Map<String, String> map = new ArrayMap<>(); map.put("key1", "value1"); assertEquals("value1", map.get("key1")); } @Test public void testSizeSimple() { final var size = new Size(1, 2); assertEquals(2, size.getHeight()); } }
ravenwood/bivalenttest/test/com/android/platform/test/ravenwood/bivalenttest/RavenwoodClassRuleDeviceOnlyTest.java 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.platform.test.ravenwood.bivalenttest; import android.platform.test.annotations.DisabledOnRavenwood; import android.platform.test.ravenwood.RavenwoodClassRule; import android.platform.test.ravenwood.RavenwoodRule; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @DisabledOnRavenwood public class RavenwoodClassRuleDeviceOnlyTest { @ClassRule public static final RavenwoodClassRule sRavenwood = new RavenwoodClassRule(); @Test public void testDeviceOnly() { Assert.assertFalse(RavenwoodRule.isOnRavenwood()); } }
ravenwood/bivalenttest/test/com/android/platform/test/ravenwood/bivalenttest/RavenwoodClassRuleRavenwoodOnlyTest.java 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.platform.test.ravenwood.bivalenttest; import android.platform.test.ravenwood.RavenwoodClassRule; import android.platform.test.ravenwood.RavenwoodRule; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) // TODO: atest RavenwoodBivalentTest_device fails with the following message. // `RUNNER ERROR: Instrumentation reported numtests=7 but only ran 6` // @android.platform.test.annotations.DisabledOnNonRavenwood // Figure it out and then make DisabledOnNonRavenwood support TYPEs as well. @Ignore public class RavenwoodClassRuleRavenwoodOnlyTest { @ClassRule public static final RavenwoodClassRule sRavenwood = new RavenwoodClassRule(); @Test public void testRavenwoodOnly() { Assert.assertTrue(RavenwoodRule.isOnRavenwood()); } }
ravenwood/coretest/test/com/android/platform/test/ravenwood/coretest/RavenwoodTestRunnerValidationTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public class RavenwoodTestRunnerValidationTest { public final RuleChain chain = RuleChain.outerRule(mThrown).around(mRavenwood); public RavenwoodTestRunnerValidationTest() { Assume.assumeTrue(mRavenwood._ravenwood_private$isOptionalValidationEnabled()); Assume.assumeTrue(RavenwoodRule._$RavenwoodPrivate.isOptionalValidationEnabled()); // Because RavenwoodRule will throw this error before executing the test method, // we can't do it in the test method itself. // So instead, we initialize it here. Loading