@Test public void testExporter() throws IOException { final IndexingContext context = new IndexingContext(new Statistics(), tmpFolder.getRoot()); final File result = generator.generate(new MockMetaAttributeCollector(), new MockCategoryDataCollector(), new MockProductDataCollector(), context); Assert.assertNotNull(result); Assert.assertTrue(result.length() > 0); Assert.assertEquals(1, tmpFolder.getRoot().listFiles().length); }
@Override public File generate(final MetaAttributeCollector metaAttributeCollector, final CategoryDataCollector categoryDataCollector, final ProductDataCollector productDataCollector, final IndexingContext context) throws IOException { LOG.info("file creation - Start"); categoryExporter.process(categoryDataCollector, context); metaAttributeExporter.process(metaAttributeCollector, context); productExporter.process(productDataCollector, context); final File[] filesProduced = context.getParentDir().listFiles(); final File result = createDataZip(context.getParentDir(), filesProduced); cleanup(filesProduced); LOG.info("file creation - End"); return result; }
DefaultGenerator implements Generator { @Override public File generate(final MetaAttributeCollector metaAttributeCollector, final CategoryDataCollector categoryDataCollector, final ProductDataCollector productDataCollector, final IndexingContext context) throws IOException { LOG.info("file creation - Start"); categoryExporter.process(categoryDataCollector, context); metaAttributeExporter.process(metaAttributeCollector, context); productExporter.process(productDataCollector, context); final File[] filesProduced = context.getParentDir().listFiles(); final File result = createDataZip(context.getParentDir(), filesProduced); cleanup(filesProduced); LOG.info("file creation - End"); return result; } }
DefaultGenerator implements Generator { @Override public File generate(final MetaAttributeCollector metaAttributeCollector, final CategoryDataCollector categoryDataCollector, final ProductDataCollector productDataCollector, final IndexingContext context) throws IOException { LOG.info("file creation - Start"); categoryExporter.process(categoryDataCollector, context); metaAttributeExporter.process(metaAttributeCollector, context); productExporter.process(productDataCollector, context); final File[] filesProduced = context.getParentDir().listFiles(); final File result = createDataZip(context.getParentDir(), filesProduced); cleanup(filesProduced); LOG.info("file creation - End"); return result; }  }
DefaultGenerator implements Generator { @Override public File generate(final MetaAttributeCollector metaAttributeCollector, final CategoryDataCollector categoryDataCollector, final ProductDataCollector productDataCollector, final IndexingContext context) throws IOException { LOG.info("file creation - Start"); categoryExporter.process(categoryDataCollector, context); metaAttributeExporter.process(metaAttributeCollector, context); productExporter.process(productDataCollector, context); final File[] filesProduced = context.getParentDir().listFiles(); final File result = createDataZip(context.getParentDir(), filesProduced); cleanup(filesProduced); LOG.info("file creation - End"); return result; }  @Override File generate(final MetaAttributeCollector metaAttributeCollector, final CategoryDataCollector categoryDataCollector,
			final ProductDataCollector productDataCollector, final IndexingContext context); CategoryExporter getCategoryExporter(); void setCategoryExporter(final CategoryExporter categoryExporter); MetaAttributeExporter getMetaAttributeExporter(); void setMetaAttributeExporter(final MetaAttributeExporter metaAttributeExporter); ProductExporter getProductExporter(); void setProductExporter(final ProductExporter productExporter); }
DefaultGenerator implements Generator { @Override public File generate(final MetaAttributeCollector metaAttributeCollector, final CategoryDataCollector categoryDataCollector, final ProductDataCollector productDataCollector, final IndexingContext context) throws IOException { LOG.info("file creation - Start"); categoryExporter.process(categoryDataCollector, context); metaAttributeExporter.process(metaAttributeCollector, context); productExporter.process(productDataCollector, context); final File[] filesProduced = context.getParentDir().listFiles(); final File result = createDataZip(context.getParentDir(), filesProduced); cleanup(filesProduced); LOG.info("file creation - End"); return result; }  @Override File generate(final MetaAttributeCollector metaAttributeCollector, final CategoryDataCollector categoryDataCollector,
			final ProductDataCollector productDataCollector, final IndexingContext context); CategoryExporter getCategoryExporter(); void setCategoryExporter(final CategoryExporter categoryExporter); MetaAttributeExporter getMetaAttributeExporter(); void setMetaAttributeExporter(final MetaAttributeExporter metaAttributeExporter); ProductExporter getProductExporter(); void setProductExporter(final ProductExporter productExporter);  }