File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
log4j-slf4j2-impl/src/test/java/org/apache/logging/slf4j Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .slf4j ;
18
18
19
- import static org .junit .jupiter .api .Assertions .assertTrue ;
19
+ import static org .junit .jupiter .api .Assertions .assertInstanceOf ;
20
20
21
21
import org .junit .jupiter .api .Test ;
22
22
import org .slf4j .Logger ;
@@ -47,8 +47,9 @@ public void run() {
47
47
48
48
private void trigger () {
49
49
Holder .LOGGER .info ("Attempt to trigger" );
50
- assertTrue (
51
- Holder .LOGGER instanceof Log4jLogger ,
50
+ assertInstanceOf (
51
+ Log4jLogger .class ,
52
+ Holder .LOGGER ,
52
53
"Logger is of type " + Holder .LOGGER .getClass ().getName ());
53
54
}
54
55
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .slf4j ;
18
18
19
+ import static org .junit .jupiter .api .Assertions .assertInstanceOf ;
19
20
import static org .junit .jupiter .api .Assertions .assertTrue ;
20
21
21
22
import java .util .Set ;
@@ -35,7 +36,7 @@ public void testCleanup() throws Exception {
35
36
factory .getLogger ("test" );
36
37
Set <LoggerContext > set = factory .getLoggerContexts ();
37
38
final LoggerContext ctx1 = set .toArray (LoggerContext .EMPTY_ARRAY )[0 ];
38
- assertTrue ( ctx1 instanceof LifeCycle , "LoggerContext is not enabled for shutdown" );
39
+ assertInstanceOf ( LifeCycle . class , ctx1 , "LoggerContext is not enabled for shutdown" );
39
40
((LifeCycle ) ctx1 ).stop ();
40
41
set = factory .getLoggerContexts ();
41
42
assertTrue (set .isEmpty (), "Expected no LoggerContexts" );
Original file line number Diff line number Diff line change 18
18
19
19
import static org .junit .jupiter .api .Assertions .assertEquals ;
20
20
import static org .junit .jupiter .api .Assertions .assertFalse ;
21
+ import static org .junit .jupiter .api .Assertions .assertInstanceOf ;
21
22
import static org .junit .jupiter .api .Assertions .assertNotEquals ;
22
23
import static org .junit .jupiter .api .Assertions .assertTrue ;
23
24
import static org .junit .jupiter .api .Assertions .fail ;
@@ -59,7 +60,7 @@ public void testAddMarker() {
59
60
final Marker log4jParent = MarkerManager .getMarker (parentMarkerName );
60
61
final Marker log4jMarker = MarkerManager .getMarker (childMakerName );
61
62
62
- assertTrue ( slf4jMarker instanceof Log4jMarker , "Incorrect Marker class" );
63
+ assertInstanceOf ( Log4jMarker . class , slf4jMarker , "Incorrect Marker class" );
63
64
assertTrue (
64
65
log4jMarker .isInstanceOf (log4jParent ),
65
66
String .format (
You can’t perform that action at this time.
0 commit comments