Search in sources :

Example 6 with ArrayCreationLevel

use of com.github.javaparser.ast.ArrayCreationLevel in project javaparser by javaparser.

the class ArrayCreationLevelTransformationsTest method addingDimension.

// Dimension
@Test
public void addingDimension() throws IOException {
    ArrayCreationLevel it = consider("[]");
    it.setDimension(new IntegerLiteralExpr("10"));
    assertTransformedToString("[10]", it);
}
Also used : IntegerLiteralExpr(com.github.javaparser.ast.expr.IntegerLiteralExpr) ArrayCreationLevel(com.github.javaparser.ast.ArrayCreationLevel) Test(org.junit.Test) AbstractLexicalPreservingTest(com.github.javaparser.printer.lexicalpreservation.AbstractLexicalPreservingTest)

Aggregations

ArrayCreationLevel (com.github.javaparser.ast.ArrayCreationLevel)6 AbstractLexicalPreservingTest (com.github.javaparser.printer.lexicalpreservation.AbstractLexicalPreservingTest)6 Test (org.junit.Test)6 IntegerLiteralExpr (com.github.javaparser.ast.expr.IntegerLiteralExpr)2 NodeList (com.github.javaparser.ast.NodeList)1 Name (com.github.javaparser.ast.expr.Name)1 NormalAnnotationExpr (com.github.javaparser.ast.expr.NormalAnnotationExpr)1