@Test void sizeWithException() throws Exception { doThrow(QueryException.class).when(this.queryManager).createQuery(anyString(), anyString()); assertThrows(IllegalStateException.class, () -> this.databaseIterator.size(), "Failed to query the Solr index."); }
@Override public long size() { long size = 0; try { getQuery(); for (String wikiName : getWikis()) { size += (long) countQuery.setWiki(wikiName).execute().get(0); } } catch (QueryException e) { throw new IllegalStateException("Failed to count the documents.", e); } return size; }
DatabaseDocumentIterator extends AbstractDocumentIterator<String> { @Override public long size() { long size = 0; try { getQuery(); for (String wikiName : getWikis()) { size += (long) countQuery.setWiki(wikiName).execute().get(0); } } catch (QueryException e) { throw new IllegalStateException("Failed to count the documents.", e); } return size; } }
DatabaseDocumentIterator extends AbstractDocumentIterator<String> { @Override public long size() { long size = 0; try { getQuery(); for (String wikiName : getWikis()) { size += (long) countQuery.setWiki(wikiName).execute().get(0); } } catch (QueryException e) { throw new IllegalStateException("Failed to count the documents.", e); } return size; }  }
DatabaseDocumentIterator extends AbstractDocumentIterator<String> { @Override public long size() { long size = 0; try { getQuery(); for (String wikiName : getWikis()) { size += (long) countQuery.setWiki(wikiName).execute().get(0); } } catch (QueryException e) { throw new IllegalStateException("Failed to count the documents.", e); } return size; }  @Override boolean hasNext(); @Override Pair<DocumentReference, String> next(); @Override long size(); }
DatabaseDocumentIterator extends AbstractDocumentIterator<String> { @Override public long size() { long size = 0; try { getQuery(); for (String wikiName : getWikis()) { size += (long) countQuery.setWiki(wikiName).execute().get(0); } } catch (QueryException e) { throw new IllegalStateException("Failed to count the documents.", e); } return size; }  @Override boolean hasNext(); @Override Pair<DocumentReference, String> next(); @Override long size();  }