}
private void setupForConsumers(int consumers) {
executor = Executors.newFixedThreadPool(consumers + 2);
CrawljaxConfiguration config =
CrawljaxConfiguration
.builderFor("http://example.com")
.addPlugin(postCrawlPlugin)
.setBrowserConfig(
new BrowserConfiguration(BrowserType.FIREFOX, consumers))
.build();
candidateActions =
new UnfiredCandidateActions(config.getBrowserConfig(), graphProvider,
new MetricRegistry());
consumersDoneLatch = new ExitNotifier(config.getMaximumStates());
when(consumerFactory.get()).thenReturn(new CrawlTaskConsumer(candidateActions,
consumersDoneLatch, crawler));
crawlSessionProvider = new CrawlSessionProvider(graph, config, new MetricRegistry());