@Test public void testExecute() throws Exception { final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml")); final Template template = config.getTemplate("main"); PJsonObject requestData = loadJsonRequestData(); Values values = new Values( requestData, template, this.parser, getTaskDirectory(), this.httpRequestFactory, new File(".")); this.forkJoinPool.invoke(template.getProcessorGraph().createTask(values)); @SuppressWarnings("unchecked") List<URI> layerGraphics = (List<URI>) values.getObject("layerGraphics", List.class); assertEquals(1, layerGraphics.size()); // Files.copy(new File(layerGraphics.get(0)), new File(TMP, // getClass().getSimpleName()+".tiff")); new ImageSimilarity(new File(layerGraphics.get(0)), 2) .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 0); }
@Test public void testBasicTableProperties() throws Exception { final String baseDir = BASIC_BASE_DIR; final Configuration config = configurationFactory.getConfig(getFile(baseDir + "config.yaml")); final Template template = config.getTemplate("main"); PJsonObject requestData = loadJsonRequestData(baseDir); Values values = new Values( requestData, template, parser, getTaskDirectory(), this.httpRequestFactory, new File(".")); forkJoinPool.invoke(template.getProcessorGraph().createTask(values)); final JRMapCollectionDataSource tableDataSource = values.getObject("table", JRMapCollectionDataSource.class); int count = 0; while (tableDataSource.next()) { count++; } assertEquals(2, count); }