You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using ConsoleLauncher with --details options set to verbose and in test method is thrown an exception with message containing format specifier (e.g. %c - "My exception message with %c specifier") then VerboseTreePrintingListener throws MissingFormatArgumentException exception.
java.util.MissingFormatArgumentException: Format specifier '%c'
at java.util.Formatter.format(Formatter.java:2519)
at java.io.PrintWriter.format(PrintWriter.java:905)
at java.io.PrintWriter.printf(PrintWriter.java:804)
at org.junit.platform.console.tasks.VerboseTreePrintingListener.printf(VerboseTreePrintingListener.java:159)
at org.junit.platform.console.tasks.VerboseTreePrintingListener.printDetail(VerboseTreePrintingListener.java:183)
at org.junit.platform.console.tasks.VerboseTreePrintingListener.lambda$executionFinished$0(VerboseTreePrintingListener.java:104)
at java.util.Optional.ifPresent(Optional.java:159)
at org.junit.platform.console.tasks.VerboseTreePrintingListener.executionFinished(VerboseTreePrintingListener.java:104)
at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.lambda$executionFinished$3(TestExecutionListenerRegistry.java:77)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.launcher.core.TestExecutionListenerRegistry.notifyTestExecutionListeners(TestExecutionListenerRegistry.java:51)
at org.junit.platform.launcher.core.TestExecutionListenerRegistry.access$100(TestExecutionListenerRegistry.java:27)
at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.executionFinished(TestExecutionListenerRegistry.java:77)
at org.junit.platform.launcher.core.ExecutionListenerAdapter.executionFinished(ExecutionListenerAdapter.java:56)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.reportCompletion(NodeTestTask.java:154)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:76)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:110)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:71)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:110)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:71)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
at org.junit.platform.console.tasks.ConsoleTestExecutor.executeTests(ConsoleTestExecutor.java:65)
at org.junit.platform.console.tasks.ConsoleTestExecutor.lambda$execute$0(ConsoleTestExecutor.java:57)
at org.junit.platform.console.tasks.CustomContextClassLoaderExecutor.invoke(CustomContextClassLoaderExecutor.java:33)
at org.junit.platform.console.tasks.ConsoleTestExecutor.execute(ConsoleTestExecutor.java:57)
at org.junit.platform.console.ConsoleLauncher.executeTests(ConsoleLauncher.java:84)
at org.junit.platform.console.ConsoleLauncher.execute(ConsoleLauncher.java:74)
at org.junit.platform.console.ConsoleLauncher.execute(ConsoleLauncher.java:47)
at org.junit.platform.console.ConsoleLauncher.main(ConsoleLauncher.java:39)
The text was updated successfully, but these errors were encountered:
Prior to this commit format specifiers in exception messages resulted
in a MissingFormatArgumentException. Now every user-defined string is
treated as an argument itself, effectively preventing a reformatting
of the passed string.
Closes#1600
Overview
Bug in
VerboseTreePrintingListener
:When using ConsoleLauncher with
--details
options set toverbose
and in test method is thrown an exception with message containing format specifier (e.g.%c
- "My exception message with %c specifier") thenVerboseTreePrintingListener
throwsMissingFormatArgumentException
exception.example test:
command (run from InteliJ):
ConsoleLauncher --reports-dir /tmp/selenium --select-class com.thulium.selenium.VerboseTreePrintingListenerTest --details verbose
Stack trace:
The text was updated successfully, but these errors were encountered: