Package org.sonar.core.cluster

Examples of org.sonar.core.cluster.WorkQueue


public class BatchSessionTest {
  @Test
  public void shouldCommitWhenReachingBatchSize() {
    SqlSession mybatisSession = mock(SqlSession.class);
    WorkQueue queue = mock(WorkQueue.class);
    BatchSession session = new BatchSession(queue, mybatisSession, 10);

    for (int i = 0; i < 9; i++) {
      session.insert("id" + i);
      verify(mybatisSession).insert("id" + i);
View Full Code Here


  }

  @Test
  public void shouldCommitWhenReachingBatchSizeWithoutCommits() {
    SqlSession mybatisSession = mock(SqlSession.class);
    WorkQueue queue = mock(WorkQueue.class);
    BatchSession session = new BatchSession(queue, mybatisSession, 10);

    ClusterAction action = new ClusterAction() {
      @Override
      public Object call() throws Exception {
View Full Code Here

  }

  @Test
    public void shouldResetCounterAfterCommit() {
      SqlSession mybatisSession = mock(SqlSession.class);
      WorkQueue queue = mock(WorkQueue.class);
      BatchSession session = new BatchSession(queue, mybatisSession, 10);

      for (int i = 0; i < 35; i++) {
        session.insert("id" + i);
      }
View Full Code Here

TOP

Related Classes of org.sonar.core.cluster.WorkQueue

Copyright © 2018 www.massapicom. 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.