More clear name for method.
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Thu, 17 Mar 2011 16:54:36 +0000 (19:54 +0300)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Fri, 18 Mar 2011 05:45:35 +0000 (08:45 +0300)
platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java
plugins/IdeaTestAssistant/src/com/intellij/testAssistant/TestDataReferenceCollector.java

index aad0fdc8cd78be4244846c4cd83ef38fc708d09e..4ab574926e63e65e7392b90e1111419accdb56b3 100644 (file)
@@ -464,6 +464,10 @@ public abstract class UsefulTestCase extends TestCase {
 
   protected String getTestName(boolean lowercaseFirstLetter) {
     String name = getName();
+    return getTestName(name, lowercaseFirstLetter);
+  }
+
+  public static String getTestName(String name, boolean lowercaseFirstLetter) {
     if (name == null) {
       return "";
     }
@@ -471,10 +475,10 @@ public abstract class UsefulTestCase extends TestCase {
     if (StringUtil.isEmpty(name)) {
       return "";
     }
-    return getTestName(name, lowercaseFirstLetter);
+    return lowercaseFirstLetter(name, lowercaseFirstLetter);
   }
 
-  public static String getTestName(String name, boolean lowercaseFirstLetter) {
+  public static String lowercaseFirstLetter(String name, boolean lowercaseFirstLetter) {
     if (lowercaseFirstLetter && !isAllUppercaseName(name)) {
       name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
     }
index 7b0302a41a0ad10a8ad5ba25c5947816c6207557..2460db884761db985f165d375bfb03d0fee867d9 100644 (file)
@@ -151,7 +151,7 @@ public class TestDataReferenceCollector {
         final PsiExpression[] psiExpressions = methodCall.getArgumentList().getExpressions();
         if (psiExpressions.length == 1) {
           if (psiExpressions[0].getText().equals("true")) {
-            return UsefulTestCase.getTestName(myTestName, true);
+            return UsefulTestCase.lowercaseFirstLetter(myTestName, true);
           }
           return myTestName;
         }