Search in sources :

Example 1 with EmptyStatementTree

use of org.sonar.plugins.java.api.tree.EmptyStatementTree in project sonar-java by SonarSource.

the class JavaTreeModelTest method empty_statement.

/**
 * 14.6. The Empty Statement
 */
@Test
public void empty_statement() {
    EmptyStatementTree tree = (EmptyStatementTree) firstMethodFirstStatement("class T { void m() { ; } }");
    assertThat(tree.is(Tree.Kind.EMPTY_STATEMENT)).isTrue();
    assertThat(tree.semicolonToken().text()).isEqualTo(";");
    assertThatChildrenIteratorHasSize(tree, 1);
}
Also used : EmptyStatementTree(org.sonar.plugins.java.api.tree.EmptyStatementTree) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 EmptyStatementTree (org.sonar.plugins.java.api.tree.EmptyStatementTree)1