smTest: better naming
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Fri, 22 Apr 2016 14:49:59 +0000 (17:49 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Fri, 22 Apr 2016 14:49:59 +0000 (17:49 +0300)
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/events/TestFailedEvent.java

index 8cbb3fc8bceaf73535d8b58056fe5959ef2cc42e..a84cefa94b4c758a6c3cc3e8f0b2a06c62b1cc31 100644 (file)
@@ -270,7 +270,8 @@ public class GeneralIdBasedToSMTRunnerEventsConvertor extends GeneralTestEventsP
         String stackTrace = testFailedEvent.getStacktrace();
         if (comparisonFailureActualText != null && comparisonFailureExpectedText != null) {
           testProxy.setTestComparisonFailed(failureMessage, stackTrace,
-                                            comparisonFailureActualText, comparisonFailureExpectedText, testFailedEvent.getFilePath());
+                                            comparisonFailureActualText, comparisonFailureExpectedText,
+                                            testFailedEvent.getExpectedFilePath());
         } else if (comparisonFailureActualText == null && comparisonFailureExpectedText == null) {
           testProxy.setTestFailed(failureMessage, stackTrace, testFailedEvent.isTestError());
         } else {
index b8a37e3595185d70fb927b0c9ba1d1e3b5d25411..f663eac2954174920b282fb7f39b8322da5e37fc 100644 (file)
@@ -409,7 +409,7 @@ public class GeneralToSMTRunnerEventsConvertor extends GeneralTestEventsProcesso
         if (comparisionFailureActualText != null && comparisionFailureExpectedText != null) {
           testProxy.setTestComparisonFailed(localizedMessage, stackTrace,
                                             comparisionFailureActualText, comparisionFailureExpectedText, 
-                                            testFailedEvent.getFilePath(), testFailedEvent.getActualFilePath());
+                                            testFailedEvent.getExpectedFilePath(), testFailedEvent.getActualFilePath());
         }
         else if (comparisionFailureActualText == null && comparisionFailureExpectedText == null) {
           testProxy.setTestFailed(localizedMessage, stackTrace, isTestError);
index 9065828abdc77773478f0f1fe3293e45487a31e3..a24f824c129c3944dc74edac967dbd7cd195e8dc 100644 (file)
@@ -27,17 +27,20 @@ public class TestFailedEvent extends TreeNodeEvent {
   private final boolean myTestError;
   private final String myComparisonFailureActualText;
   private final String myComparisonFailureExpectedText;
-  private final String myFilePath;
+  private final String myExpectedFilePath;
   private final String myActualFilePath;
   private final long myDurationMillis;
 
   public TestFailedEvent(@NotNull TestFailed testFailed, boolean testError) {
     this(testFailed, testError, null);
   }
-  public TestFailedEvent(@NotNull TestFailed testFailed, boolean testError, String filePath) {
-    this(testFailed, testError, filePath, null);
+  public TestFailedEvent(@NotNull TestFailed testFailed, boolean testError, @Nullable String expectedFilePath) {
+    this(testFailed, testError, expectedFilePath, null);
   }  
-  public TestFailedEvent(@NotNull TestFailed testFailed, boolean testError, String filePath, String actualFilePath) {
+  public TestFailedEvent(@NotNull TestFailed testFailed,
+                         boolean testError,
+                         @Nullable String expectedFilePath,
+                         @Nullable String actualFilePath) {
     super(testFailed.getTestName(), TreeNodeEvent.getNodeId(testFailed));
     if (testFailed.getFailureMessage() == null) throw new NullPointerException();
     myLocalizedFailureMessage = testFailed.getFailureMessage();
@@ -45,7 +48,7 @@ public class TestFailedEvent extends TreeNodeEvent {
     myTestError = testError;
     myComparisonFailureActualText = testFailed.getActual();
     myComparisonFailureExpectedText = testFailed.getExpected();
-    myFilePath = filePath;
+    myExpectedFilePath = expectedFilePath;
     myActualFilePath = actualFilePath;
     myDurationMillis = parseDuration(testFailed.getAttributes().get("duration"));
   }
@@ -85,7 +88,7 @@ public class TestFailedEvent extends TreeNodeEvent {
                          boolean testError,
                          @Nullable String comparisonFailureActualText,
                          @Nullable String comparisonFailureExpectedText,
-                         @Nullable String expectedTextFilePath,
+                         @Nullable String expectedFilePath,
                          long durationMillis) {
     super(testName, id);
     myLocalizedFailureMessage = localizedFailureMessage;
@@ -93,7 +96,7 @@ public class TestFailedEvent extends TreeNodeEvent {
     myTestError = testError;
     myComparisonFailureActualText = comparisonFailureActualText;
     myComparisonFailureExpectedText = comparisonFailureExpectedText;
-    myFilePath = expectedTextFilePath;
+    myExpectedFilePath = expectedFilePath;
     myActualFilePath = null;
     myDurationMillis = durationMillis;
   }
@@ -131,10 +134,19 @@ public class TestFailedEvent extends TreeNodeEvent {
     append(buf, "comparisonFailureExpectedText", myComparisonFailureExpectedText);
   }
 
+  /**
+   * @deprecated use {@link #getExpectedFilePath()} instead
+   */
   public String getFilePath() {
-    return myFilePath;
+    return myExpectedFilePath;
   }
 
+  @Nullable
+  public String getExpectedFilePath() {
+    return myExpectedFilePath;
+  }
+
+  @Nullable
   public String getActualFilePath() {
     return myActualFilePath;
   }