Skip to content

Commit 34e7058

Browse files
author
ipolevoy
committed
#784 - Implement support for JUnit 5 - initial commit, will need to add a JUnit5 test
1 parent 3f0eb38 commit 34e7058

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

activejdbc/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,20 @@
404404
<scope>provided</scope>
405405
</dependency>
406406

407+
<dependency>
408+
<groupId>org.junit.jupiter</groupId>
409+
<artifactId>junit-jupiter-engine</artifactId>
410+
<version>${junit-jupiter.version}</version>
411+
<scope>provided</scope>
412+
</dependency>
413+
414+
<dependency>
415+
<groupId>org.junit.vintage</groupId>
416+
<artifactId>junit-vintage-engine</artifactId>
417+
<version>${junit-jupiter.version}</version>
418+
<scope>provided</scope>
419+
</dependency>
420+
407421
<dependency>
408422
<groupId>javax.servlet</groupId>
409423
<artifactId>servlet-api</artifactId>

activejdbc/src/main/java/org/javalite/activejdbc/test/DBSpec.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import org.javalite.test.jspec.JSpecSupport;
2424
import org.junit.After;
2525
import org.junit.Before;
26+
import org.junit.jupiter.api.AfterEach;
27+
import org.junit.jupiter.api.BeforeEach;
2628
import org.slf4j.Logger;
2729
import org.slf4j.LoggerFactory;
2830

@@ -100,7 +102,7 @@ public void setRollback(boolean rollback) {
100102
}
101103
}
102104

103-
@Before
105+
@Before @BeforeEach
104106
public final void openTestConnections() {
105107

106108
if(!suppressDb){
@@ -121,7 +123,7 @@ public final void openTestConnections() {
121123
}
122124
}
123125

124-
@After
126+
@After @AfterEach
125127
public final void closeTestConnections() {
126128
if(!suppressDb){
127129
List<ConnectionSpecWrapper> connectionWrappers = getTestConnectionWrappers();

pom.xml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
<maven.compiler.target>1.8</maven.compiler.target>
2626
<skipTests>false</skipTests>
2727
<slf4j.version>1.7.0</slf4j.version> <!--//TODO: replace with latest version when this is fixed: http://jira.qos.ch/browse/SLF4J-389-->
28-
</properties>
28+
29+
<junit.version>4.12</junit.version>
30+
<junit-vintage-engine>4.12.1</junit-vintage-engine>
31+
<junit-jupiter.version>5.3.0</junit-jupiter.version>
32+
</properties>
2933

3034
<licenses>
3135
<license>
@@ -85,7 +89,7 @@
8589
<plugin>
8690
<groupId>org.apache.maven.plugins</groupId>
8791
<artifactId>maven-surefire-plugin</artifactId>
88-
<version>2.19.1</version>
92+
<version>2.22.0</version>
8993
<configuration>
9094
<useFile>false</useFile>
9195
<skipTests>${skipTests}</skipTests>
@@ -148,7 +152,21 @@
148152
<dependency>
149153
<groupId>junit</groupId>
150154
<artifactId>junit</artifactId>
151-
<version>4.11</version>
155+
<version>${junit.version}</version>
156+
<scope>test</scope>
157+
</dependency>
158+
159+
<dependency>
160+
<groupId>org.junit.jupiter</groupId>
161+
<artifactId>junit-jupiter-engine</artifactId>
162+
<version>${junit-jupiter.version}</version>
163+
<scope>test</scope>
164+
</dependency>
165+
166+
<dependency>
167+
<groupId>org.junit.vintage</groupId>
168+
<artifactId>junit-vintage-engine</artifactId>
169+
<version>${junit-jupiter.version}</version>
152170
<scope>test</scope>
153171
</dependency>
154172

0 commit comments

Comments
 (0)