Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java	(revision 11661)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java	(revision 11691)
@@ -5,5 +5,7 @@
 import static org.junit.Assert.fail;
 
+import java.awt.Graphics2D;
 import java.awt.Point;
+import java.awt.RenderingHints;
 import java.awt.image.BufferedImage;
 import java.io.File;
@@ -11,4 +13,6 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -18,5 +22,6 @@
 import javax.imageio.ImageIO;
 
-import org.junit.Ignore;
+import org.junit.Assume;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -65,5 +70,5 @@
      * @return The parameters.
      */
-    @Parameters
+    @Parameters(name="{1}")
     public static Collection<Object[]> runs() {
         return Stream.of(
@@ -74,5 +79,5 @@
                 new TestConfig("way-width", AREA_DEFAULT)
 
-                ).map(e -> new Object[] {e})
+                ).map(e -> new Object[] {e, e.testDirectory})
                 .collect(Collectors.toList());
     }
@@ -80,7 +85,19 @@
     /**
      * @param testConfig The config to use for this test.
-     */
-    public MapCSSRendererTest(TestConfig testConfig) {
+     * @param ignored The name to print it nicely
+     */
+    public MapCSSRendererTest(TestConfig testConfig, String ignored) {
         this.testConfig = testConfig;
+    }
+
+    /**
+     * This test only runs on OpenJDK.
+     * It is ignored for other Java versions since they differ slightly in their rendering engine.
+     * @since 11691
+     */
+    @Before
+    public void testForOpenJDK() {
+        String javaHome = System.getProperty("java.home");
+        Assume.assumeTrue(javaHome != null && javaHome.contains("openjdk"));
     }
 
@@ -90,5 +107,4 @@
      */
     @Test
-    @Ignore("not ready")
     public void testRender() throws Exception {
         // load the data
@@ -131,5 +147,16 @@
         nc.zoomTo(testConfig.testArea);
         dataSet.allPrimitives().stream().forEach(n -> n.setHighlighted(n.isKeyTrue("highlight")));
-        new StyledMapRenderer(image.createGraphics(), nc, false).render(dataSet, false, testConfig.testArea);
+        Graphics2D g = image.createGraphics();
+        // Force all render hints to be defaults - do not use platform values
+        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        g.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+        g.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+        g.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
+        g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+        g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+        g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+        g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
+        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+        new StyledMapRenderer(g, nc, false).render(dataSet, false, testConfig.testArea);
 
         BufferedImage reference = testConfig.getReference();
@@ -140,4 +167,5 @@
 
         StringBuilder differences = new StringBuilder();
+        ArrayList<Point> differencePoints = new ArrayList<>();
 
         for (int y = 0; y < reference.getHeight(); y++) {
@@ -145,21 +173,48 @@
                 int expected = reference.getRGB(x, y);
                 int result = image.getRGB(x, y);
-                if (expected != result && differences.length() < 500) {
-                    differences.append("\nDifference at ")
-                               .append(x)
-                               .append(",")
-                               .append(y)
-                               .append(": Expected ")
-                               .append(Integer.toHexString(expected))
-                               .append(" but got ")
-                               .append(Integer.toHexString(result));
+                if (!colorsAreSame(expected, result)) {
+                    differencePoints.add(new Point(x, y));
+                    if (differences.length() < 500) {
+                        differences.append("\nDifference at ")
+                        .append(x)
+                        .append(",")
+                        .append(y)
+                        .append(": Expected ")
+                        .append(Integer.toHexString(expected))
+                        .append(" but got ")
+                        .append(Integer.toHexString(result));
+                    }
                 }
             }
         }
 
-        if (differences.length() > 0) {
+        if (differencePoints.size() > 0) {
             // You can use this to debug:
             ImageIO.write(image, "png", new File(testConfig.getTestDirectory() + "/test-output.png"));
-            fail("Images for test " + testConfig.testDirectory + " differ: " + differences.toString());
+
+            // Add a nice image that highlights the differences:
+            BufferedImage diffImage = new BufferedImage(IMAGE_SIZE, IMAGE_SIZE, BufferedImage.TYPE_INT_ARGB);
+            for (Point p : differencePoints) {
+                diffImage.setRGB(p.x, p.y, 0xffff0000);
+            }
+            ImageIO.write(diffImage, "png", new File(testConfig.getTestDirectory() + "/test-differences.png"));
+
+            fail(MessageFormat.format("Images for test {1} differ at {2} points: {3}",
+                    testConfig.testDirectory, differencePoints.size(), differences.toString()));
+        }
+    }
+
+    /**
+     * Check if two colors differ
+     * @param expected
+     * @param result
+     * @return <code>true</code> if they differ.
+     */
+    private boolean colorsAreSame(int expected, int result) {
+        int expectedAlpha = expected >> 24;
+        if (expectedAlpha == 0) {
+            return (result & 0xff000000) == 0;
+        } else {
+            return expected == result;
         }
     }
