diff options
author | Paul Duffin <paulduffin@google.com> | 2017-03-24 13:36:29 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-24 13:36:29 +0000 |
commit | 2ce40971d60976b2cd84e3194c7c5ed6db36cb33 (patch) | |
tree | f709289deffa11c315718fd7f30b9ed3493aef6c | |
parent | 63dd96c6f8df00a9521c30b1d2bc2ec942965c14 (diff) | |
parent | 67e1cb11019cf70266b6c0509b06a17ce0742429 (diff) | |
download | platform_external_junit-params-2ce40971d60976b2cd84e3194c7c5ed6db36cb33.tar.gz platform_external_junit-params-2ce40971d60976b2cd84e3194c7c5ed6db36cb33.tar.bz2 platform_external_junit-params-2ce40971d60976b2cd84e3194c7c5ed6db36cb33.zip |
Hard code text case name template for AndroidJUnitRunner and CTS am: ab5f9f1d78
am: 67e1cb1101
Change-Id: Id51ba0ddae726eb1395353b64738f914aa56f71f
-rw-r--r-- | src/main/java/junitparams/naming/MacroSubstitutionNamingStrategy.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/junitparams/naming/MacroSubstitutionNamingStrategy.java b/src/main/java/junitparams/naming/MacroSubstitutionNamingStrategy.java index ce56847..1bdcafb 100644 --- a/src/main/java/junitparams/naming/MacroSubstitutionNamingStrategy.java +++ b/src/main/java/junitparams/naming/MacroSubstitutionNamingStrategy.java @@ -14,7 +14,9 @@ public class MacroSubstitutionNamingStrategy implements TestCaseNamingStrategy { private static final Pattern MACRO_SPLIT_PATTERN = Pattern.compile(String.format("(?=%s)|(?<=%s)", MACRO_PATTERN, MACRO_PATTERN)); private static final String MACRO_START = "{"; private static final String MACRO_END = "}"; - static final String DEFAULT_TEMPLATE = "[{index}] {params} ({method})"; + // Android-changed: CTS and AndroidJUnitRunner rely on specific format to test names, changing + // them will prevent CTS and AndroidJUnitRunner from working properly; see b/36541809 + static final String DEFAULT_TEMPLATE = "{method}[{index}]"; private TestMethod method; public MacroSubstitutionNamingStrategy(TestMethod testMethod) { @@ -37,7 +39,12 @@ public class MacroSubstitutionNamingStrategy implements TestCaseNamingStrategy { private String getTemplate(TestCaseName testCaseName) { if (testCaseName != null) { - return testCaseName.value(); + // Android-changed: CTS and AndroidJUnitRunner rely on specific format to test names, + // changing them will prevent CTS and AndroidJUnitRunner from working properly; + // see b/36541809 + throw new IllegalStateException( + "@TestCaseName not currently supported as it breaks running tests in CTS"); + // return testCaseName.value(); } return DEFAULT_TEMPLATE; |