Search in sources :

Example 6 with ArrayCreationExpr

use of com.github.javaparser.ast.expr.ArrayCreationExpr in project javaparser by javaparser.

the class Java1_0ValidatorTest method nonEmptyList.

@Test
public void nonEmptyList() {
    ArrayCreationExpr expr = new ArrayCreationExpr(PrimitiveType.booleanType());
    List<Problem> problems = new ArrayList<>();
    new Java1_0Validator().accept(expr, new ProblemReporter(problems::add));
    assertEquals("ArrayCreationExpr.levels can not be empty.", problems.get(0).getMessage());
}
Also used : ArrayList(java.util.ArrayList) Problem(com.github.javaparser.Problem) ArrayCreationExpr(com.github.javaparser.ast.expr.ArrayCreationExpr) Test(org.junit.Test)

Aggregations

ArrayCreationExpr (com.github.javaparser.ast.expr.ArrayCreationExpr)6 Test (org.junit.Test)4 Problem (com.github.javaparser.Problem)1 Node (com.github.javaparser.ast.Node)1 Parameter (com.github.javaparser.ast.body.Parameter)1 VariableDeclarator (com.github.javaparser.ast.body.VariableDeclarator)1 LambdaExpr (com.github.javaparser.ast.expr.LambdaExpr)1 NullLiteralExpr (com.github.javaparser.ast.expr.NullLiteralExpr)1 VariableDeclarationExpr (com.github.javaparser.ast.expr.VariableDeclarationExpr)1 ExpressionStmt (com.github.javaparser.ast.stmt.ExpressionStmt)1 ForStmt (com.github.javaparser.ast.stmt.ForStmt)1 ForeachStmt (com.github.javaparser.ast.stmt.ForeachStmt)1 ArrayList (java.util.ArrayList)1