Skip to content

Commit 5f268af

Browse files
committed
Convert remaining tests to JUnit Jupiter
1 parent 1c4241a commit 5f268af

File tree

58 files changed

+464
-475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+464
-475
lines changed

jme3-android-examples/src/test/java/org/jmonkeyengine/jme3androidexamples/ExampleUnitTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.jmonkeyengine.jme3androidexamples;
22

3-
import org.junit.Test;
3+
import org.junit.jupiter.api.Test;
44

5-
import static org.junit.Assert.*;
5+
import static org.junit.jupiter.api.Assertions.*;
66

77
/**
88
* To work on unit tests, switch the Test Artifact in the Build Variants view.

jme3-core/src/test/java/com/jme3/anim/ArmatureMaskTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
*/
3232
package com.jme3.anim;
3333

34-
import org.junit.Assert;
35-
import org.junit.Test;
34+
import org.junit.jupiter.api.Assertions;
35+
import org.junit.jupiter.api.Test;
3636

3737
/**
3838
* Test constructors and modification methods of the ArmatureMask class.
@@ -81,7 +81,7 @@ public void testMaskAll() {
8181

8282
for (ArmatureMask testMask : maskArray) {
8383
for (Joint testJoint : jointList) {
84-
Assert.assertTrue(testMask.contains(testJoint));
84+
Assertions.assertTrue(testMask.contains(testJoint));
8585
}
8686
}
8787
}
@@ -104,7 +104,7 @@ public void testMaskNone() {
104104

105105
for (ArmatureMask testMask : maskArray) {
106106
for (Joint testJoint : jointList) {
107-
Assert.assertFalse(testMask.contains(testJoint));
107+
Assertions.assertFalse(testMask.contains(testJoint));
108108
}
109109
}
110110
}
@@ -132,9 +132,9 @@ public void testMask12() {
132132
for (ArmatureMask testMask : maskArray) {
133133
for (Joint testJoint : jointList) {
134134
if (testJoint == j1 || testJoint == j2) {
135-
Assert.assertTrue(testMask.contains(testJoint));
135+
Assertions.assertTrue(testMask.contains(testJoint));
136136
} else {
137-
Assert.assertFalse(testMask.contains(testJoint));
137+
Assertions.assertFalse(testMask.contains(testJoint));
138138
}
139139
}
140140
}

jme3-core/src/test/java/com/jme3/anim/JointCloneTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
package com.jme3.anim;
3333

3434
import com.jme3.util.clone.Cloner;
35-
import org.junit.Assert;
36-
import org.junit.Test;
35+
import org.junit.jupiter.api.Assertions;
36+
import org.junit.jupiter.api.Test;
3737

3838
/**
3939
* Test cloning a Joint.
@@ -49,11 +49,11 @@ public class JointCloneTest {
4949
@Test
5050
public void testInitialTransform() {
5151
Joint testJoint = new Joint("testJoint");
52-
Assert.assertTrue(testJoint.getInitialTransform().isIdentity());
52+
Assertions.assertTrue(testJoint.getInitialTransform().isIdentity());
5353

5454
Joint clone = Cloner.deepClone(testJoint);
5555
clone.getInitialTransform().setScale(2f);
5656

57-
Assert.assertTrue(testJoint.getInitialTransform().isIdentity());
57+
Assertions.assertTrue(testJoint.getInitialTransform().isIdentity());
5858
}
5959
}

jme3-core/src/test/java/com/jme3/anim/tween/action/ClipActionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
package com.jme3.anim.tween.action;
3333

3434
import com.jme3.anim.AnimClip;
35-
import org.junit.Test;
36-
import static org.junit.Assert.assertEquals;
37-
import static org.junit.Assert.assertThrows;
35+
import org.junit.jupiter.api.Test;
36+
import static org.junit.jupiter.api.Assertions.assertEquals;
37+
import static org.junit.jupiter.api.Assertions.assertThrows;
3838

3939
/**
4040
* Test for ClipAction.

jme3-core/src/test/java/com/jme3/asset/LoadShaderSourceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import com.jme3.shader.plugins.GLSLLoader;
3636
import com.jme3.system.JmeSystem;
3737
import com.jme3.system.MockJmeSystemDelegate;
38-
import org.junit.Test;
38+
import org.junit.jupiter.api.Test;
3939

4040
public class LoadShaderSourceTest {
4141

jme3-core/src/test/java/com/jme3/audio/AudioFilterTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import com.jme3.asset.AssetManager;
44
import com.jme3.asset.DesktopAssetManager;
55
import com.jme3.export.binary.BinaryExporter;
6-
import org.junit.Assert;
7-
import org.junit.Test;
6+
import org.junit.jupiter.api.Assertions;
7+
import org.junit.jupiter.api.Test;
88

99
/**
1010
* Automated tests for the Filter class.
@@ -24,8 +24,8 @@ public void testSaveAndLoad_LowPassFilter() {
2424
LowPassFilter copy = BinaryExporter.saveAndLoad(assetManager, f);
2525

2626
float delta = 0.001f;
27-
Assert.assertEquals(f.getVolume(), copy.getVolume(), delta);
28-
Assert.assertEquals(f.getHighFreqVolume(), copy.getHighFreqVolume(), delta);
27+
Assertions.assertEquals(f.getVolume(), copy.getVolume(), delta);
28+
Assertions.assertEquals(f.getHighFreqVolume(), copy.getHighFreqVolume(), delta);
2929
}
3030

3131
/**
@@ -39,8 +39,8 @@ public void testSaveAndLoad_HighPassFilter() {
3939
HighPassFilter copy = BinaryExporter.saveAndLoad(assetManager, f);
4040

4141
float delta = 0.001f;
42-
Assert.assertEquals(f.getVolume(), copy.getVolume(), delta);
43-
Assert.assertEquals(f.getLowFreqVolume(), copy.getLowFreqVolume(), delta);
42+
Assertions.assertEquals(f.getVolume(), copy.getVolume(), delta);
43+
Assertions.assertEquals(f.getLowFreqVolume(), copy.getLowFreqVolume(), delta);
4444
}
4545

4646
/**
@@ -54,9 +54,9 @@ public void testSaveAndLoad_BandPassFilter() {
5454
BandPassFilter copy = BinaryExporter.saveAndLoad(assetManager, f);
5555

5656
float delta = 0.001f;
57-
Assert.assertEquals(f.getVolume(), copy.getVolume(), delta);
58-
Assert.assertEquals(f.getHighFreqVolume(), copy.getHighFreqVolume(), delta);
59-
Assert.assertEquals(f.getLowFreqVolume(), copy.getLowFreqVolume(), delta);
57+
Assertions.assertEquals(f.getVolume(), copy.getVolume(), delta);
58+
Assertions.assertEquals(f.getHighFreqVolume(), copy.getHighFreqVolume(), delta);
59+
Assertions.assertEquals(f.getLowFreqVolume(), copy.getLowFreqVolume(), delta);
6060
}
6161

6262
}

jme3-core/src/test/java/com/jme3/audio/AudioNodeTest.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import com.jme3.asset.AssetManager;
44
import com.jme3.math.Vector3f;
55
import com.jme3.system.JmeSystem;
6-
import org.junit.Assert;
7-
import org.junit.Test;
6+
import org.junit.jupiter.api.Assertions;
7+
import org.junit.jupiter.api.Test;
88

99
/**
1010
* Automated tests for the {@code AudioNode} class.
@@ -26,23 +26,23 @@ public void testAudioNodeClone() {
2626

2727
AudioNode clone = audio.clone();
2828

29-
Assert.assertNotNull(clone.previousWorldTranslation);
30-
Assert.assertNotSame(audio.previousWorldTranslation, clone.previousWorldTranslation);
31-
Assert.assertEquals(audio.previousWorldTranslation, clone.previousWorldTranslation);
29+
Assertions.assertNotNull(clone.previousWorldTranslation);
30+
Assertions.assertNotSame(audio.previousWorldTranslation, clone.previousWorldTranslation);
31+
Assertions.assertEquals(audio.previousWorldTranslation, clone.previousWorldTranslation);
3232

33-
Assert.assertNotNull(clone.getDirection());
34-
Assert.assertNotSame(audio.getDirection(), clone.getDirection());
35-
Assert.assertEquals(audio.getDirection(), clone.getDirection());
33+
Assertions.assertNotNull(clone.getDirection());
34+
Assertions.assertNotSame(audio.getDirection(), clone.getDirection());
35+
Assertions.assertEquals(audio.getDirection(), clone.getDirection());
3636

37-
Assert.assertNotNull(clone.getVelocity());
38-
Assert.assertNotSame(audio.getVelocity(), clone.getVelocity());
39-
Assert.assertEquals(audio.getVelocity(), clone.getVelocity());
37+
Assertions.assertNotNull(clone.getVelocity());
38+
Assertions.assertNotSame(audio.getVelocity(), clone.getVelocity());
39+
Assertions.assertEquals(audio.getVelocity(), clone.getVelocity());
4040

41-
Assert.assertNotNull(clone.getDryFilter());
42-
Assert.assertNotSame(audio.getDryFilter(), clone.getDryFilter());
41+
Assertions.assertNotNull(clone.getDryFilter());
42+
Assertions.assertNotSame(audio.getDryFilter(), clone.getDryFilter());
4343

44-
Assert.assertNotNull(clone.getReverbFilter());
45-
Assert.assertNotSame(audio.getReverbFilter(), clone.getReverbFilter());
44+
Assertions.assertNotNull(clone.getReverbFilter());
45+
Assertions.assertNotSame(audio.getReverbFilter(), clone.getReverbFilter());
4646
}
4747

4848
}

jme3-core/src/test/java/com/jme3/bounding/TestBoundingBox.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
package com.jme3.bounding;
3333

3434
import com.jme3.math.Vector3f;
35-
import org.junit.Assert;
36-
import org.junit.Test;
35+
import org.junit.jupiter.api.Assertions;
36+
import org.junit.jupiter.api.Test;
3737

3838
/**
3939
* Test cases for the BoundingBox class.
@@ -59,16 +59,16 @@ public void testEquals() {
5959
bb6.setCheckPlane(1);
6060

6161
// Clones are equal to their base instances:
62-
Assert.assertEquals(bb1, bb1.clone());
63-
Assert.assertEquals(bb2, bb2.clone());
64-
Assert.assertEquals(bb3, bb3.clone());
65-
Assert.assertEquals(bb4, bb4.clone());
66-
Assert.assertEquals(bb5, bb5.clone());
67-
Assert.assertEquals(bb6, bb6.clone());
68-
69-
Assert.assertNotEquals(bb1, bb2); // because their extents differ
70-
Assert.assertNotEquals(bb3, bb4); // because their centers differ
71-
Assert.assertEquals(bb5, bb6); // because check planes are ignored
62+
Assertions.assertEquals(bb1, bb1.clone());
63+
Assertions.assertEquals(bb2, bb2.clone());
64+
Assertions.assertEquals(bb3, bb3.clone());
65+
Assertions.assertEquals(bb4, bb4.clone());
66+
Assertions.assertEquals(bb5, bb5.clone());
67+
Assertions.assertEquals(bb6, bb6.clone());
68+
69+
Assertions.assertNotEquals(bb1, bb2); // because their extents differ
70+
Assertions.assertNotEquals(bb3, bb4); // because their centers differ
71+
Assertions.assertEquals(bb5, bb6); // because check planes are ignored
7272
}
7373

7474
/**
@@ -86,10 +86,10 @@ public void testMergeModifiesReceiver() {
8686
BoundingVolume result = bb1.merge(bb2);
8787

8888
// merge() delegates to mergeLocal(), so bb1 IS modified.
89-
Assert.assertNotEquals(bb1Before, bb1);
89+
Assertions.assertNotEquals(bb1Before, bb1);
9090

9191
// The result is the same object as bb1.
92-
Assert.assertSame(bb1, result);
92+
Assertions.assertSame(bb1, result);
9393
}
9494

9595
/**
@@ -107,16 +107,16 @@ public void testMergeWithDoesNotModifyReceiver() {
107107
BoundingVolume result = bb1.mergeWith(bb2);
108108

109109
// bb1 must be unmodified.
110-
Assert.assertEquals(bb1Before, bb1);
110+
Assertions.assertEquals(bb1Before, bb1);
111111

112112
// The result must be a different object than bb1.
113-
Assert.assertNotSame(bb1, result);
113+
Assertions.assertNotSame(bb1, result);
114114

115115
// The result must contain both inputs' centers.
116-
Assert.assertTrue(result instanceof BoundingBox);
116+
Assertions.assertTrue(result instanceof BoundingBox);
117117
BoundingBox merged = (BoundingBox) result;
118-
Assert.assertTrue(merged.contains(bb2.getCenter()));
119-
Assert.assertTrue(merged.contains(bb1.getCenter()));
118+
Assertions.assertTrue(merged.contains(bb2.getCenter()));
119+
Assertions.assertTrue(merged.contains(bb1.getCenter()));
120120
}
121121

122122
/**
@@ -136,12 +136,12 @@ public void testIsSimilar() {
136136
BoundingBox bb6 = (BoundingBox) bb5.clone();
137137
bb6.setCheckPlane(1);
138138

139-
Assert.assertFalse(bb1.isSimilar(bb2, 0.09999f));
140-
Assert.assertTrue(bb1.isSimilar(bb2, 0.10001f));
139+
Assertions.assertFalse(bb1.isSimilar(bb2, 0.09999f));
140+
Assertions.assertTrue(bb1.isSimilar(bb2, 0.10001f));
141141

142-
Assert.assertFalse(bb3.isSimilar(bb4, 0.09999f));
143-
Assert.assertTrue(bb3.isSimilar(bb4, 0.10001f));
142+
Assertions.assertFalse(bb3.isSimilar(bb4, 0.09999f));
143+
Assertions.assertTrue(bb3.isSimilar(bb4, 0.10001f));
144144

145-
Assert.assertTrue(bb5.isSimilar(bb6, 0f)); // check planes are ignored
145+
Assertions.assertTrue(bb5.isSimilar(bb6, 0f)); // check planes are ignored
146146
}
147147
}

jme3-core/src/test/java/com/jme3/bounding/TestBoundingSphere.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
package com.jme3.bounding;
3333

3434
import com.jme3.math.Vector3f;
35-
import org.junit.Assert;
36-
import org.junit.Test;
35+
import org.junit.jupiter.api.Assertions;
36+
import org.junit.jupiter.api.Test;
3737

3838
/**
3939
* Test cases for the BoundingSphere class.
@@ -57,16 +57,16 @@ public void testEquals() {
5757
bs6.setCheckPlane(1);
5858

5959
// Clones are equal to their base instances:
60-
Assert.assertEquals(bs1, bs1.clone());
61-
Assert.assertEquals(bs2, bs2.clone());
62-
Assert.assertEquals(bs3, bs3.clone());
63-
Assert.assertEquals(bs4, bs4.clone());
64-
Assert.assertEquals(bs5, bs5.clone());
65-
Assert.assertEquals(bs6, bs6.clone());
66-
67-
Assert.assertNotEquals(bs1, bs2); // because their radii differ
68-
Assert.assertNotEquals(bs3, bs4); // because their centers differ
69-
Assert.assertEquals(bs5, bs6); // because check planes are ignored
60+
Assertions.assertEquals(bs1, bs1.clone());
61+
Assertions.assertEquals(bs2, bs2.clone());
62+
Assertions.assertEquals(bs3, bs3.clone());
63+
Assertions.assertEquals(bs4, bs4.clone());
64+
Assertions.assertEquals(bs5, bs5.clone());
65+
Assertions.assertEquals(bs6, bs6.clone());
66+
67+
Assertions.assertNotEquals(bs1, bs2); // because their radii differ
68+
Assertions.assertNotEquals(bs3, bs4); // because their centers differ
69+
Assertions.assertEquals(bs5, bs6); // because check planes are ignored
7070
}
7171

7272
/**
@@ -84,13 +84,13 @@ public void testIsSimilar() {
8484
BoundingSphere bs6 = (BoundingSphere) bs5.clone();
8585
bs6.setCheckPlane(1);
8686

87-
Assert.assertFalse(bs1.isSimilar(bs2, 0.09999f));
88-
Assert.assertTrue(bs1.isSimilar(bs2, 0.10001f));
87+
Assertions.assertFalse(bs1.isSimilar(bs2, 0.09999f));
88+
Assertions.assertTrue(bs1.isSimilar(bs2, 0.10001f));
8989

90-
Assert.assertFalse(bs3.isSimilar(bs4, 0.09999f));
91-
Assert.assertTrue(bs3.isSimilar(bs4, 0.10001f));
90+
Assertions.assertFalse(bs3.isSimilar(bs4, 0.09999f));
91+
Assertions.assertTrue(bs3.isSimilar(bs4, 0.10001f));
9292

93-
Assert.assertTrue(bs5.isSimilar(bs6, 0f)); // check planes are ignored
93+
Assertions.assertTrue(bs5.isSimilar(bs6, 0f)); // check planes are ignored
9494
}
9595

9696
/**
@@ -112,6 +112,6 @@ public void testIssue1459() {
112112

113113
Vector3f copyCenter = new Vector3f();
114114
boundingSphere.getCenter(copyCenter);
115-
Assert.assertTrue(Vector3f.isValidVector(copyCenter));
115+
Assertions.assertTrue(Vector3f.isValidVector(copyCenter));
116116
}
117117
}

jme3-core/src/test/java/com/jme3/cinematic/CinematicTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import com.jme3.animation.Animation;
3636
import com.jme3.cinematic.events.AnimationEvent;
3737
import com.jme3.scene.Node;
38-
import org.junit.Test;
38+
import org.junit.jupiter.api.Test;
3939

4040
/**
4141
*

0 commit comments

Comments
 (0)