Skip to content

Commit

Permalink
Upgrade to JUnit5
Browse files Browse the repository at this point in the history
  • Loading branch information
pivovarit committed Sep 11, 2024
1 parent d5bcbb6 commit eda96e6
Show file tree
Hide file tree
Showing 180 changed files with 833 additions and 667 deletions.
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
<eclipse.lifecycle.mapping.version>1.0.0</eclipse.lifecycle.mapping.version>
<java.version>1.8</java.version>
<jmh.version>1.21</jmh.version>
<junit.version>4.13-beta-1</junit.version>
<junit.version>5.11.0</junit.version>
<maven.enforcer.version>3.0.0-M2</maven.enforcer.version>
<maven.build-helper.version>3.0.0</maven.build-helper.version>
<maven.bundle.version>5.1.1</maven.bundle.version>
Expand All @@ -93,9 +93,10 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
Expand Down
4 changes: 2 additions & 2 deletions vavr-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
<version>15.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package io.vavr.collection;

import io.vavr.JmhRunner;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package io.vavr.collection;

import io.vavr.JmhRunner;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;

import static io.vavr.JmhRunner.create;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package io.vavr.collection;

import io.vavr.JmhRunner;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;

import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package io.vavr.collection;

import io.vavr.JmhRunner;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;

import static io.vavr.JmhRunner.create;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import io.vavr.JmhRunner;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package io.vavr.collection;

import io.vavr.JmhRunner;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import io.vavr.Function1;
import io.vavr.JmhRunner;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import fj.P;
import io.vavr.JmhRunner;
import io.vavr.Tuple2;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;
import scala.math.Ordering;
import scala.math.Ordering$;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package io.vavr.collection;

import io.vavr.JmhRunner;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;
import scala.collection.generic.CanBuildFrom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.vavr.Lazy;
import io.vavr.collection.Array;
import io.vavr.collection.Iterator;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import io.vavr.JmhRunner;
import io.vavr.collection.Array;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import io.vavr.JmhRunner;
import io.vavr.collection.Array;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import io.vavr.JmhRunner;
import io.vavr.collection.Array;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import io.vavr.JmhRunner;
import io.vavr.Tuple;
import io.vavr.collection.Array;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
Expand Down
4 changes: 2 additions & 2 deletions vavr-match-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions vavr-test/generator/Generator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def generateTestClasses(): Unit = {
val tuple = im.getType("io.vavr.Tuple")

// test classes
val test = im.getType("org.junit.Test")
val test = im.getType("org.junit.jupiter.api.Test")
val assertThat = im.getStatic("org.assertj.core.api.Assertions.assertThat")
val woops = "yay! (this is a negative test)"

Expand Down Expand Up @@ -577,7 +577,7 @@ def generateTestClasses(): Unit = {
val args = (1 to i).gen(j => s"o$j")(", ")

// test classes
val test = im.getType("org.junit.Test")
val test = im.getType("org.junit.jupiter.api.Test")
val assertThat = im.getStatic("org.assertj.core.api.Assertions.assertThat")
val woops = "yay! (this is a negative test)"

Expand Down
4 changes: 2 additions & 2 deletions vavr-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.vavr.CheckedFunction1;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyCheck1Test {

Expand Down Expand Up @@ -118,4 +118,4 @@ public void shouldReturnErroneousProperty1CheckResultIfArbitraryFails() {
.check();
assertThat(result.isErroneous()).isTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.vavr.CheckedFunction2;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyCheck2Test {

Expand Down Expand Up @@ -118,4 +118,4 @@ public void shouldReturnErroneousProperty2CheckResultIfArbitraryFails() {
.check();
assertThat(result.isErroneous()).isTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.vavr.CheckedFunction3;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyCheck3Test {

Expand Down Expand Up @@ -118,4 +118,4 @@ public void shouldReturnErroneousProperty3CheckResultIfArbitraryFails() {
.check();
assertThat(result.isErroneous()).isTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.vavr.CheckedFunction4;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyCheck4Test {

Expand Down Expand Up @@ -118,4 +118,4 @@ public void shouldReturnErroneousProperty4CheckResultIfArbitraryFails() {
.check();
assertThat(result.isErroneous()).isTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.vavr.CheckedFunction5;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyCheck5Test {

Expand Down Expand Up @@ -118,4 +118,4 @@ public void shouldReturnErroneousProperty5CheckResultIfArbitraryFails() {
.check();
assertThat(result.isErroneous()).isTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.vavr.CheckedFunction6;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyCheck6Test {

Expand Down Expand Up @@ -118,4 +118,4 @@ public void shouldReturnErroneousProperty6CheckResultIfArbitraryFails() {
.check();
assertThat(result.isErroneous()).isTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.vavr.CheckedFunction7;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyCheck7Test {

Expand Down Expand Up @@ -118,4 +118,4 @@ public void shouldReturnErroneousProperty7CheckResultIfArbitraryFails() {
.check();
assertThat(result.isErroneous()).isTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.vavr.CheckedFunction8;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyCheck8Test {

Expand Down Expand Up @@ -118,4 +118,4 @@ public void shouldReturnErroneousProperty8CheckResultIfArbitraryFails() {
.check();
assertThat(result.isErroneous()).isTrue();
}
}
}
4 changes: 2 additions & 2 deletions vavr-test/src-gen/test/java/io/vavr/test/PropertyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import io.vavr.Tuple;
import io.vavr.collection.List;
import java.util.Random;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PropertyTest {

Expand Down Expand Up @@ -239,4 +239,4 @@ public void shouldCheckOrCombinationWhereFirstPropertyIsFalseAndSecondPropertyIs
final CheckResult result = p1.or(p2).check();
assertThat(result.isSatisfied()).isFalse();
}
}
}
2 changes: 1 addition & 1 deletion vavr-test/src/test/java/io/vavr/test/ArbitraryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io.vavr.collection.Iterator;
import io.vavr.collection.List;
import io.vavr.collection.Stream;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
Expand Down
2 changes: 1 addition & 1 deletion vavr-test/src/test/java/io/vavr/test/CheckResultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import io.vavr.Tuple;
import io.vavr.control.Option;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Objects;

Expand Down
2 changes: 1 addition & 1 deletion vavr-test/src/test/java/io/vavr/test/ConditionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package io.vavr.test;

import io.vavr.test.Property.Condition;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
2 changes: 1 addition & 1 deletion vavr-test/src/test/java/io/vavr/test/GenTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.vavr.collection.Stream;
import io.vavr.Tuple2;
import io.vavr.collection.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.Random;
Expand Down
Loading

0 comments on commit eda96e6

Please sign in to comment.