use of net.sourceforge.pmd.lang.apex.metrics.ApexSignatureMatcher in project pmd by pmd.
the class ApexMultifileVisitorTest method testOperationsAreThere.
@Test
public void testOperationsAreThere() throws IOException {
ApexNode<Compilation> acu = parseAndVisitForString(IOUtils.toString(ApexMultifileVisitorTest.class.getResourceAsStream("MetadataDeployController.cls")));
final ApexSignatureMatcher toplevel = ApexProjectMirror.INSTANCE;
final ApexOperationSigMask opMask = new ApexOperationSigMask();
// We could parse qnames from string but probably simpler to do that
acu.jjtAccept(new ApexParserVisitorAdapter() {
@Override
public Object visit(ASTMethod node, Object data) {
if (!node.getImage().matches("(<clinit>|<init>|clone)")) {
assertTrue(toplevel.hasMatchingSig(node.getQualifiedName(), opMask));
}
return data;
}
}, null);
}
Aggregations