Examples of AnyTokenMatcher


Examples of org.sonar.duplications.statement.matcher.AnyTokenMatcher

  @Test
  public void shouldCreateStatement() {
    Token token = new Token("a", 1, 1);
    TokenQueue tokenQueue = spy(new TokenQueue(Arrays.asList(token)));
    TokenMatcher matcher = spy(new AnyTokenMatcher());
    StatementChannel channel = StatementChannel.create(matcher);
    List<Statement> output = mock(List.class);

    assertThat(channel.consume(tokenQueue, output), is(true));
    verify(matcher).matchToken(Matchers.eq(tokenQueue), Matchers.anyList());
View Full Code Here

Examples of org.sonar.duplications.statement.matcher.AnyTokenMatcher

  }

  @Test
  public void shouldNotCreateStatement() {
    TokenQueue tokenQueue = spy(new TokenQueue(Arrays.asList(new Token("a", 1, 1))));
    TokenMatcher matcher = spy(new AnyTokenMatcher());
    StatementChannel channel = StatementChannel.create(matcher);
    List<Statement> output = mock(List.class);

    assertThat(channel.consume(tokenQueue, output), is(true));
    verify(matcher).matchToken(Matchers.eq(tokenQueue), Matchers.anyList());
View Full Code Here

Examples of org.sonar.duplications.statement.matcher.AnyTokenMatcher

    return new BridgeTokenMatcher(lToken, rToken);
  }

  public static TokenMatcher anyToken() {
    // TODO Godin: we can return singleton instance
    return new AnyTokenMatcher();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.