use of com.github.javaparser.ast.ArrayCreationLevel in project javaparser by javaparser.
the class ArrayCreationLevelTransformationsTest method removingDimension.
@Test
public void removingDimension() throws IOException {
ArrayCreationLevel it = consider("[10]");
it.removeDimension();
assertTransformedToString("[]", it);
}
use of com.github.javaparser.ast.ArrayCreationLevel in project javaparser by javaparser.
the class ArrayCreationLevelTransformationsTest method replacingAnnotation.
@Test
public void replacingAnnotation() throws IOException {
ArrayCreationLevel it = consider("@myAnno []");
it.getAnnotations().set(0, new NormalAnnotationExpr(new Name("myOtherAnno"), new NodeList<>()));
assertTransformedToString("@myOtherAnno() []", it);
}
use of com.github.javaparser.ast.ArrayCreationLevel in project javaparser by javaparser.
the class ArrayCreationLevelTransformationsTest method replacingDimension.
@Test
public void replacingDimension() throws IOException {
ArrayCreationLevel it = consider("[10]");
it.setDimension(new IntegerLiteralExpr("12"));
assertTransformedToString("[12]", it);
}
use of com.github.javaparser.ast.ArrayCreationLevel in project javaparser by javaparser.
the class ArrayCreationLevelTransformationsTest method addingAnnotation.
// Annotations
@Test
public void addingAnnotation() throws IOException {
ArrayCreationLevel it = consider("[]");
it.addAnnotation("myAnno");
assertTransformedToString("@myAnno()" + Utils.EOL + "[]", it);
}
use of com.github.javaparser.ast.ArrayCreationLevel in project javaparser by javaparser.
the class ArrayCreationLevelTransformationsTest method removingAnnotation.
@Test
public void removingAnnotation() throws IOException {
ArrayCreationLevel it = consider("@myAnno []");
it.getAnnotations().remove(0);
assertTransformedToString("[]", it);
}
Aggregations