actions = result.getRootOperations();
result.debugInformation();
- assertEquals(3, actions.size());
+ assertEquals(1, actions.size());
assertTrue(result.containsOperation(OperationKind.Insert, "Method", "testClear"));
}
@@ -975,11 +961,11 @@ public void test_t_224890() throws Exception {
* reproducible when using a Java debugger even without any breakpoint - it
* appears when changing the version of Spoon but without clear relation of what
* changes
- *
+ *
* Given those information we think that the bug might be related with some
* optimization done in JVM or with the order of loading classes.
*/
- @Ignore
+ @Disabled
@Test
public void test_t_225008() throws Exception {
AstComparator diff = new AstComparator();
@@ -997,7 +983,7 @@ public void test_t_225008() throws Exception {
stringBuilder.append("\n");
}
- assertEquals("Actions: " + stringBuilder.toString(), 1, actions.size());
+ assertEquals(1, actions.size(), "Actions: " + stringBuilder);
assertTrue(result.containsOperation(OperationKind.Update, "Modifier", "protected"));
}
@@ -1118,7 +1104,7 @@ public void test_t_225262() throws Exception {
}
@Test
- @Ignore("Edit script generated is too complex. Ignoring in order to upgrade to GT3")
+ @Disabled("Edit script generated is too complex. Ignoring in order to upgrade to GT3")
public void test_t_225391() throws Exception {
AstComparator diff = new AstComparator();
// meld src/test/resources/examples/t_225391/left_IndexHTML_1.4.java
@@ -1126,7 +1112,6 @@ public void test_t_225391() throws Exception {
File fl = new File("src/test/resources/examples/t_225391/left_IndexHTML_1.4.java");
File fr = new File("src/test/resources/examples/t_225391/right_IndexHTML_1.5.java");
-
Diff result = diff.compare(fl, fr);
@@ -1875,9 +1860,9 @@ public void testDiff1Comment() throws Exception {
AstComparator r = new AstComparator(includeComments);
Diff diffOut = r.compare(s, t);
System.out.println("Output: " + diffOut);
- Assert.assertEquals(1, diffOut.getRootOperations().size());
+ assertEquals(1, diffOut.getRootOperations().size());
Operation op = diffOut.getRootOperations().get(0);
- Assert.assertTrue(op.getSrcNode().getComments().size() > 0);
+ assertTrue(op.getSrcNode().getComments().size() > 0);
List allop = diffOut.getAllOperations();
boolean hasComment = false;
@@ -1897,7 +1882,7 @@ public void testDiff2Comment() throws Exception {
Diff diffOut = r.compare(s, t);
System.out.println("Output: " + diffOut);
- Assert.assertEquals(1, diffOut.getRootOperations().size());
+ assertEquals(1, diffOut.getRootOperations().size());
Operation op = diffOut.getRootOperations().get(0);
// Assert.assertTrue(op.getSrcNode().getComments().size() > 0);
@@ -1919,9 +1904,9 @@ public void testDiff3Comment() throws Exception {
Diff diffOut = r.compare(s, t);
System.out.println("Output: " + diffOut);
- Assert.assertEquals(1, diffOut.getRootOperations().size());
+ assertEquals(1, diffOut.getRootOperations().size());
Operation op = diffOut.getRootOperations().get(0);
- Assert.assertTrue(op.getSrcNode().getComments().size() > 0);
+ assertTrue(op.getSrcNode().getComments().size() > 0);
assertFalse(op.getSrcNode() instanceof CtComment);
@@ -1946,7 +1931,7 @@ public void testReplaceMovesFromRoot1() {
+ "};";
AstComparator diff = new AstComparator();
-
+
Diff editScript = diff.compare(c1, c2);
@@ -2110,8 +2095,8 @@ public void test264() throws Exception {
AstComparator r = new AstComparator(includeComments);
Diff diffOut = r.compare(s, t);
- Assert.assertEquals(3, diffOut.getRootOperations().size());
- Assert.assertEquals("Delete Literal at org.wso2.transport.http.netty.contractimpl.common.Util:147\n" +
+ assertEquals(3, diffOut.getRootOperations().size());
+ assertEquals("Delete Literal at org.wso2.transport.http.netty.contractimpl.common.Util:147\n" +
"\tfalse\n", diffOut.getRootOperations().get(0).toString());
}
diff --git a/src/test/java/gumtree/spoon/SourcePositionTest.java b/src/test/java/gumtree/spoon/SourcePositionTest.java
index 8db12af1..2908ca27 100644
--- a/src/test/java/gumtree/spoon/SourcePositionTest.java
+++ b/src/test/java/gumtree/spoon/SourcePositionTest.java
@@ -2,9 +2,9 @@
import com.github.gumtreediff.tree.Tree;
import gumtree.spoon.builder.SpoonGumTreeBuilder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
import spoon.Launcher;
import spoon.reflect.code.CtTypeAccess;
import spoon.reflect.declaration.CtElement;
@@ -13,30 +13,20 @@
import java.io.File;
import java.util.ArrayDeque;
import java.util.Arrays;
-import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Queue;
-import java.util.stream.Collectors;
+import java.util.stream.Stream;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-@RunWith(Parameterized.class)
public class SourcePositionTest {
- private File javaSourceFile;
- private String fileName;
-
- public SourcePositionTest(File javaSourceFile, String fileName) {
- this.javaSourceFile = javaSourceFile;
- this.fileName = fileName;
- }
-
- @Parameterized.Parameters(name = "{1}")
- public static Collection