Package org.mapfish.print.config

Examples of org.mapfish.print.config.Configuration


                return new MockClientHttpRequest(httpMethod, uri);
            }
        });

        configurationFactory.setDoValidation(false);
        final Configuration config = configurationFactory.getConfig(getFile(baseDir() + "/config-forward-all.yaml"));
        final Template template = config.getTemplate("main");

        ProcessorDependencyGraph graph = template.getProcessorGraph();

        Values values = new Values();
        values.put(Values.CLIENT_HTTP_REQUEST_FACTORY_KEY, this.httpClientFactory);
View Full Code Here


                return new MockClientHttpRequest(httpMethod, uri);
            }
        });

        this.configurationFactory.setDoValidation(false);
        final Configuration config = configurationFactory.getConfig(getFile(baseDir() + "/config.yaml"));
        final Template template = config.getTemplate("main");

        ProcessorDependencyGraph graph = template.getProcessorGraph();
        List<ProcessorGraphNode> roots = graph.getRoots();

        assertEquals(1, roots.size());
View Full Code Here

    @Autowired
    private MapfishParser parser;

    @Test
    public void testParsableByValues() throws Exception {
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml"));
        PJsonObject requestData = loadJsonRequestData();

        Template template = config.getTemplate("main");
        Values values = new Values(requestData, template, this.parser, config.getDirectory(), httpClientFactory, config.getDirectory());

        String[] array = (String[]) values.getObject("stringarray", Object.class);

        assertArrayEquals(new String[]{"s1", "s2"}, array);
    }
View Full Code Here

        assertArrayEquals(new String[]{"s1", "s2"}, array);
    }

    @Test
    public void testWrongType() throws Exception {
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml"));
        PJsonObject requestData = loadJsonRequestData();

        final JSONArray intArray = new JSONArray();
        intArray.add(1);
        intArray.add(2);
        intArray.add(3);
        requestData.getJSONObject("attributes").getInternalObj().put("stringarray", intArray);

        Template template = config.getTemplate("main");
        Values values = new Values(requestData, template, this.parser, config.getDirectory(), httpClientFactory, config.getDirectory());

        String[] array = (String[]) values.getObject("stringarray", Object.class);

        assertArrayEquals(new String[]{"1", "2", "3"}, array);
    }
View Full Code Here

    private void assertNumErrors(Map<String, Object> attributeMap, int expectedNumErrors) {
        final PdfConfigurationProcessor pdfConfigurationProcessor = new PdfConfigurationProcessor();
        pdfConfigurationProcessor.setUpdates(attributeMap);
        List<Throwable> errors = Lists.newArrayList();
        Configuration configuration = new Configuration();
        pdfConfigurationProcessor.validate(errors, configuration);
        assertEquals(expectedNumErrors, errors.size());
    }
View Full Code Here

    private TestHttpClientFactory httpClientFactory;

    @Test
    public void testAssignStyleBasic() throws Exception {
        this.configurationFactory.setDoValidation(false);
        final Configuration config = this.configurationFactory.getConfig(getFile(BASE_DIR + "basic/config.yaml"));
        final Template template = config.getTemplate("main");
        PJsonObject requestData = parseJSONObjectFromFile(SetStyleProcessorTest.class, BASE_DIR + "basic/request.json");
        Values values = new Values(requestData, template, parser, this.folder.getRoot(), this.httpClientFactory, new File("."));
        forkJoinPool.invoke(template.getProcessorGraph().createTask(values));

        final MapAttribute.MapAttributeValues map = values.getObject("mapDef", MapAttribute.MapAttributeValues.class);
View Full Code Here

    }

    @Test
    public void testAssignStyleMap() throws Exception {
        this.configurationFactory.setDoValidation(false);
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "map/config.yaml"));
        final Template template = config.getTemplate("main");
       
        ProcessorDependencyGraph graph = template.getProcessorGraph();
        List<ProcessorGraphNode> roots = graph.getRoots();

        assertEquals(1, roots.size());
View Full Code Here

    }

    @Test
    public void testAssignStyleTwoMaps() throws Exception {
        this.configurationFactory.setDoValidation(false);
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "two_maps/config.yaml"));
        final Template template = config.getTemplate("main");
       
        ProcessorDependencyGraph graph = template.getProcessorGraph();
        List<ProcessorGraphNode> roots = graph.getRoots();
       
        assertEquals(2, roots.size());
View Full Code Here

        layerData.spacing = new double[]{20, 30};
        layerData.origin = new double[]{10, 20};
        layerData.pointsInLine = 10;


        Configuration config = new Configuration();
        Template template = new Template();
        template.setConfiguration(config);

        final GridLayerPlugin plugin = new GridLayerPlugin();
        StyleParser styleParser = new StyleParser();
View Full Code Here

    public void testParseNumLines() throws Throwable {
        final GridParam layerData = new GridParam();
        layerData.numberOfLines = new int[]{3, 2};
        layerData.pointsInLine = 10;

        Configuration config = new Configuration();
        Template template = new Template();
        template.setConfiguration(config);

        final GridLayerPlugin plugin = new GridLayerPlugin();
        StyleParser styleParser = new StyleParser();
View Full Code Here

TOP

Related Classes of org.mapfish.print.config.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.