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

Commit 31af15fb authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "Test for the updated classpath" into main

parents 8cdf9583 5e7a570e
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;
@@ -58,4 +60,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());
    }
}