@Deprecated public static ContentStore createDataStore(final String type, String name) { if (contentStore == null) { contentStore = new ContentStore(type, name); } return contentStore; }
public static ContentStore createDataStore(JBakeConfiguration configuration) { if (contentStore == null) { contentStore = new ContentStore(configuration.getDatabaseStore(), configuration.getDatabasePath()); } return contentStore; }
@Test public void shouldCrawlRenderAndCopyAssets() throws Exception { configuration.setTemplateFolder( folder.newFolder("template") ); configuration.setContentFolder( folder.newFolder("content") ); configuration.setAssetFolder( folder.newFolder("assets") ); contentStore = spy(new ContentStore("memory", "documents"+ System.currentTimeMillis())); Crawler crawler = mock(Crawler.class); Renderer renderer = mock(Renderer.class); Asset asset = mock(Asset.class); Utensils utensils = new Utensils(); utensils.setConfiguration(configuration); utensils.setContentStore(contentStore); utensils.setRenderer(renderer); utensils.setCrawler(crawler); utensils.setAsset(asset); Oven oven = new Oven(utensils); oven.bake(); verify(contentStore, times(1)).startup(); verify(renderer,atLeastOnce()).renderIndex(anyString()); verify(crawler,times(1)).crawl(); verify(asset,times(1)).copy(); } }
@Deprecated public static ContentStore createDataStore(final String type, String name) { if (contentStore == null) { contentStore = new ContentStore(type, name); } return contentStore; }
public static ContentStore createDataStore(JBakeConfiguration configuration) { if (contentStore == null) { contentStore = new ContentStore(configuration.getDatabaseStore(), configuration.getDatabasePath()); } return contentStore; }