-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make custom logging façade testable #1047
Milestone
Comments
3 tasks
in progress |
sbrannen
added a commit
that referenced
this issue
Sep 22, 2017
This commit introduces a LogRecordListener that can be registered with JUnit's logging façade for JUL via the LoggerFactory. Such a listener can be queried for all log records that were submitted since the listener was registered. This makes it possible for tests to register a listener for a given scenario that is supposed to log something and then verify that the expected message got logged at the expected level. After such a test scenario has completed, the test code should remove the listener from the LoggerFactory. To simplify matters, the creation of a listener, registration of a listener, and removal of a listener are all encapsulated in a JUnit Jupiter extension that is registered via a new @TrackLogRecords in the junit-jupiter-engine test source tree. See MultipleTestableAnnotationsTests for an example of this functionality in action. Issue: #1047
sbrannen
added a commit
that referenced
this issue
Sep 23, 2017
sbrannen
added a commit
that referenced
this issue
Sep 23, 2017
sbrannen
added a commit
that referenced
this issue
Sep 23, 2017
sbrannen
added a commit
that referenced
this issue
Sep 23, 2017
sbrannen
added a commit
that referenced
this issue
Sep 23, 2017
sbrannen
added a commit
that referenced
this issue
Sep 23, 2017
sbrannen
added a commit
that referenced
this issue
Sep 23, 2017
Work completed and pushed to See previous commits. |
Note to developers: search for uses of |
Andrei94
pushed a commit
to Andrei94/junit5
that referenced
this issue
Jun 23, 2018
This commit introduces a LogRecordListener that can be registered with JUnit's logging façade for JUL via the LoggerFactory. Such a listener can be queried for all log records that were submitted since the listener was registered. This makes it possible for tests to register a listener for a given scenario that is supposed to log something and then verify that the expected message got logged at the expected level. After such a test scenario has completed, the test code should remove the listener from the LoggerFactory. To simplify matters, the creation of a listener, registration of a listener, and removal of a listener are all encapsulated in a JUnit Jupiter extension that is registered via a new @TrackLogRecords in the junit-jupiter-engine test source tree. See MultipleTestableAnnotationsTests for an example of this functionality in action. Issue: junit-team#1047
Andrei94
pushed a commit
to Andrei94/junit5
that referenced
this issue
Jun 23, 2018
Andrei94
pushed a commit
to Andrei94/junit5
that referenced
this issue
Jun 23, 2018
Andrei94
pushed a commit
to Andrei94/junit5
that referenced
this issue
Jun 23, 2018
Andrei94
pushed a commit
to Andrei94/junit5
that referenced
this issue
Jun 23, 2018
Andrei94
pushed a commit
to Andrei94/junit5
that referenced
this issue
Jun 23, 2018
Andrei94
pushed a commit
to Andrei94/junit5
that referenced
this issue
Jun 23, 2018
Andrei94
pushed a commit
to Andrei94/junit5
that referenced
this issue
Jun 23, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
This is a follow-up to #834.
Deliverables
org.junit.vintage.engine.RecordCollectingLogger
for inspiration.The text was updated successfully, but these errors were encountered: