Hard code text case name template for AndroidJUnitRunner and CTS
am: ab5f9f1d78

Change-Id: I9ffd6f4c59eee40bd1da192efc803179cd13c8bc
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 @@
     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 @@
 
     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;