Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
Java now forces passed/failed message onto new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoffner committed Mar 22, 2017
1 parent 498b566 commit 18c766c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions jvm-runner/src/java/codewars/java/CwRunListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ public void testFailure(final Failure failure)
failed = true;
final String msg = failure.getMessage();
final boolean hasMessage = msg != null && msg.length() > 0;
System.out.println(String.format("<FAILED::>%s<:LF:>", formatMessage(hasMessage ? msg : "Runtime Error Occurred")));
System.out.println(String.format("\n<FAILED::>%s<:LF:>", formatMessage(hasMessage ? msg : "Runtime Error Occurred")));
if(!hasMessage && failure.getException() != null) {
System.out.println(formatException(failure.getException()));
}
}
public void testStarted(final Description description)
{
System.out.println(String.format("<DESCRIBE::>%s<:LF:>", formatMessage(description.getDisplayName())));
System.out.println(String.format("\n<DESCRIBE::>%s<:LF:>", formatMessage(description.getDisplayName())));
failed = false;
}
public void testFinished(final Description description)
{
if(!failed)
{
System.out.println("<PASSED::>Test Passed<:LF:>");
System.out.println("\n<PASSED::>Test Passed<:LF:>");
}
System.out.println("<COMPLETEDIN::>");
System.out.println("\n<COMPLETEDIN::>");
}
private static String formatException(final Throwable ex)
{
Expand Down
4 changes: 2 additions & 2 deletions test/runners/java_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('java runner', function () {
+ ' System.out.println("test out");\n'
+ '}}'
}, function (buffer) {
expect(buffer.stdout).to.contain('<DESCRIBE::>myTestFunction(TestFixture)<:LF:>\ntest out\n<PASSED::>Test Passed<:LF:>\n');
expect(buffer.stdout).to.contain('<DESCRIBE::>myTestFunction(TestFixture)<:LF:>\ntest out\n\n<PASSED::>Test Passed<:LF:>\n');
done();
});
});
Expand All @@ -59,7 +59,7 @@ describe('java runner', function () {
+ ' System.out.println("test out");\n'
+ '}}'
}, function (buffer) {
expect(buffer.stdout).to.contain('<DESCRIBE::>myTestFunction(TestFixture)<:LF:>\n<FAILED::>Failed Message expected:<5> but was:<3><:LF:>\n');
expect(buffer.stdout).to.contain('<DESCRIBE::>myTestFunction(TestFixture)<:LF:>\n\n<FAILED::>Failed Message expected:<5> but was:<3><:LF:>\n');
done();
});
});
Expand Down

0 comments on commit 18c766c

Please sign in to comment.