diff --git a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestResultsSender.java b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestResultsSender.java index fa1bfe5eff0a..b43e632b8922 100644 --- a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestResultsSender.java +++ b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestResultsSender.java @@ -121,6 +121,9 @@ public class JUnit4TestResultsSender extends RunListener { final String message = assertion.getMessage(); if (message != null) { PacketFactory notification = createExceptionNotification(assertion, message, "\nExpected: is \"(.*)\"\n\\s*got: \"(.*)\"\n"); + if (notification == null) { + notification = createExceptionNotification(assertion, message, "\nExpected: is \"(.*)\"\n\\s*but: was \"(.*)\""); + } if (notification == null) { notification = createExceptionNotification(assertion, message, "\nExpected: (.*)\n\\s*got: (.*)"); } @@ -141,7 +144,7 @@ public class JUnit4TestResultsSender extends RunListener { } private static PacketFactory createExceptionNotification(Throwable assertion, String message, final String regex) { - final Matcher matcher = Pattern.compile(regex, Pattern.DOTALL).matcher(message); + final Matcher matcher = Pattern.compile(regex, Pattern.DOTALL | Pattern.CASE_INSENSITIVE).matcher(message); if (matcher.matches()) { return ComparisonDetailsExtractor.create(assertion, matcher.group(1).replaceAll("\\\\n", "\n"), matcher.group(2).replaceAll("\\\\n", "\n")); }