File tree Expand file tree Collapse file tree 3 files changed +14
-20
lines changed
src/test/java/org/apache/logging/log4j/core/appender/db/jdbc Expand file tree Collapse file tree 3 files changed +14
-20
lines changed Original file line number Diff line number Diff line change 6969 <artifactId >junit-jupiter-engine</artifactId >
7070 <scope >test</scope >
7171 </dependency >
72- <!-- Test Dependencies -->
73- <dependency >
74- <groupId >org.junit.vintage</groupId >
75- <artifactId >junit-vintage-engine</artifactId >
76- <scope >test</scope >
77- </dependency >
7872 </dependencies >
7973
8074</project >
Original file line number Diff line number Diff line change 1616 */
1717package org .apache .logging .log4j .core .appender .db .jdbc ;
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 .core .appender .db .jdbc ;
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 .core .test .appender .db .jdbc .JdbcH2TestHelper ;
23- import org .junit .Assert ;
24- import org .junit .Test ;
26+ import org .junit .jupiter .api .Test ;
2527
2628public class PoolingDriverConnectionSourceTest {
2729
@@ -75,9 +77,9 @@ public void testH2UserAndPassword() throws SQLException {
7577 }
7678
7779 private void openAndClose (final PoolingDriverConnectionSource source ) throws SQLException {
78- Assert . assertNotNull ("PoolingDriverConnectionSource is null" , source );
80+ assertNotNull (source , "PoolingDriverConnectionSource is null" );
7981 try (final Connection conn = source .getConnection ()) {
80- Assert . assertFalse (conn .isClosed ());
82+ assertFalse (conn .isClosed ());
8183 } finally {
8284 source .stop ();
8385 }
You can’t perform that action at this time.
0 commit comments