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 8282 <artifactId >junit-jupiter-engine</artifactId >
8383 <scope >test</scope >
8484 </dependency >
85- <dependency >
86- <groupId >org.junit.vintage</groupId >
87- <artifactId >junit-vintage-engine</artifactId >
88- <scope >test</scope >
89- </dependency >
9085 </dependencies >
9186
9287</project >
Original file line number Diff line number Diff line change 1616 */
1717package org .apache .logging .log4j .dbcp2 .appender ;
1818
19+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
20+
1921import 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 ;
2425
26+ @ LoggerContextSource (value = "log4j2-jdbc-dbcp2.xml" , timeout = 10 )
2527public class PoolableConnectionFactoryTest {
2628
2729 private static final String REL_PATH = "src/test/resources/log4j2-jdbc-dbcp2.xml" ;
2830
29- @ ClassRule
30- public static final LoggerContextRule LCR = LoggerContextRule .createShutdownTimeoutLoggerContextRule (REL_PATH );
31-
3231 @ 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 );
3634 }
3735}
Original file line number Diff line number Diff line change 1616 */
1717package org .apache .logging .log4j .dbcp2 .appender ;
1818
19+ import static org .junit .jupiter .api .Assertions .assertFalse ;
20+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
21+
1922import java .sql .Connection ;
2023import java .sql .SQLException ;
2124import org .apache .logging .log4j .core .config .Property ;
2225import org .apache .logging .log4j .jdbc .appender .JdbcH2TestHelper ;
23- import org .junit .Assert ;
24- import org .junit .Test ;
26+ import org .junit .jupiter .api .Test ;
2527
2628public class PoolingDriverConnectionSourceTest {
2729
@@ -76,9 +78,9 @@ public void testH2UserAndPassword() throws SQLException {
7678 }
7779
7880 private void openAndClose (final PoolingDriverConnectionSource source ) throws SQLException {
79- Assert . assertNotNull ("PoolingDriverConnectionSource is null" , source );
81+ assertNotNull (source , "PoolingDriverConnectionSource is null" );
8082 try (final Connection conn = source .getConnection ()) {
81- Assert . assertFalse (conn .isClosed ());
83+ assertFalse (conn .isClosed ());
8284 } finally {
8385 source .stop ();
8486 }
You can’t perform that action at this time.
0 commit comments