Loading core/tests/coretests/src/com/android/internal/util/RateLimitingCacheTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static org.junit.Assert.fail; import android.os.SystemClock; import android.platform.test.annotations.Presubmit; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import java.util.ArrayList; Loading Loading @@ -232,6 +233,7 @@ public class RateLimitingCacheTest { * of order. */ @Test @LargeTest public void testMultipleThreads_cachedValueNeverGoesBackInTime() throws InterruptedException { final long periodMillis = 10; final int maxCountPerPeriod = 3; Loading ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunner.java +20 −7 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase mTestClass = new TestClass(testClass); Log.v(TAG, "RavenwoodAwareTestRunner initializing for " + testClass.getCanonicalName()); Log.i(TAG, "RavenwoodAwareTestRunner initializing for " + testClass.getCanonicalName()); // Hook point to allow more customization. runAnnotatedMethodsOnRavenwood(RavenwoodTestRunnerInitializing.class, null); Loading Loading @@ -168,7 +168,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase RavenwoodTestStats.getInstance().attachToRunNotifier(notifier); if (mRealRunner instanceof ClassSkippingTestRunner) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onClassSkipped: description=" + description); } mRealRunner.run(notifier); return; } Loading Loading @@ -280,7 +282,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase * Return false if it should be skipped. */ private boolean onBefore(Description description, Scope scope, Order order) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onBefore: description=" + description + ", " + scope + ", " + order); } final var classDescription = getDescription(); Loading @@ -306,7 +310,10 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase * Return false if the exception should be ignored. */ private boolean onAfter(Description description, Scope scope, Order order, Throwable th) { Log.v(TAG, "onAfter: description=" + description + ", " + scope + ", " + order + ", " + th); if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onAfter: description=" + description + ", " + scope + ", " + order + ", " + th); } final var classDescription = getDescription(); Loading Loading @@ -350,7 +357,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase * Called by RavenwoodRule. */ static void onRavenwoodRuleEnter(Description description, RavenwoodRule rule) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onRavenwoodRuleEnter: description=" + description); } getCurrentRunner().mState.enterRavenwoodRule(rule); } Loading @@ -358,7 +367,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase * Called by RavenwoodRule. */ static void onRavenwoodRuleExit(Description description, RavenwoodRule rule) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onRavenwoodRuleExit: description=" + description); } getCurrentRunner().mState.exitRavenwoodRule(rule); } Loading @@ -367,7 +378,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase } private void dumpDescription(Description desc, String header, String indent) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, indent + header + desc); } var children = desc.getChildren(); var childrenIndent = " " + indent; Loading ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java +10 −10 Original line number Diff line number Diff line Loading @@ -732,7 +732,7 @@ public class RavenwoodRuntimeEnvironmentController { } private static void dumpCommandLineArgs() { Log.v(TAG, "JVM arguments:"); Log.i(TAG, "JVM arguments:"); // Note, we use the wrapper in JUnit4, not the actual class ( // java.lang.management.ManagementFactory), because we can't see the later at the build Loading @@ -741,7 +741,7 @@ public class RavenwoodRuntimeEnvironmentController { var args = ManagementFactory.getRuntimeMXBean().getInputArguments(); for (var arg : args) { Log.v(TAG, " " + arg); Log.i(TAG, " " + arg); } } Loading Loading @@ -776,31 +776,31 @@ public class RavenwoodRuntimeEnvironmentController { } private static void dumpJavaProperties() { Log.v(TAG, "JVM properties:"); Log.i(TAG, "JVM properties:"); dumpMap(System.getProperties()); } private static void dumpEnvironment() { Log.v(TAG, "Environment:"); Log.i(TAG, "Environment:"); dumpMap(System.getenv()); } private static void dumpMap(Map<?, ?> map) { for (var key : map.keySet().stream().sorted().toList()) { Log.v(TAG, " " + key + "=" + map.get(key)); Log.i(TAG, " " + key + "=" + map.get(key)); } } private static void dumpOtherInfo() { Log.v(TAG, "Other key information:"); Log.i(TAG, "Other key information:"); var jloc = Locale.getDefault(); Log.v(TAG, " java.util.Locale=" + jloc + " / " + jloc.toLanguageTag()); Log.i(TAG, " java.util.Locale=" + jloc + " / " + jloc.toLanguageTag()); var uloc = ULocale.getDefault(); Log.v(TAG, " android.icu.util.ULocale=" + uloc + " / " + uloc.toLanguageTag()); Log.i(TAG, " android.icu.util.ULocale=" + uloc + " / " + uloc.toLanguageTag()); var jtz = java.util.TimeZone.getDefault(); Log.v(TAG, " java.util.TimeZone=" + jtz.getDisplayName() + " / " + jtz); Log.i(TAG, " java.util.TimeZone=" + jtz.getDisplayName() + " / " + jtz); var itz = android.icu.util.TimeZone.getDefault(); Log.v(TAG, " android.icu.util.TimeZone=" + itz.getDisplayName() + " / " + itz); Log.i(TAG, " android.icu.util.TimeZone=" + itz.getDisplayName() + " / " + itz); } } ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java +4 −4 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ public class RavenwoodSystemProperties { var ravenwoodProps = readProperties(path + RAVENWOOD_BUILD_PROP); var deviceProps = readProperties(path + DEVICE_BUILD_PROP); Log.v(TAG, "Default system properties:"); Log.i(TAG, "Default system properties:"); ravenwoodProps.forEach((key, origValue) -> { final String value; Loading @@ -102,11 +102,11 @@ public class RavenwoodSystemProperties { var deviceKey = origValue.substring(3); if ("r".equals(deviceKey)) { sReadableKeys.add(key); Log.v(TAG, key + " (readable)"); Log.i(TAG, key + " (readable)"); return; } else if ("w".equals(deviceKey)) { sWritableKeys.add(key); Log.v(TAG, key + " (writable)"); Log.i(TAG, key + " (writable)"); return; } Loading @@ -119,7 +119,7 @@ public class RavenwoodSystemProperties { } else { value = origValue; } Log.v(TAG, key + "=" + value); Log.i(TAG, key + "=" + value); sDefaultValues.put(key, value); }); Loading ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodTestStats.java +29 −9 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package android.platform.test.ravenwood; import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_VERBOSE_LOGGING; import android.util.Log; import org.junit.runner.Description; Loading Loading @@ -188,34 +190,46 @@ public class RavenwoodTestStats { private final RunListener mRunListener = new RunListener() { @Override public void testSuiteStarted(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, "testSuiteStarted: " + description); } } @Override public void testSuiteFinished(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, "testSuiteFinished: " + description); } } @Override public void testRunStarted(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, "testRunStarted: " + description); } } @Override public void testRunFinished(org.junit.runner.Result result) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, "testRunFinished: " + result); } dumpAllAndClear(); } @Override public void testStarted(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testStarted: " + description); } } @Override public void testFinished(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testFinished: " + description); } // Send "Passed", but if there's already another result sent for this, this won't // override it. Loading @@ -224,7 +238,9 @@ public class RavenwoodTestStats { @Override public void testFailure(Failure failure) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testFailure: " + failure); } var description = failure.getDescription(); onTestFinished(description.getClassName(), description.getMethodName(), Result.Failed); Loading @@ -232,14 +248,18 @@ public class RavenwoodTestStats { @Override public void testAssumptionFailure(Failure failure) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testAssumptionFailure: " + failure); } var description = failure.getDescription(); onTestFinished(description.getClassName(), description.getMethodName(), Result.Skipped); } @Override public void testIgnored(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testIgnored: " + description); } onTestFinished(description.getClassName(), description.getMethodName(), Result.Skipped); } }; Loading Loading
core/tests/coretests/src/com/android/internal/util/RateLimitingCacheTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static org.junit.Assert.fail; import android.os.SystemClock; import android.platform.test.annotations.Presubmit; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import java.util.ArrayList; Loading Loading @@ -232,6 +233,7 @@ public class RateLimitingCacheTest { * of order. */ @Test @LargeTest public void testMultipleThreads_cachedValueNeverGoesBackInTime() throws InterruptedException { final long periodMillis = 10; final int maxCountPerPeriod = 3; Loading
ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunner.java +20 −7 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase mTestClass = new TestClass(testClass); Log.v(TAG, "RavenwoodAwareTestRunner initializing for " + testClass.getCanonicalName()); Log.i(TAG, "RavenwoodAwareTestRunner initializing for " + testClass.getCanonicalName()); // Hook point to allow more customization. runAnnotatedMethodsOnRavenwood(RavenwoodTestRunnerInitializing.class, null); Loading Loading @@ -168,7 +168,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase RavenwoodTestStats.getInstance().attachToRunNotifier(notifier); if (mRealRunner instanceof ClassSkippingTestRunner) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onClassSkipped: description=" + description); } mRealRunner.run(notifier); return; } Loading Loading @@ -280,7 +282,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase * Return false if it should be skipped. */ private boolean onBefore(Description description, Scope scope, Order order) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onBefore: description=" + description + ", " + scope + ", " + order); } final var classDescription = getDescription(); Loading @@ -306,7 +310,10 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase * Return false if the exception should be ignored. */ private boolean onAfter(Description description, Scope scope, Order order, Throwable th) { Log.v(TAG, "onAfter: description=" + description + ", " + scope + ", " + order + ", " + th); if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onAfter: description=" + description + ", " + scope + ", " + order + ", " + th); } final var classDescription = getDescription(); Loading Loading @@ -350,7 +357,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase * Called by RavenwoodRule. */ static void onRavenwoodRuleEnter(Description description, RavenwoodRule rule) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onRavenwoodRuleEnter: description=" + description); } getCurrentRunner().mState.enterRavenwoodRule(rule); } Loading @@ -358,7 +367,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase * Called by RavenwoodRule. */ static void onRavenwoodRuleExit(Description description, RavenwoodRule rule) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, "onRavenwoodRuleExit: description=" + description); } getCurrentRunner().mState.exitRavenwoodRule(rule); } Loading @@ -367,7 +378,9 @@ public final class RavenwoodAwareTestRunner extends RavenwoodAwareTestRunnerBase } private void dumpDescription(Description desc, String header, String indent) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.v(TAG, indent + header + desc); } var children = desc.getChildren(); var childrenIndent = " " + indent; Loading
ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java +10 −10 Original line number Diff line number Diff line Loading @@ -732,7 +732,7 @@ public class RavenwoodRuntimeEnvironmentController { } private static void dumpCommandLineArgs() { Log.v(TAG, "JVM arguments:"); Log.i(TAG, "JVM arguments:"); // Note, we use the wrapper in JUnit4, not the actual class ( // java.lang.management.ManagementFactory), because we can't see the later at the build Loading @@ -741,7 +741,7 @@ public class RavenwoodRuntimeEnvironmentController { var args = ManagementFactory.getRuntimeMXBean().getInputArguments(); for (var arg : args) { Log.v(TAG, " " + arg); Log.i(TAG, " " + arg); } } Loading Loading @@ -776,31 +776,31 @@ public class RavenwoodRuntimeEnvironmentController { } private static void dumpJavaProperties() { Log.v(TAG, "JVM properties:"); Log.i(TAG, "JVM properties:"); dumpMap(System.getProperties()); } private static void dumpEnvironment() { Log.v(TAG, "Environment:"); Log.i(TAG, "Environment:"); dumpMap(System.getenv()); } private static void dumpMap(Map<?, ?> map) { for (var key : map.keySet().stream().sorted().toList()) { Log.v(TAG, " " + key + "=" + map.get(key)); Log.i(TAG, " " + key + "=" + map.get(key)); } } private static void dumpOtherInfo() { Log.v(TAG, "Other key information:"); Log.i(TAG, "Other key information:"); var jloc = Locale.getDefault(); Log.v(TAG, " java.util.Locale=" + jloc + " / " + jloc.toLanguageTag()); Log.i(TAG, " java.util.Locale=" + jloc + " / " + jloc.toLanguageTag()); var uloc = ULocale.getDefault(); Log.v(TAG, " android.icu.util.ULocale=" + uloc + " / " + uloc.toLanguageTag()); Log.i(TAG, " android.icu.util.ULocale=" + uloc + " / " + uloc.toLanguageTag()); var jtz = java.util.TimeZone.getDefault(); Log.v(TAG, " java.util.TimeZone=" + jtz.getDisplayName() + " / " + jtz); Log.i(TAG, " java.util.TimeZone=" + jtz.getDisplayName() + " / " + jtz); var itz = android.icu.util.TimeZone.getDefault(); Log.v(TAG, " android.icu.util.TimeZone=" + itz.getDisplayName() + " / " + itz); Log.i(TAG, " android.icu.util.TimeZone=" + itz.getDisplayName() + " / " + itz); } }
ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java +4 −4 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ public class RavenwoodSystemProperties { var ravenwoodProps = readProperties(path + RAVENWOOD_BUILD_PROP); var deviceProps = readProperties(path + DEVICE_BUILD_PROP); Log.v(TAG, "Default system properties:"); Log.i(TAG, "Default system properties:"); ravenwoodProps.forEach((key, origValue) -> { final String value; Loading @@ -102,11 +102,11 @@ public class RavenwoodSystemProperties { var deviceKey = origValue.substring(3); if ("r".equals(deviceKey)) { sReadableKeys.add(key); Log.v(TAG, key + " (readable)"); Log.i(TAG, key + " (readable)"); return; } else if ("w".equals(deviceKey)) { sWritableKeys.add(key); Log.v(TAG, key + " (writable)"); Log.i(TAG, key + " (writable)"); return; } Loading @@ -119,7 +119,7 @@ public class RavenwoodSystemProperties { } else { value = origValue; } Log.v(TAG, key + "=" + value); Log.i(TAG, key + "=" + value); sDefaultValues.put(key, value); }); Loading
ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodTestStats.java +29 −9 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package android.platform.test.ravenwood; import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_VERBOSE_LOGGING; import android.util.Log; import org.junit.runner.Description; Loading Loading @@ -188,34 +190,46 @@ public class RavenwoodTestStats { private final RunListener mRunListener = new RunListener() { @Override public void testSuiteStarted(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, "testSuiteStarted: " + description); } } @Override public void testSuiteFinished(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, "testSuiteFinished: " + description); } } @Override public void testRunStarted(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, "testRunStarted: " + description); } } @Override public void testRunFinished(org.junit.runner.Result result) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, "testRunFinished: " + result); } dumpAllAndClear(); } @Override public void testStarted(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testStarted: " + description); } } @Override public void testFinished(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testFinished: " + description); } // Send "Passed", but if there's already another result sent for this, this won't // override it. Loading @@ -224,7 +238,9 @@ public class RavenwoodTestStats { @Override public void testFailure(Failure failure) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testFailure: " + failure); } var description = failure.getDescription(); onTestFinished(description.getClassName(), description.getMethodName(), Result.Failed); Loading @@ -232,14 +248,18 @@ public class RavenwoodTestStats { @Override public void testAssumptionFailure(Failure failure) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testAssumptionFailure: " + failure); } var description = failure.getDescription(); onTestFinished(description.getClassName(), description.getMethodName(), Result.Skipped); } @Override public void testIgnored(Description description) { if (RAVENWOOD_VERBOSE_LOGGING) { Log.d(TAG, " testIgnored: " + description); } onTestFinished(description.getClassName(), description.getMethodName(), Result.Skipped); } }; Loading