Package org.mapfish.print.config

Examples of org.mapfish.print.config.Configuration


    }

    @Test
    public void testAttributesFromJson() throws Exception {
        final File configFile = getFile(MapAttributeTest.class, "map_attributes/config-json.yaml");
        final Configuration config = configurationFactory.getConfig(configFile);
        final Template template = config.getTemplate("main");
        final PJsonObject pJsonObject = parseJSONObjectFromFile(MapAttributeTest.class, "map_attributes/requestData-json.json");
        final Values values = new Values(pJsonObject, template, new MapfishParser(), getTaskDirectory(), this.httpRequestFactory,
                new File("."));
        final MapAttribute.MapAttributeValues value = values.getObject("mapDef", MapAttribute.MapAttributeValues.class);
View Full Code Here



    @Test
    public void testAttributesFromYaml() throws Exception {
        final File configFile = getFile(MapAttributeTest.class, "map_attributes/config-yaml.yaml");
        final Configuration config = configurationFactory.getConfig(configFile);
        final Template template = config.getTemplate("main");
        final PJsonObject pJsonObject = parseJSONObjectFromFile(MapAttributeTest.class, "map_attributes/requestData-yaml.json");
        final Values values = new Values(pJsonObject, template, new MapfishParser(), getTaskDirectory(), this.httpRequestFactory, new File("."));
        final MapAttribute.MapAttributeValues value = values.getObject("mapDef", MapAttribute.MapAttributeValues.class);

        assertEquals(80.0, value.getDpi(), 0.1);
View Full Code Here

    }

    @Test
    public void testAttributesFromBoth() throws Exception {
        final File configFile = getFile(MapAttributeTest.class, "map_attributes/config-yaml.yaml");
        final Configuration config = configurationFactory.getConfig(configFile);
        final Template template = config.getTemplate("main");
        final PJsonObject pJsonObject = parseJSONObjectFromFile(MapAttributeTest.class, "map_attributes/requestData-json.json");
        final Values values = new Values(pJsonObject, template, new MapfishParser(), getTaskDirectory(), this.httpRequestFactory, new File("."));
        final MapAttribute.MapAttributeValues value = values.getObject("mapDef", MapAttribute.MapAttributeValues.class);

        assertEquals(90.0, value.getDpi(), 0.1);
View Full Code Here

    @Autowired
    private Map<String, OutputFormat> outputFormat;

    @Test
    public void testBasicTableProperties() 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, parser, getTaskDirectory(), this.httpRequestFactory, new File("."));
        forkJoinPool.invoke(template.getProcessorGraph().createTask(values));

        final DataSourceAttributeValue datasource = values.getObject("datasource", DataSourceAttributeValue.class);
View Full Code Here

        assertEquals(2, datasource.attributesValues.length);
    }

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

        PJsonObject requestData = loadJsonRequestData();

        final AbstractJasperReportOutputFormat format = (AbstractJasperReportOutputFormat) this.outputFormat.get("pngOutputFormat");
        JasperPrint print = format.getJasperPrint(requestData, config, config.getDirectory(), getTaskDirectory()).print;

        assertEquals(1, print.getPages().size());
            BufferedImage reportImage = ImageSimilarity.exportReportToImage(print, 0);

//            final File output = new File("e:/tmp/expected-page.png");
View Full Code Here

    final SLDTransformer transformer = new SLDTransformer();
    JsonStyleParserHelper helper;

    @Before
    public void setUp() throws Exception {
        Configuration configuration = new Configuration();
        final File file = getFile(MapfishJsonStyleParserPluginTest.class, REQUEST_DATA_STYLE_JSON_V1_STYLE_JSON);
        configuration.setConfigurationFile(file);
        helper = new JsonStyleParserHelper(configuration, new StyleBuilder(), true, Versions.ONE);
    }
View Full Code Here

    }

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

        final AbstractJasperReportOutputFormat format = (AbstractJasperReportOutputFormat) this.outputFormat.get("pngOutputFormat");
        testPrint(config, requestData, "default-aoi", format);
View Full Code Here

    @Autowired
    private Map<String, OutputFormat> outputFormat;

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

        final AbstractJasperReportOutputFormat format = (AbstractJasperReportOutputFormat) this.outputFormat.get("pngOutputFormat");
        JasperPrint print = format.getJasperPrint(requestData, config,
                getFile(JasperReportOutputFormatSimpleMapTest.class, BASE_DIR), getTaskDirectory()).print;
View Full Code Here

        new ImageSimilarity(reportImage, 50).assertSimilarity(getFile(BASE_DIR + "expectedReport.png"), 10);
    }

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

        for (OutputFormat format : this.outputFormat.values()) {
            OutputStream outputStream = new ByteArrayOutputStream();
            format.print(requestData, config,
View Full Code Here

    ConfigurationFactory configurationFactory;

    @Test
    public void testConfiguration() throws Exception {
        final File configFile = getFile(HttpConfigurationTest.class, "configuration/config.yaml");
        final Configuration config = configurationFactory.getConfig(configFile);

        assertNotNull(config.getCertificateStore());
        assertEquals("file://keystore.jks", config.getCertificateStore().getUri().toString());

        assertNotNull(config.getCertificateStore().getSSLContext());

        assertEquals(2, config.getCredentials().size());
        assertEquals(1, config.getProxies().size());
    }
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.