@Test @DirtiesContext public void testExecute() throws Exception { final String host = "overview_map"; requestFactory.registerHandler( input -> (("" + input.getHost()).contains(host + ".osm")) || input.getAuthority().contains(host + ".osm"), createFileHandler(uri -> "/map-data/osm" + uri.getPath()) ); requestFactory.registerHandler( input -> (("" + input.getHost()).contains(host + ".json")) || input.getAuthority().contains(host + ".json"), createFileHandler(uri -> "/map-data" + uri.getPath()) ); final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml")); final Template template = config.getTemplate("main"); PJsonObject requestData = loadJsonRequestData(); Values values = new Values("test", requestData, template, getTaskDirectory(), this.requestFactory, new File(".")); final ForkJoinTask<Values> taskFuture = this.forkJoinPool.submit( template.getProcessorGraph().createTask(values)); taskFuture.get(); @SuppressWarnings("unchecked") List<URI> layerGraphics = (List<URI>) values.getObject("overviewMapLayerGraphics", List.class); assertEquals(2, layerGraphics.size()); new ImageSimilarity(getFile(BASE_DIR + "expectedSimpleImage.png")) .assertSimilarity(layerGraphics, 300, 200, 110); }
@Override public final Output execute(final Input values, final ExecutionContext context) throws Exception { CreateMapProcessor.Input mapProcessorValues = this.mapProcessor.createInputParameter(); mapProcessorValues.clientHttpRequestFactoryProvider = values.clientHttpRequestFactoryProvider; mapProcessorValues.tempTaskDirectory = values.tempTaskDirectory; mapProcessorValues.template = values.template; MapAttribute.OverriddenMapAttributeValues mapParams = ((MapAttribute.MapAttributeValues) values.map).getWithOverrides( (OverviewMapAttribute.OverviewMapAttributeValues) values.overviewMap); mapProcessorValues.map = mapParams; MapBounds boundsOfOriginalMap = mapParams.getOriginalBounds(); setOriginalMapExtentLayer(boundsOfOriginalMap, values, mapParams); setOverviewMapBounds(mapParams, boundsOfOriginalMap, values); CreateMapProcessor.Output output = this.mapProcessor.execute(mapProcessorValues, context); return new Output(output.layerGraphics, output.mapSubReport); }
CreateOverviewMapProcessor extends AbstractProcessor<CreateOverviewMapProcessor.Input, CreateOverviewMapProcessor.Output> { @Override public final Output execute(final Input values, final ExecutionContext context) throws Exception { CreateMapProcessor.Input mapProcessorValues = this.mapProcessor.createInputParameter(); mapProcessorValues.clientHttpRequestFactoryProvider = values.clientHttpRequestFactoryProvider; mapProcessorValues.tempTaskDirectory = values.tempTaskDirectory; mapProcessorValues.template = values.template; MapAttribute.OverriddenMapAttributeValues mapParams = ((MapAttribute.MapAttributeValues) values.map).getWithOverrides( (OverviewMapAttribute.OverviewMapAttributeValues) values.overviewMap); mapProcessorValues.map = mapParams; MapBounds boundsOfOriginalMap = mapParams.getOriginalBounds(); setOriginalMapExtentLayer(boundsOfOriginalMap, values, mapParams); setOverviewMapBounds(mapParams, boundsOfOriginalMap, values); CreateMapProcessor.Output output = this.mapProcessor.execute(mapProcessorValues, context); return new Output(output.layerGraphics, output.mapSubReport); } }
CreateOverviewMapProcessor extends AbstractProcessor<CreateOverviewMapProcessor.Input, CreateOverviewMapProcessor.Output> { @Override public final Output execute(final Input values, final ExecutionContext context) throws Exception { CreateMapProcessor.Input mapProcessorValues = this.mapProcessor.createInputParameter(); mapProcessorValues.clientHttpRequestFactoryProvider = values.clientHttpRequestFactoryProvider; mapProcessorValues.tempTaskDirectory = values.tempTaskDirectory; mapProcessorValues.template = values.template; MapAttribute.OverriddenMapAttributeValues mapParams = ((MapAttribute.MapAttributeValues) values.map).getWithOverrides( (OverviewMapAttribute.OverviewMapAttributeValues) values.overviewMap); mapProcessorValues.map = mapParams; MapBounds boundsOfOriginalMap = mapParams.getOriginalBounds(); setOriginalMapExtentLayer(boundsOfOriginalMap, values, mapParams); setOverviewMapBounds(mapParams, boundsOfOriginalMap, values); CreateMapProcessor.Output output = this.mapProcessor.execute(mapProcessorValues, context); return new Output(output.layerGraphics, output.mapSubReport); } CreateOverviewMapProcessor(); }
CreateOverviewMapProcessor extends AbstractProcessor<CreateOverviewMapProcessor.Input, CreateOverviewMapProcessor.Output> { @Override public final Output execute(final Input values, final ExecutionContext context) throws Exception { CreateMapProcessor.Input mapProcessorValues = this.mapProcessor.createInputParameter(); mapProcessorValues.clientHttpRequestFactoryProvider = values.clientHttpRequestFactoryProvider; mapProcessorValues.tempTaskDirectory = values.tempTaskDirectory; mapProcessorValues.template = values.template; MapAttribute.OverriddenMapAttributeValues mapParams = ((MapAttribute.MapAttributeValues) values.map).getWithOverrides( (OverviewMapAttribute.OverviewMapAttributeValues) values.overviewMap); mapProcessorValues.map = mapParams; MapBounds boundsOfOriginalMap = mapParams.getOriginalBounds(); setOriginalMapExtentLayer(boundsOfOriginalMap, values, mapParams); setOverviewMapBounds(mapParams, boundsOfOriginalMap, values); CreateMapProcessor.Output output = this.mapProcessor.execute(mapProcessorValues, context); return new Output(output.layerGraphics, output.mapSubReport); } CreateOverviewMapProcessor(); @Override final Input createInputParameter(); @Override final Output execute(final Input values, final ExecutionContext context); }
CreateOverviewMapProcessor extends AbstractProcessor<CreateOverviewMapProcessor.Input, CreateOverviewMapProcessor.Output> { @Override public final Output execute(final Input values, final ExecutionContext context) throws Exception { CreateMapProcessor.Input mapProcessorValues = this.mapProcessor.createInputParameter(); mapProcessorValues.clientHttpRequestFactoryProvider = values.clientHttpRequestFactoryProvider; mapProcessorValues.tempTaskDirectory = values.tempTaskDirectory; mapProcessorValues.template = values.template; MapAttribute.OverriddenMapAttributeValues mapParams = ((MapAttribute.MapAttributeValues) values.map).getWithOverrides( (OverviewMapAttribute.OverviewMapAttributeValues) values.overviewMap); mapProcessorValues.map = mapParams; MapBounds boundsOfOriginalMap = mapParams.getOriginalBounds(); setOriginalMapExtentLayer(boundsOfOriginalMap, values, mapParams); setOverviewMapBounds(mapParams, boundsOfOriginalMap, values); CreateMapProcessor.Output output = this.mapProcessor.execute(mapProcessorValues, context); return new Output(output.layerGraphics, output.mapSubReport); } CreateOverviewMapProcessor(); @Override final Input createInputParameter(); @Override final Output execute(final Input values, final ExecutionContext context);  }