File tree Expand file tree Collapse file tree 3 files changed +14
-19
lines changed
src/test/java/org/apache/logging/log4j/dbcp2/appender Expand file tree Collapse file tree 3 files changed +14
-19
lines changed Original file line number Diff line number Diff line change 82
82
<artifactId >junit-jupiter-engine</artifactId >
83
83
<scope >test</scope >
84
84
</dependency >
85
- <dependency >
86
- <groupId >org.junit.vintage</groupId >
87
- <artifactId >junit-vintage-engine</artifactId >
88
- <scope >test</scope >
89
- </dependency >
90
85
</dependencies >
91
86
92
87
</project >
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .dbcp2 .appender ;
18
18
19
+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
20
+
19
21
import org .apache .logging .log4j .core .Appender ;
20
- import org .apache .logging .log4j .core .test .junit .LoggerContextRule ;
21
- import org .junit .Assert ;
22
- import org .junit .ClassRule ;
23
- import org .junit .Test ;
22
+ import org .apache .logging .log4j .core .test .junit .LoggerContextSource ;
23
+ import org .apache .logging .log4j .core .test .junit .Named ;
24
+ import org .junit .jupiter .api .Test ;
24
25
26
+ @ LoggerContextSource (value = "log4j2-jdbc-dbcp2.xml" , timeout = 10 )
25
27
public class PoolableConnectionFactoryTest {
26
28
27
29
private static final String REL_PATH = "src/test/resources/log4j2-jdbc-dbcp2.xml" ;
28
30
29
- @ ClassRule
30
- public static final LoggerContextRule LCR = LoggerContextRule .createShutdownTimeoutLoggerContextRule (REL_PATH );
31
-
32
31
@ Test
33
- public void test () {
34
- final Appender appender = LCR .getAppender ("databaseAppender" );
35
- Assert .assertNotNull ("Problem loading configuration from " + REL_PATH , appender );
32
+ public void test (@ Named ("databaseAppender" ) final Appender appender ) {
33
+ assertNotNull (appender , "Problem loading configuration from " + REL_PATH );
36
34
}
37
35
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .dbcp2 .appender ;
18
18
19
+ import static org .junit .jupiter .api .Assertions .assertFalse ;
20
+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
21
+
19
22
import java .sql .Connection ;
20
23
import java .sql .SQLException ;
21
24
import org .apache .logging .log4j .core .config .Property ;
22
25
import org .apache .logging .log4j .jdbc .appender .JdbcH2TestHelper ;
23
- import org .junit .Assert ;
24
- import org .junit .Test ;
26
+ import org .junit .jupiter .api .Test ;
25
27
26
28
public class PoolingDriverConnectionSourceTest {
27
29
@@ -76,9 +78,9 @@ public void testH2UserAndPassword() throws SQLException {
76
78
}
77
79
78
80
private void openAndClose (final PoolingDriverConnectionSource source ) throws SQLException {
79
- Assert . assertNotNull ("PoolingDriverConnectionSource is null" , source );
81
+ assertNotNull (source , "PoolingDriverConnectionSource is null" );
80
82
try (final Connection conn = source .getConnection ()) {
81
- Assert . assertFalse (conn .isClosed ());
83
+ assertFalse (conn .isClosed ());
82
84
} finally {
83
85
source .stop ();
84
86
}
You can’t perform that action at this time.
0 commit comments