use of org.whole.lang.java.codebase.Factorial in project whole by wholeplatform.
the class ScannerTest method testPatternIterator.
@Test
public void testPatternIterator() {
IEntity fact = new Factorial().create();
IEntityIterator<IEntity> i = IteratorFactory.childMatcherIterator().withPattern(JavaEntityDescriptorEnum.MethodDeclaration);
i.reset(fact);
while (i.hasNext()) {
MethodDeclaration md = (MethodDeclaration) i.next();
md.getName();
}
}
use of org.whole.lang.java.codebase.Factorial in project whole by wholeplatform.
the class ScannerTest method testFindFirst.
@Test
public void testFindFirst() {
IEntity fact = new Factorial().create();
IEntity var = Matcher.find(mf.hasTypeMatcher(JavaEntityDescriptorEnum.Block), fact, false);
Assert.assertNotNull(var);
}
use of org.whole.lang.java.codebase.Factorial in project whole by wholeplatform.
the class ScannerTest method testFindAll.
@Test
public void testFindAll() {
IEntity fact = new Factorial().create();
List<IEntity> c = new ArrayList<IEntity>();
Matcher.findAll(mf.hasTypeMatcher(JavaEntityDescriptorEnum.Assignment), fact, c, false);
Matcher.findAll(mf.hasTypeMatcher(JavaEntityDescriptorEnum.SingleVariableDeclaration), fact, c, false);
Assert.assertEquals(3 + 2, c.size());
}