diff options
author | 2024-02-27 12:36:36 -0700 | |
---|---|---|
committer | 2024-02-29 11:04:46 -0700 | |
commit | 8a922ecadb76c49a62b43fab80507466a92db7cc (patch) | |
tree | 4efeff667f1684324ebea2472e769217c03ada56 /ravenwood/junit-src | |
parent | 16f7cdf2e01e158efe8d8334a15e9e20e59de929 (diff) |
Support service dependencies on Ravenwood.
Ravenwood test authors should only need to call setServicesRequired()
for the services they directly interact with, but often those
services will have indirect dependencies on other OS internals, and
those dependencies will evolve over time.
To handle this, we add the concept of dependencies to SystemService,
where a service declares the other services required to run. (They
can choose to omit services from their dependencies where they
gracefully handle a missing service at runtime.)
Bug: 325506297
Test: atest RavenwoodServicesTest
Change-Id: I42187b3494fef499d619ad882891e832b0fd6bca
Diffstat (limited to 'ravenwood/junit-src')
-rw-r--r-- | ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java index a520d4ccafa1..52ea3402fa62 100644 --- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java +++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java @@ -35,6 +35,8 @@ import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; @@ -127,7 +129,7 @@ public class RavenwoodRule implements TestRule { final RavenwoodSystemProperties mSystemProperties = new RavenwoodSystemProperties(); - final ArraySet<Class<?>> mServicesRequired = new ArraySet<>(); + final List<Class<?>> mServicesRequired = new ArrayList<>(); volatile Context mContext; volatile Instrumentation mInstrumentation; |