Package org.mapfish.print.wrapper.json

Examples of org.mapfish.print.wrapper.json.PJsonObject


    @Test
    public void testDefaultPointSymbolizer() throws Exception {
        helper.setAllowNullSymbolizer(false);
        JSONObject json = new JSONObject();
        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final PointSymbolizer pointSymbolizer = this.helper.createPointSymbolizer(pJson);
        assertNotNull(pointSymbolizer);

        final Graphic graphic = pointSymbolizer.getGraphic();
        assertEquals(1, graphic.graphicalSymbols().size());
View Full Code Here


        helper.setAllowNullSymbolizer(false);
        helper.setVersion(Versions.TWO);
        JSONObject json = new JSONObject();
        json.put(JsonStyleParserHelper.JSON_STROKE_DASHSTYLE, "5 4");

        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final PointSymbolizer pointSymbolizer = this.helper.createPointSymbolizer(pJson);
        assertNotNull(pointSymbolizer);

        final Graphic graphic = pointSymbolizer.getGraphic();
        Mark mark = (Mark) graphic.graphicalSymbols().get(0);
View Full Code Here

    @Test
    public void testDefaultLineSymbolizer() throws Exception {
        helper.setAllowNullSymbolizer(false);
        JSONObject json = new JSONObject();
        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final LineSymbolizer lineSymbolizer = this.helper.createLineSymbolizer(pJson);
        assertNotNull(lineSymbolizer);

        final Stroke stroke = lineSymbolizer.getStroke();
        assertNotNull(stroke);
View Full Code Here

        helper.setAllowNullSymbolizer(false);
        helper.setVersion(Versions.TWO);
        JSONObject json = new JSONObject();
        json.put(JsonStyleParserHelper.JSON_STROKE_DASHSTYLE, "5 4");

        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final LineSymbolizer lineSymbolizer = this.helper.createLineSymbolizer(pJson);
        assertNotNull(lineSymbolizer);

        final Stroke stroke = lineSymbolizer.getStroke();
        assertArrayEquals(Arrays.toString(stroke.getDashArray()), new float[]{5f, 4f}, stroke.getDashArray(), FLOAT_DELTA);
View Full Code Here

        setUpConfigFiles();

        final MockHttpServletRequest servletCreateRequest = new MockHttpServletRequest();
        final MockHttpServletResponse servletCreateResponse = new MockHttpServletResponse();

        final PJsonObject requestJson = parseJSONObjectFromFile(MapPrinterServletTest.class, "requestData.json");
        requestJson.getInternalObj().put("attributes", new JSONObject());
        String requestData = requestJson.getInternalObj().toString();

        this.servlet.createReportAndGetNoAppId("png", requestData, false, servletCreateRequest, servletCreateResponse);
        assertEquals(HttpStatus.INTERNAL_SERVER_ERROR.value(), servletCreateResponse.getStatus());
    }
View Full Code Here

    @Test
    public void testDefaultPolygonSymbolizer() throws Exception {
        helper.setAllowNullSymbolizer(false);
        JSONObject json = new JSONObject();
        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final PolygonSymbolizer polygonSymbolizer = this.helper.createPolygonSymbolizer(pJson);
        assertNotNull(polygonSymbolizer);

        final Stroke stroke = polygonSymbolizer.getStroke();
        assertNotNull(stroke);
View Full Code Here

        helper.setAllowNullSymbolizer(false);
        helper.setVersion(Versions.TWO);
        JSONObject json = new JSONObject();
        json.put(JsonStyleParserHelper.JSON_STROKE_DASHSTYLE, "5 4");

        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final PolygonSymbolizer polygonSymbolizer = this.helper.createPolygonSymbolizer(pJson);
        assertNotNull(polygonSymbolizer);

        final Stroke stroke = polygonSymbolizer.getStroke();
        assertArrayEquals(Arrays.toString(stroke.getDashArray()), new float[]{5f, 4f}, stroke.getDashArray(), FLOAT_DELTA);
View Full Code Here

        helper.setAllowNullSymbolizer(false);
        helper.setVersion(Versions.TWO);
        JSONObject json = new JSONObject();
        json.put(JsonStyleParserHelper.JSON_LABEL, label);
        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final TextSymbolizer textSymbolizer = this.helper.createTextSymbolizer(pJson);
        assertNotNull(textSymbolizer);

        assertNotNull(textSymbolizer.getFill());
    }
View Full Code Here

        this.servlet.getCapabilities(false, "", servletResponse);
        assertEquals(HttpStatus.OK.value(), servletResponse.getStatus());

        final String contentAsString = servletResponse.getContentAsString();
        assertFalse(contentAsString.contains("\n"));
        final PJsonObject getInfoJson = parseJSONObjectFromString(contentAsString);

        assertTrue(getInfoJson.has("layouts"));
        final PJsonArray layouts = getInfoJson.getJSONArray("layouts");
        assertEquals(2, layouts.size());
        final PObject mainLayout = layouts.getObject(0);
        assertEquals("A4 Landscape", mainLayout.getString("name"));
        assertTrue(mainLayout.has("attributes"));
        assertEquals(2, mainLayout.getArray("attributes").size());
        assertEquals("imageMap", mainLayout.getArray("attributes").getObject(1).getString("name"));
        assertTrue(getInfoJson.has("formats"));
        final PJsonArray formats = getInfoJson.getJSONArray("formats");
        assertCapabilitiesFormats(formats);

    }
View Full Code Here

        helper.setVersion(Versions.TWO);
        JSONObject json = new JSONObject();
        json.put(JsonStyleParserHelper.JSON_LABEL, label);
        json.put(JsonStyleParserHelper.JSON_FONT_COLOR, "red");

        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final TextSymbolizer textSymbolizer = this.helper.createTextSymbolizer(pJson);
        assertNotNull(textSymbolizer);

        assertNotNull(textSymbolizer.getFill());
        assertEquals("#FF0000", valueOf(textSymbolizer.getFill().getColor()));
View Full Code Here

TOP

Related Classes of org.mapfish.print.wrapper.json.PJsonObject

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.