Permalink
Browse files

Fixed the compare dialog in Eclipse.

  • Loading branch information...
cbeust committed Aug 25, 2012
1 parent ce9f923 commit ef7064006d0cd629cc23efe99da7709a925dd85b
View
@@ -6,6 +6,7 @@ Fixed: Reporter.log() invoked from listeners were being discarded
Eclipse:
Added: Predefined listeners (Tim Wu)
+Fixed: Compare dialog
===========================================================================
6.7
@@ -1,5 +1,10 @@
package org.testng;
+import static org.testng.internal.EclipseInterface.ASSERT_LEFT;
+import static org.testng.internal.EclipseInterface.ASSERT_LEFT2;
+import static org.testng.internal.EclipseInterface.ASSERT_MIDDLE;
+import static org.testng.internal.EclipseInterface.ASSERT_RIGHT;
+
import org.testng.collections.Lists;
import java.lang.reflect.Array;
@@ -474,15 +479,15 @@ static private void failSame(Object actual, Object expected, String message) {
if(message != null) {
formatted = message + " ";
}
- fail(formatted + "expected not same [" + expected +"] but found [" + actual + "]");
+ fail(formatted + ASSERT_LEFT2 + expected + ASSERT_MIDDLE + actual + ASSERT_RIGHT);
}
static private void failNotSame(Object actual, Object expected, String message) {
String formatted = "";
if(message != null) {
formatted = message + " ";
}
- fail(formatted + "expected: [" + expected + "] but found [" + actual + "]");
+ fail(formatted + ASSERT_LEFT + expected + ASSERT_MIDDLE + actual + ASSERT_RIGHT);
}
static private void failNotEquals(Object actual , Object expected, String message ) {
@@ -495,7 +500,7 @@ static String format(Object actual, Object expected, String message) {
formatted = message + " ";
}
- return formatted + "expected [" + expected + "] but found [" + actual + "]";
+ return formatted + ASSERT_LEFT + expected + ASSERT_MIDDLE + actual + ASSERT_RIGHT;
}
/**
@@ -0,0 +1,18 @@
+package org.testng.internal;
+
+/**
+ * Symbols in this class are used by the Eclipse plug-in, do not modify them
+ * without updating the plug-in as well.
+ *
+ * @author Cedric Beust <cedric@beust.com>
+ * @since Aug 25, 2012
+ */
+public class EclipseInterface {
+ public static final Character OPENING_CHARACTER = '[';
+ public static final Character CLOSING_CHARACTER = ']';
+
+ public static final String ASSERT_LEFT = "expected " + OPENING_CHARACTER;
+ public static final String ASSERT_LEFT2 = "expected not same " + OPENING_CHARACTER;
+ public static final String ASSERT_MIDDLE = OPENING_CHARACTER + " but found " + CLOSING_CHARACTER;
+ public static final String ASSERT_RIGHT = Character.toString(CLOSING_CHARACTER);
+}
@@ -1,7 +1,7 @@
package org.testng.internal;
public class Version {
- public static final String VERSION = "6.8 beta";
+ public static final String VERSION = "6.8beta 20120825_1010";
public static void displayBanner() {
System.out.println("...\n... TestNG " + VERSION + " by CŽdric Beust (cedric@beust.com)\n...\n");

2 comments on commit ef70640

@akuhtz

This comment has been minimized.

Show comment Hide comment
@akuhtz

akuhtz Oct 10, 2012

Hi Cedric,
I think the ASSERT_MIDDLE definition should be:
public static final String ASSERT_MIDDLE = CLOSING_CHARACTER + " but found " + OPENING_CHARACTER;

Regards,
Andi

Hi Cedric,
I think the ASSERT_MIDDLE definition should be:
public static final String ASSERT_MIDDLE = CLOSING_CHARACTER + " but found " + OPENING_CHARACTER;

Regards,
Andi

@cbeust

This comment has been minimized.

Show comment Hide comment
@cbeust

cbeust Oct 12, 2012

Owner

Thanks, but that's already fixed :-)

Owner

cbeust replied Oct 12, 2012

Thanks, but that's already fixed :-)

Please sign in to comment.