use of net.sourceforge.pmd.typeresolution.testdata.ArrayTypes in project pmd by pmd.
the class ClassTypeResolverTest method testArrayTypes.
@Test
public void testArrayTypes() throws JaxenException {
ASTCompilationUnit acu = parseAndTypeResolveForClass15(ArrayTypes.class);
List<AbstractJavaTypeNode> expressions = convertList(acu.findChildNodesWithXPath("//VariableDeclarator"), AbstractJavaTypeNode.class);
int index = 0;
// int[] a = new int[1];
testSubtreeNodeTypes(expressions.get(index++), int[].class);
// Object[][] b = new Object[1][0];
testSubtreeNodeTypes(expressions.get(index++), Object[][].class);
// ArrayTypes[][][] c = new ArrayTypes[][][] { new ArrayTypes[1][2] };
testSubtreeNodeTypes(expressions.get(index++), ArrayTypes[][][].class);
// Make sure we got them all
assertEquals("All expressions not tested", index, expressions.size());
}
Aggregations