Class MockPluginStore

  • All Implemented Interfaces:
    com.funnelback.plugin.gatherer.PluginStore

    public class MockPluginStore
    extends Object
    implements com.funnelback.plugin.gatherer.PluginStore
    A mock PluginStore that may be used when testing the PluginGatherer. Example:
    
     MockPluginStore pluginStore = new MockPluginStore();
     
     MockPluginGatherContext pluginGatherContext = new MockPluginGatherContext();
     
     PluginGatherer underTest = new MyPluginGatherer();
     
     underTest.gather(pluginGatherContext, pluginStore);
     
     Assert.assertEquals("2 documents should have been gathered.", 2, pluginStore.getStored().size());
     
     Assert.assertEquals("http://example.com/1", pluginStore.getStored().get(0).getUri().toASCIIString());
     Assert.assertEquals("http://example.com/2", pluginStore.getStored().get(1).getUri().toASCIIString());
     
    Stores records in memory, don't store too many documents into this.