Source:
<code>public void testWriteCsvTemplate() throws Exception { final String VARIABLE_FOLDER_OUTGOING = "psp.output.path.final"; final String VARIABLE_FILENAME_OUTGOING = "hotfolder.input.filename"; final String VARIABLE_TIMESTAMP_OUTGOING = "datacleaner.run.timestamp"; final Datastore datastore = TestHelper.createSampleDatabaseDatastore("my db"); final DataCleanerConfiguration configuration = new DataCleanerConfigurationImpl().withDatastores(datastore); try (AnalysisJobBuilder ajb = new AnalysisJobBuilder(configuration)) { ajb.setDatastore("my db"); ajb.addSourceColumns("PUBLIC.EMPLOYEES.FIRSTNAME", "PUBLIC.EMPLOYEES.LASTNAME", "PUBLIC.EMPLOYEES.EMAIL"); final InputColumn<?> fnCol = ajb.getSourceColumnByName("FIRSTNAME"); final InputColumn<?> lnCol = ajb.getSourceColumnByName("LASTNAME"); final InputColumn<?> emailCol = ajb.getSourceColumnByName("EMAIL"); ajb.getAnalysisJobMetadata().getVariables().put(VARIABLE_FOLDER_OUTGOING, "C:\\Users\\claudiap\\Documents\\OutgoingHotFolder"); ajb.getAnalysisJobMetadata().getVariables().put(VARIABLE_FILENAME_OUTGOING, "myFile"); ajb.getAnalysisJobMetadata().getVariables().put(VARIABLE_TIMESTAMP_OUTGOING, "1482244133378"); final String value = "${" + VARIABLE_FOLDER_OUTGOING + "/" + VARIABLE_FILENAME_OUTGOING + "/" + VARIABLE_TIMESTAMP_OUTGOING + "-samples.csv" + "}"; final FileResource file = new FileResource(value); final AnalyzerComponentBuilder<CreateCsvFileAnalyzer> csvAnalyzer = ajb.addAnalyzer( CreateCsvFileAnalyzer.class); csvAnalyzer.addInputColumns(fnCol, lnCol, emailCol); <START> csvAnalyzer.setConfiguredProperty("File", file); <END> assertMatchesBenchmark(ajb.toAnalysisJob(),"JaxbJobWriterTest-testWriteCsvTemplate.xml"); } }</code><technical_language>This test template functionality all? setting filename instead of metadata</technical_language>

Target:
public void testWriteCsvTemplate() throws Exception { final String VARIABLE_FOLDER_OUTGOING = "psp.output.path.final"; final String VARIABLE_FILENAME_OUTGOING = "hotfolder.input.filename"; final String VARIABLE_TIMESTAMP_OUTGOING = "datacleaner.run.timestamp"; final Datastore datastore = TestHelper.createSampleDatabaseDatastore("my db"); final DataCleanerConfiguration configuration = new DataCleanerConfigurationImpl().withDatastores(datastore); try (AnalysisJobBuilder ajb = new AnalysisJobBuilder(configuration)) { ajb.setDatastore("my db"); ajb.addSourceColumns("PUBLIC.EMPLOYEES.FIRSTNAME", "PUBLIC.EMPLOYEES.LASTNAME", "PUBLIC.EMPLOYEES.EMAIL"); final InputColumn<?> fnCol = ajb.getSourceColumnByName("FIRSTNAME"); final InputColumn<?> lnCol = ajb.getSourceColumnByName("LASTNAME"); final InputColumn<?> emailCol = ajb.getSourceColumnByName("EMAIL"); ajb.getAnalysisJobMetadata().getVariables().put(VARIABLE_FOLDER_OUTGOING, "/Users/claudiap/Documents/OutgoingHotFolder"); ajb.getAnalysisJobMetadata().getVariables().put(VARIABLE_FILENAME_OUTGOING, "myFile"); ajb.getAnalysisJobMetadata().getVariables().put(VARIABLE_TIMESTAMP_OUTGOING, "1482244133378"); final String value = "${" + VARIABLE_FOLDER_OUTGOING + "}" + "/" + "${" + VARIABLE_FILENAME_OUTGOING + "}" + "/" + "${" + VARIABLE_TIMESTAMP_OUTGOING + "}" + "-samples.csv"; final AnalyzerComponentBuilder<CreateCsvFileAnalyzer> csvAnalyzer = ajb.addAnalyzer( CreateCsvFileAnalyzer.class); csvAnalyzer.addInputColumns(fnCol, lnCol, emailCol); csvAnalyzer.setMetadataProperties(TemplateMetadata.createMetadataProperty("File", value)); csvAnalyzer.setConfiguredProperty("File", new FileResource(value)); assertMatchesBenchmark(ajb.toAnalysisJob(),"JaxbJobWriterTest-testWriteCsvTemplate.xml"); } }