diff options
Diffstat (limited to 'javaparser-testing/src')
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(); |