use of com.github.hakko.musiccabinet.domain.model.aggr.SearchIndexUpdateProgress in project musiccabinet by hakko.
the class LibraryUpdateService method getSearchIndexUpdateProgress.
public List<SearchIndexUpdateProgress> getSearchIndexUpdateProgress() {
List<SearchIndexUpdateProgress> updateProgress = new ArrayList<>();
updateProgress.addAll(libraryScannerService.getUpdateProgress());
for (SearchIndexUpdateService updateService : getUpdateServices()) {
updateProgress.add(updateService.getProgress());
}
return updateProgress;
}
use of com.github.hakko.musiccabinet.domain.model.aggr.SearchIndexUpdateProgress in project musiccabinet by hakko.
the class SearchIndexUpdateServiceTest method failingServiceInvocation.
@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());
}
use of com.github.hakko.musiccabinet.domain.model.aggr.SearchIndexUpdateProgress in project musiccabinet by hakko.
the class SearchIndexUpdateServiceTest method successfulServiceInvocation.
@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());
}
Aggregations