use of org.sonar.java.model.statement.EmptyStatementTreeImpl in project sonar-java by SonarSource.
the class ListTreeImplTest method emptySeparators.
@Test
public void emptySeparators() throws Exception {
Tree tree1 = new EmptyStatementTreeImpl(null);
List<Tree> trees = Lists.newArrayList(tree1);
List<SyntaxToken> separators = Lists.newArrayList();
ListTreeImpl<Tree> listTree = new MyList(trees, separators);
Iterable<Tree> result = listTree.children();
assertThat(Lists.newArrayList(result)).containsExactly(tree1);
}
use of org.sonar.java.model.statement.EmptyStatementTreeImpl in project sonar-java by SonarSource.
the class ListTreeImplTest method separators_order_in_children_iteration.
@Test
public void separators_order_in_children_iteration() throws Exception {
Tree tree1 = new EmptyStatementTreeImpl(null);
Tree tree2 = new EmptyStatementTreeImpl(null);
Tree tree3 = new EmptyStatementTreeImpl(null);
List<Tree> trees = Lists.newArrayList(tree1, tree2, tree3);
SyntaxToken token1 = createToken("token1");
SyntaxToken token2 = createToken("token2");
List<SyntaxToken> separators = Lists.newArrayList(token1, token2);
ListTreeImpl<Tree> listTree = new MyList(trees, separators);
Iterable<Tree> result = listTree.children();
assertThat(Lists.newArrayList(result)).containsExactly(tree1, token1, tree2, token2, tree3);
}
Aggregations