aboutsummaryrefslogtreecommitdiffstats
path: root/javaparser-testing
diff options
context:
space:
mode:
authorDanny van Bruggen <hexagonaal@gmail.com>2018-02-03 22:09:35 +0100
committerDanny van Bruggen <hexagonaal@gmail.com>2018-02-03 22:09:35 +0100
commit6036e9961e7f8ea8f94c7d9b3ab9160b517d156b (patch)
tree595d8bd2f58a198df716ea39d2a8060e44781b3a /javaparser-testing
parent9f20df294175a8dcc2f0c1331c818589c5de9cb4 (diff)
downloadplatform_external_javaparser-6036e9961e7f8ea8f94c7d9b3ab9160b517d156b.tar.gz
platform_external_javaparser-6036e9961e7f8ea8f94c7d9b3ab9160b517d156b.tar.bz2
platform_external_javaparser-6036e9961e7f8ea8f94c7d9b3ab9160b517d156b.zip
Add postprocessing chain
Diffstat (limited to 'javaparser-testing')
-rw-r--r--javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java1_0ValidatorTest.java2
-rw-r--r--javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java7ValidatorTest.java8
-rw-r--r--javaparser-testing/src/test/java/com/github/javaparser/utils/SourceRootTest.java4
3 files changed, 4 insertions, 10 deletions
diff --git a/javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java1_0ValidatorTest.java b/javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java1_0ValidatorTest.java
index 09eb39d76..6606d2ec6 100644
--- a/javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java1_0ValidatorTest.java
+++ b/javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java1_0ValidatorTest.java
@@ -91,7 +91,7 @@ public class Java1_0ValidatorTest {
public void nonEmptyList() {
ArrayCreationExpr expr = new ArrayCreationExpr(PrimitiveType.booleanType());
List<Problem> problems= new ArrayList<>();
- new Java1_0Validator().accept(expr, new ProblemReporter(problems));
+ new Java1_0Validator().accept(expr, new ProblemReporter(problems::add));
assertEquals("ArrayCreationExpr.levels can not be empty.", problems.get(0).getMessage());
}
}
diff --git a/javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java7ValidatorTest.java b/javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java7ValidatorTest.java
index 6bf000d26..e72cd83ba 100644
--- a/javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java7ValidatorTest.java
+++ b/javaparser-testing/src/test/java/com/github/javaparser/ast/validator/Java7ValidatorTest.java
@@ -5,7 +5,6 @@ import com.github.javaparser.ParseResult;
import com.github.javaparser.ParserConfiguration;
import com.github.javaparser.Problem;
import com.github.javaparser.ast.CompilationUnit;
-import com.github.javaparser.ast.NodeList;
import com.github.javaparser.ast.expr.Expression;
import com.github.javaparser.ast.stmt.Statement;
import com.github.javaparser.ast.type.ClassOrInterfaceType;
@@ -13,14 +12,11 @@ import com.github.javaparser.ast.type.UnionType;
import org.junit.Test;
import java.util.*;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
import static com.github.javaparser.ParseStart.COMPILATION_UNIT;
import static com.github.javaparser.ParseStart.EXPRESSION;
import static com.github.javaparser.ParseStart.STATEMENT;
import static com.github.javaparser.Providers.provider;
-import static com.github.javaparser.utils.TestUtils.assertCollections;
import static com.github.javaparser.utils.TestUtils.assertNoProblems;
import static com.github.javaparser.utils.TestUtils.assertProblems;
@@ -86,7 +82,7 @@ public class Java7ValidatorTest {
UnionType unionType = new UnionType();
List<Problem> problems = new ArrayList<>();
- javaParser.getParserConfiguration().getValidator().accept(unionType, new ProblemReporter(problems));
+ javaParser.getParserConfiguration().getValidator().get().accept(unionType, new ProblemReporter(problems::add));
assertProblems(problems, "UnionType.elements can not be empty.");
}
@@ -97,7 +93,7 @@ public class Java7ValidatorTest {
unionType.getElements().add(new ClassOrInterfaceType());
List<Problem> problems = new ArrayList<>();
- javaParser.getParserConfiguration().getValidator().accept(unionType, new ProblemReporter(problems));
+ javaParser.getParserConfiguration().getValidator().get().accept(unionType, new ProblemReporter(problems::add));
assertProblems(problems, "Union type (multi catch) must have at least two elements.");
}
diff --git a/javaparser-testing/src/test/java/com/github/javaparser/utils/SourceRootTest.java b/javaparser-testing/src/test/java/com/github/javaparser/utils/SourceRootTest.java
index fff017182..a0bb50e2e 100644
--- a/javaparser-testing/src/test/java/com/github/javaparser/utils/SourceRootTest.java
+++ b/javaparser-testing/src/test/java/com/github/javaparser/utils/SourceRootTest.java
@@ -6,10 +6,8 @@ import org.junit.Test;
import java.io.File;
import java.io.IOException;
-import java.net.URISyntaxException;
import java.nio.file.Path;
import java.util.List;
-import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -19,7 +17,7 @@ public class SourceRootTest {
private final SourceRoot sourceRoot = new SourceRoot(root);
@Test
- public void parseTestDirectory() throws URISyntaxException, IOException {
+ public void parseTestDirectory() throws IOException {
List<ParseResult<CompilationUnit>> parseResults = sourceRoot.tryToParse();
List<CompilationUnit> units = sourceRoot.getCompilationUnits();