Skip to content

Commit

Permalink
test passes in multiple JDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Albion committed Oct 20, 2022
1 parent 1344fa2 commit 4200895
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/test/java/io/github/nalbion/TestAppenderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ void shouldAssertLogsWithStackTrace() {
logger.error("Caught exception", e);
logger.info("Message after stacktrace");

testAppender.assertLogs("Hello World!\n"
testAppender.assertLogs(line ->
line.replaceAll("java.base/jdk.internal([A-Za-z \\d.(]+)(:\\d+)?\\)", "sun$1)"),
"Hello World!\n"
+ "Caught exception\n"
+ "java.lang.RuntimeException: Forced error\n"
+ " at io.github.nalbion.TestAppenderTest.shouldAssertLogsWithStackTrace(TestAppenderTest.java:44)\n"
+ " at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
+ " at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)\n"
+ " at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n"
+ " at io.github.nalbion.TestAppenderTest.shouldAssertLogsWithStackTrace(TestAppenderTest.java:42)\n"
+ " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
+ " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)\n"
+ " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)\n"
+ "Message after stacktrace");
}
}
Expand Down

0 comments on commit 4200895

Please # to comment.