FrontierImpl implements Frontier { @Override public int getNumberOfPendingUris() { if (queue instanceof BlockingQueue) { return ((BlockingQueue<?>) queue).getNumberOfBlockedKeys(); } else { return 0; } } FrontierImpl(UriNormalizer normalizer, UriFilterComposer relationalUriFilter, UriQueue queue,
			List<UriGenerator> uriGenerators, GraphLogger graphLogger, boolean doesRecrawling, long generalRecrawlTime,
			long timerPeriod);  FrontierImpl(UriNormalizer normalizer, UriFilterComposer relationalUriFilter, UriQueue queue,
			List<UriGenerator> uriGenerators, boolean doesRecrawling, long generalRecrawlTime, long timerPeriod);  FrontierImpl(UriNormalizer normalizer, UriFilterComposer relationalUriFilter, URIReferences uriReferences,
			UriQueue queue, List<UriGenerator> uriGenerators,boolean doesRecrawling, OutDatedUriRetriever outDatedUriRetriever);  FrontierImpl(UriNormalizer normalizer, UriFilterComposer relationalUriFilter, UriQueue queue,
			List<UriGenerator> uriGenerators, boolean doesRecrawling);  FrontierImpl(UriNormalizer normalizer, UriFilterComposer relationalUriFilter, UriQueue queue,
			List<UriGenerator> uriGenerators);  FrontierImpl(UriNormalizer normalizer, UriFilterComposer relationalUriFilter, URIReferences uriReferences,
			UriQueue queue, List<UriGenerator> uriGenerators, GraphLogger graphLogger, boolean doesRecrawling,
			long generalRecrawlTime, long timerPeriod,OutDatedUriRetriever outDatedUriRetriever); @Override List<CrawleableUri> getNextUris(); @Override void addNewUris(List<CrawleableUri> uris); @Override void addNewUri(CrawleableUri uri); @Override void crawlingDone(List<CrawleableUri> uris); @Override int getNumberOfPendingUris(); @Override boolean doesRecrawling(); @Override void close(); static long getGeneralRecrawlTime(); UriQueue getQueue(); static final long DEFAULT_GENERAL_RECRAWL_TIME; }
@Test public void getNumberOfPendingUris() throws Exception { frontier.addNewUris(uris); List<CrawleableUri> nextUris = frontier.getNextUris(); int numberOfPendingUris = frontier.getNumberOfPendingUris(); assertEquals(1, numberOfPendingUris); numberOfPendingUris = frontier.getNumberOfPendingUris(); assertEquals(2, nextUris.size()); }