Package org.mapfish.print.test.util

Examples of org.mapfish.print.test.util.ImageSimilarity


        final BufferedImage referenceImage = ImageSimilarity.mergeImages(layerGraphics, 780, 330);

//        ImageIO.write(referenceImage, "png", new File("e:/tmp/expectedSimpleImage.png"));

        new ImageSimilarity(referenceImage, 2)
                .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.png"), 30);

    }
View Full Code Here


        assertEquals(2, layerGraphics.size());

//        Files.copy(new File(layerGraphics.get(0)), new File("/tmp/0_"+getClass().getSimpleName()+".tiff"));
//        Files.copy(new File(layerGraphics.get(1)), new File("/tmp/1_"+getClass().getSimpleName()+".tiff"));

        new ImageSimilarity(ImageSimilarity.mergeImages(layerGraphics, 630, 294), 2)
                .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 10);

    }
View Full Code Here

        List<URI> layerGraphics = (List<URI>) values.getObject("layerGraphics", List.class);
        assertEquals(1, layerGraphics.size());

        final BufferedImage img = ImageIO.read(new File(layerGraphics.get(0)));
//        ImageIO.write(img, "tiff", new File("e:/tmp/expectedSimpleImage.tiff"));
        new ImageSimilarity(img, 2).assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 30);
    }
View Full Code Here

//        Files.copy(new File(layerGraphics.get(0)), new File("/tmp/0_"+getClass().getSimpleName()+".tiff"));
//        Files.copy(new File(layerGraphics.get(1)), new File("/tmp/1_"+getClass().getSimpleName()+".tiff"));

        final BufferedImage referenceImage = ImageSimilarity.mergeImages(layerGraphics, 780, 330);
        new ImageSimilarity(referenceImage, 2)
                .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 30);

    }
View Full Code Here

//      Files.copy(new File(layerGraphics.get(0)), new File("/tmp/0_" + getClass().getSimpleName() + ".tiff"));
//      Files.copy(new File(layerGraphics.get(1)), new File("/tmp/1_" + getClass().getSimpleName() + ".tiff"));

        final BufferedImage referenceImage = ImageSimilarity.mergeImages(layerGraphics, 630, 294);
        new ImageSimilarity(referenceImage, 2)
                .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 25);
    }
View Full Code Here

        @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);
    }
View Full Code Here

//        Files.copy(new File(layerGraphics.get(0)), new File("/tmp/0_"+getClass().getSimpleName()+".tiff"));
//        Files.copy(new File(layerGraphics.get(1)), new File("/tmp/1_"+getClass().getSimpleName()+".tiff"));

        final BufferedImage referenceImage = ImageSimilarity.mergeImages(layerGraphics, 780, 330);
        new ImageSimilarity(referenceImage, 2)
                .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 30);

    }
View Full Code Here

        assertEquals(aoiDisplay == RENDER ? 3 : 2, layerGraphics.size());

        final BufferedImage actualImage = ImageSimilarity.mergeImages(layerGraphics, 630, 294);
//        ImageIO.write(actualImage, "png", new File("e:/tmp/" + expectedImageName));
        File expectedImage = getFile(BASE_DIR + "/output/" + expectedImageName);
        new ImageSimilarity(actualImage, 2).assertSimilarity(expectedImage, 50);
    }
View Full Code Here

        String fileName = servletGetReportResponse.getHeader("Content-disposition").split("=")[1];
        assertEquals("test_report-" + year + ".png", fileName);

        final BufferedImage reportAsImage = ImageIO.read(new ByteArrayInputStream(report));

        new ImageSimilarity(reportAsImage, 2).assertSimilarity(getFile(MapPrinterServletSecurityTest.class, "expectedSimpleImage.png"), 10);
        return report;
    }
View Full Code Here

//        Files.copy(new File(layerGraphics.get(0)), new File("/tmp/0_" + getClass().getSimpleName() + ".tiff"));
//        Files.copy(new File(layerGraphics.get(1)), new File("/tmp/1_" + getClass().getSimpleName() + ".tiff"));

        final BufferedImage referenceImage = ImageSimilarity.mergeImages(layerGraphics, 780, 330);

        new ImageSimilarity(referenceImage, 2)
                .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 30);

        URI scalebarGraphic = values.getObject("graphic", URI.class);
//        Files.copy(new File(scalebarGraphic), new File("e:/tmp/expectedScalebar_" + getClass().getSimpleName() + ".tiff"));

        new ImageSimilarity(new File(scalebarGraphic), 4).assertSimilarity(getFile(BASE_DIR + ScalebarDrawerTest.expectedDir + "expectedScalebar.tiff"), 5);

    }
View Full Code Here

TOP

Related Classes of org.mapfish.print.test.util.ImageSimilarity

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.