Package com.github.hakko.musiccabinet.domain.model.aggr

Examples of com.github.hakko.musiccabinet.domain.model.aggr.SearchIndexUpdateProgress


  @Test
  public void successfulServiceInvocation() {
    SuccessfulUpdateService successfulService = new SuccessfulUpdateService();
   
    SearchIndexUpdateProgress progress;
    Assert.assertNotNull(progress = successfulService.getProgress());
    Assert.assertEquals(SearchIndexUpdateProgress.NOT_INITIALIZED, progress.getTotalOperations());
    Assert.assertEquals(SearchIndexUpdateProgress.NOT_INITIALIZED, progress.getFinishedOperations());

    successfulService.updateSearchIndex();
   
    Assert.assertNotNull(progress = successfulService.getProgress());
    Assert.assertEquals(SuccessfulUpdateService.TOTAL_CALCULATIONS, progress.getTotalOperations());
    Assert.assertEquals(SuccessfulUpdateService.TOTAL_CALCULATIONS, progress.getFinishedOperations());
   
    successfulService.reset();
    Assert.assertNotNull(progress = successfulService.getProgress());
    Assert.assertEquals(SearchIndexUpdateProgress.NOT_INITIALIZED, progress.getTotalOperations());
    Assert.assertEquals(SearchIndexUpdateProgress.NOT_INITIALIZED, progress.getFinishedOperations());
  }
View Full Code Here


  @Test
  public void failingServiceInvocation() {
    FailingUpdateService failingService = new FailingUpdateService();
   
    SearchIndexUpdateProgress progress;
    Assert.assertNotNull(progress = failingService.getProgress());
    Assert.assertEquals(SearchIndexUpdateProgress.NOT_INITIALIZED, progress.getTotalOperations());
    Assert.assertEquals(SearchIndexUpdateProgress.NOT_INITIALIZED, progress.getFinishedOperations());

    try {
      failingService.updateSearchIndex();
      Assert.fail();
    } catch (ApplicationException e) {
    }
     
    Assert.assertNotNull(progress = failingService.getProgress());
    Assert.assertEquals(FailingUpdateService.TOTAL_CALCULATIONS, progress.getTotalOperations());
    Assert.assertEquals(FailingUpdateService.FAIL_INDEX, progress.getFinishedOperations());
   
    failingService.reset();
    Assert.assertNotNull(progress = failingService.getProgress());
    Assert.assertEquals(SearchIndexUpdateProgress.NOT_INITIALIZED, progress.getTotalOperations());
    Assert.assertEquals(SearchIndexUpdateProgress.NOT_INITIALIZED, progress.getFinishedOperations());
  }
View Full Code Here

public abstract class SearchIndexUpdateService {

  private SearchIndexUpdateProgress progress;
 
  public SearchIndexUpdateService() {
    progress = new SearchIndexUpdateProgress(getUpdateDescription());
  }
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.domain.model.aggr.SearchIndexUpdateProgress

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.