check-flagged-apis: simplify unit test dependencies

Replace the current unit test runner DeviceJUnit4ClassRunner with JUnit4
and replace the (larger) dependency tradefed with the (smaller)
dependency junit.

This has no impact other than minimizing the unit test static_libs.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: I0520ab0feeea5ea2ed15905136ba2647f86162cb
This commit is contained in:
Mårten Kongstad
2024-04-18 10:23:20 +02:00
parent fde34c3b65
commit 7cc217459a
2 changed files with 4 additions and 5 deletions

View File

@@ -46,6 +46,6 @@ java_test_host {
"src/com/android/checkflaggedapis/CheckFlaggedApisTest.kt",
],
static_libs: [
"tradefed",
"junit",
],
}

View File

@@ -16,14 +16,13 @@
package com.android.checkflaggedapis
import android.aconfig.Aconfig
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.InputStream
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
private val API_SIGNATURE =
"""
@@ -64,8 +63,8 @@ private fun generateFlagsProto(fooState: Aconfig.flag_state): InputStream {
return ByteArrayInputStream(binaryProto.toByteArray())
}
@RunWith(DeviceJUnit4ClassRunner::class)
class CheckFlaggedApisTest : BaseHostJUnit4Test() {
@RunWith(JUnit4::class)
class CheckFlaggedApisTest {
@Test
fun testParseApiSignature() {
val expected = setOf(Pair(Symbol("android.Clazz.FOO"), Flag("android.flag.foo")))