Skip to content

Commit 5d262a2

Browse files
committed
java: Fix junit export
1 parent 32cf5de commit 5d262a2

File tree

8 files changed

+41
-73
lines changed

8 files changed

+41
-73
lines changed

ortools/algorithms/java/KnapsackSolverTest.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@
1313

1414
package com.google.ortools.algorithms;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertNotNull;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1818

1919
import com.google.ortools.Loader;
20-
import org.junit.Before;
21-
import org.junit.Test;
22-
import org.junit.runner.RunWith;
23-
import org.junit.runners.JUnit4;
20+
import org.junit.jupiter.api.BeforeEach;
21+
import org.junit.jupiter.api.Test;
2422

2523
/** Test the Knapsack solver java interface. */
26-
@RunWith(JUnit4.class)
2724
public final class KnapsackSolverTest {
28-
@SuppressWarnings("EmptyMethods")
29-
@Before
25+
@BeforeEach
3026
public void setUp() {
3127
Loader.loadNativeLibraries();
3228
}

ortools/constraint_solver/java/ConstraintSolverTest.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
package com.google.ortools.constraintsolver;
1515

1616
import static com.google.common.truth.Truth.assertThat;
17-
import static org.junit.Assert.assertEquals;
18-
import static org.junit.Assert.assertFalse;
19-
import static org.junit.Assert.assertNotNull;
20-
import static org.junit.Assert.assertTrue;
17+
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.junit.jupiter.api.Assertions.assertFalse;
19+
import static org.junit.jupiter.api.Assertions.assertNotNull;
20+
import static org.junit.jupiter.api.Assertions.assertTrue;
2121

2222
import com.google.common.collect.Iterables;
2323
import com.google.ortools.Loader;
@@ -27,16 +27,12 @@
2727
import java.util.concurrent.atomic.AtomicInteger;
2828
import java.util.function.Consumer;
2929
import java.util.function.Supplier;
30-
import org.junit.Before;
31-
import org.junit.Test;
32-
import org.junit.runner.RunWith;
33-
import org.junit.runners.JUnit4;
30+
import org.junit.jupiter.api.BeforeEach;
31+
import org.junit.jupiter.api.Test;
3432

3533
/** Tests the Constraint solver java interface. */
36-
@RunWith(JUnit4.class)
3734
public final class ConstraintSolverTest {
38-
@SuppressWarnings("EmptyMethods")
39-
@Before
35+
@BeforeEach
4036
public void setUp() {
4137
Loader.loadNativeLibraries();
4238
}

ortools/graph/java/FlowTest.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@
1313

1414
package com.google.ortools.graph;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertNotNull;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1818

1919
import com.google.ortools.Loader;
20-
import org.junit.Before;
21-
import org.junit.Test;
22-
import org.junit.runner.RunWith;
23-
import org.junit.runners.JUnit4;
20+
import org.junit.jupiter.api.BeforeEach;
21+
import org.junit.jupiter.api.Test;
2422

2523
/** Test the Min/Max Flow solver java interface. */
26-
@RunWith(JUnit4.class)
2724
public final class FlowTest {
28-
@SuppressWarnings("EmptyMethods")
29-
@Before
25+
@BeforeEach
3026
public void setUp() {
3127
Loader.loadNativeLibraries();
3228
}

ortools/linear_solver/java/LinearSolverTest.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
package com.google.ortools.linearsolver;
1515

1616
import static com.google.common.truth.Truth.assertThat;
17-
import static org.junit.Assert.assertEquals;
18-
import static org.junit.Assert.assertFalse;
19-
import static org.junit.Assert.assertNotNull;
20-
import static org.junit.Assert.assertTrue;
17+
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.junit.jupiter.api.Assertions.assertFalse;
19+
import static org.junit.jupiter.api.Assertions.assertNotNull;
20+
import static org.junit.jupiter.api.Assertions.assertTrue;
2121

2222
import com.google.ortools.Loader;
2323
import com.google.ortools.linearsolver.MPConstraintProto;
@@ -27,20 +27,16 @@
2727
import com.google.ortools.linearsolver.MPSolverResponseStatus;
2828
import com.google.ortools.linearsolver.MPVariableProto;
2929
import com.google.ortools.linearsolver.PartialVariableAssignment;
30-
import org.junit.Before;
31-
import org.junit.Test;
32-
import org.junit.runner.RunWith;
33-
import org.junit.runners.JUnit4;
30+
import org.junit.jupiter.api.BeforeEach;
31+
import org.junit.jupiter.api.Test;
3432

3533
/** Test the Linear Solver java interface. */
36-
@RunWith(JUnit4.class)
3734
public final class LinearSolverTest {
3835
// Numerical tolerance for checking primal, dual, objective values
3936
// and other values.
4037
private static final double NUM_TOLERANCE = 1e-5;
4138

42-
@SuppressWarnings("EmptyMethods")
43-
@Before
39+
@BeforeEach
4440
public void setUp() {
4541
Loader.loadNativeLibraries();
4642
}

ortools/linear_solver/java/ModelBuilderTest.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@
1717

1818
import com.google.ortools.Loader;
1919
import java.time.Duration;
20-
import org.junit.Before;
21-
import org.junit.Test;
22-
import org.junit.runner.RunWith;
23-
import org.junit.runners.JUnit4;
20+
import org.junit.jupiter.api.BeforeEach;
21+
import org.junit.jupiter.api.Test;
2422

25-
@RunWith(JUnit4.class)
2623
public final class ModelBuilderTest {
27-
@SuppressWarnings("EmptyMethods")
28-
@Before
24+
@BeforeEach
2925
public void setUp() {
3026
Loader.loadNativeLibraries();
3127
}

ortools/sat/java/CpModelTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
package com.google.ortools.sat;
1515

1616
import static com.google.common.truth.Truth.assertThat;
17-
import static org.junit.Assert.assertNotNull;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1818

1919
import com.google.ortools.Loader;
2020
import com.google.ortools.sat.CpSolverStatus;
@@ -27,16 +27,12 @@
2727
import java.util.List;
2828
import java.util.Random;
2929
import java.util.function.Consumer;
30-
import org.junit.Before;
31-
import org.junit.Test;
32-
import org.junit.runner.RunWith;
33-
import org.junit.runners.JUnit4;
30+
import org.junit.jupiter.api.BeforeEach;
31+
import org.junit.jupiter.api.Test;
3432

3533
/** Tests the CpSolver java interface. */
36-
@RunWith(JUnit4.class)
3734
public final class CpModelTest {
38-
@SuppressWarnings("EmptyMethods")
39-
@Before
35+
@BeforeEach
4036
public void setUp() {
4137
Loader.loadNativeLibraries();
4238
}

ortools/sat/java/CpSolverTest.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,19 @@
1414
package com.google.ortools.sat;
1515

1616
import static com.google.common.truth.Truth.assertThat;
17-
import static org.junit.Assert.assertEquals;
18-
import static org.junit.Assert.assertNotNull;
17+
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1919

2020
import com.google.ortools.Loader;
2121
import com.google.ortools.sat.CpSolverStatus;
2222
import com.google.ortools.util.Domain;
2323
import java.util.function.Consumer;
24-
import org.junit.Before;
25-
import org.junit.Test;
26-
import org.junit.runner.RunWith;
27-
import org.junit.runners.JUnit4;
24+
import org.junit.jupiter.api.BeforeEach;
25+
import org.junit.jupiter.api.Test;
2826

2927
/** Tests the CpSolver java interface. */
30-
@RunWith(JUnit4.class)
3128
public final class CpSolverTest {
32-
@SuppressWarnings("EmptyMethods")
33-
@Before
29+
@BeforeEach
3430
public void setUp() {
3531
Loader.loadNativeLibraries();
3632
}

ortools/sat/java/LinearExprTest.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,16 @@
1414
package com.google.ortools.sat;
1515

1616
import static com.google.common.truth.Truth.assertThat;
17-
import static org.junit.Assert.assertEquals;
18-
import static org.junit.Assert.assertNotNull;
17+
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1919

2020
import com.google.ortools.Loader;
2121
import com.google.ortools.util.Domain;
22-
import org.junit.Before;
23-
import org.junit.Test;
24-
import org.junit.runner.RunWith;
25-
import org.junit.runners.JUnit4;
22+
import org.junit.jupiter.api.BeforeEach;
23+
import org.junit.jupiter.api.Test;
2624

27-
@RunWith(JUnit4.class)
2825
public final class LinearExprTest {
29-
@SuppressWarnings("EmptyMethods")
30-
@Before
26+
@BeforeEach
3127
public void setUp() {
3228
Loader.loadNativeLibraries();
3329
}

0 commit comments

Comments
 (0)