Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e7a570e authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Test for the updated classpath

Fix: 414874218
Test: m tradefed tradefed-tests && ./javatests/run_tradefed_tests.sh --class com.android.tradefed.testtype.IsolatedHostTestTest
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh -s
Flag: EXEMPT host test change only
Change-Id: Ib0aebb9c3836a3e3090d66d9463bc3d1be1468f6
parent 334474cd
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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 android.app.appsearch;

/**
 * Used by {@link com.android.ravenwoodtest.coretest.RavenwoodCoreBasicTest#testClassPath()}.
 *
 * This is to ensure that a ravenwood can contain a class to override a class with the
 * exact same qualified name in the mainline stub jar.
 */
public class AppSearchManager {
    /** Dummy method */
    public static int foo() {
        return 42;
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ package com.android.ravenwoodtest.coretest;

import static org.junit.Assert.assertEquals;

import android.app.appsearch.AppSearchManager;

import org.junit.Test;

import java.io.File;
@@ -46,4 +48,10 @@ public class RavenwoodCoreBasicTest {
        assertEquals("value1", System.getProperty("xxx-extra-tradefed-option"));
        assertEquals("value2", System.getProperty("xxx-extra-runner-option"));
    }

    @Test
    public void testClassPath() throws Exception {
        // The mainline stub jar has this class too, but our own copy should be used at runtime.
        assertEquals(42, AppSearchManager.foo());
    }
}