Index: trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java
===================================================================
--- trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java	(revision 12649)
+++ trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java	(revision 12650)
@@ -308,4 +308,13 @@
     }
 
+    /**
+     * Resets MapPaintStyles to a single source.
+     * @param source new map paint style source
+     */
+    public static void resetStylesToSingle(StyleSource source) {
+        MapPaintStyles.getStyles().clear();
+        MapPaintStyles.getStyles().add(source);
+    }
+
     private static void setFilterStyleActive(boolean active) {
         if (filterStyle.active != active) {
Index: trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.groovy
===================================================================
--- trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.groovy	(revision 12649)
+++ 	(revision )
@@ -1,107 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.mappaint.mapcss;
-
-import static org.junit.Assert.*
-
-import java.awt.Graphics2D
-import java.awt.image.BufferedImage
-
-import org.junit.*
-import org.openstreetmap.josm.JOSMFixture
-import org.openstreetmap.josm.data.Bounds
-import org.openstreetmap.josm.data.osm.DataSet
-import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer
-import org.openstreetmap.josm.gui.NavigatableComponent
-import org.openstreetmap.josm.gui.mappaint.MapPaintStyles
-import org.openstreetmap.josm.gui.preferences.SourceEntry
-import org.openstreetmap.josm.io.Compression
-import org.openstreetmap.josm.io.OsmReader
-
-/**
- * This performance test measures the time for a full run of MapPaintVisitor.visitAll()
- * against a test data set using a test style.
- *
- */
-class MapCSSPerformanceTest {
-
-    /* ------------------------ configuration section  ---------------------------- */
-    /**
-     * The path to the style file used for rendering.
-     */
-    def static STYLE_FILE="styles/standard/elemstyles.mapcss"
-
-    /**
-     * The data file to be rendered
-     */
-    def static DATA_FILE = "data_nodist/neubrandenburg.osm.bz2"
-    /* ------------------------ / configuration section  ---------------------------- */
-
-    def DataSet ds
-
-    def static boolean checkTestEnvironment() {
-          File f = new File(STYLE_FILE);
-          if ( !f.isFile() || ! f.exists()) {
-              fail("STYLE_FILE refers to '${STYLE_FILE}. This is either not a file or doesn't exist.\nPlease update configuration settings in the unit test file.")
-          }
-    }
-
-    @BeforeClass
-    public static void createJOSMFixture() {
-        JOSMFixture.createPerformanceTestFixture().init(true);
-    }
-
-    def timed(Closure c){
-        long before = System.currentTimeMillis()
-        c()
-        long after = System.currentTimeMillis()
-        return after - before
-    }
-
-    def loadStyle() {
-        print "Loading style '$STYLE_FILE' ..."
-        MapCSSStyleSource source = new MapCSSStyleSource(
-            new SourceEntry(
-                STYLE_FILE,
-                "test style",
-                "a test style",
-                true // active
-            )
-        )
-        source.loadStyleSource()
-        if (!source.errors.isEmpty()) {
-            fail("Failed to load style file ''${STYLE_FILE}''. Errors: ${source.errors}")
-        }
-        MapPaintStyles.getStyles().clear()
-        MapPaintStyles.getStyles().add(source)
-        println "DONE"
-    }
-
-    def loadData() {
-        print "Loading data file '$DATA_FILE' ..."
-        ds = OsmReader.parseDataSet(Compression.getUncompressedFileInputStream(new File(DATA_FILE)), null);
-        println "DONE"
-    }
-
-    @Test
-    public void measureTimeForStylePreparation() {
-        loadStyle()
-        loadData()
-
-        NavigatableComponent mv = new NavigatableComponent();
-        mv.setBounds(0, 0, 1024, 768)
-        BufferedImage img = new BufferedImage(mv.getWidth(), mv.getHeight(), BufferedImage.TYPE_3BYTE_BGR)
-        Graphics2D g = img.createGraphics()
-        g.setClip(0,0, mv.getWidth(), mv.getHeight())
-        StyledMapRenderer visitor = new StyledMapRenderer(g, mv, false)
-
-        print "Rendering ..."
-        long time = timed {
-            visitor.render(ds, false, new Bounds(-90,-180,90,180))
-        }
-        println "DONE"
-        println "data file : ${DATA_FILE}"
-        println "style file: ${STYLE_FILE}"
-        println ""
-        println "Rendering took $time ms."
-    }
-}
Index: trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java
===================================================================
--- trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java	(revision 12650)
+++ trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java	(revision 12650)
@@ -0,0 +1,121 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.mappaint.mapcss;
+
+import static org.junit.Assert.fail;
+
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
+import org.openstreetmap.josm.data.preferences.sources.SourceEntry;
+import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.gui.mappaint.MapRendererPerformanceTest;
+import org.openstreetmap.josm.io.Compression;
+import org.openstreetmap.josm.io.IllegalDataException;
+import org.openstreetmap.josm.io.OsmReader;
+
+/**
+ * This performance test measures the time for a full run of MapPaintVisitor.visitAll()
+ * against a test data set using a test style.
+ *
+ */
+public class MapCSSPerformanceTest {
+
+    /* ------------------------ configuration section  ---------------------------- */
+    /**
+     * The path to the style file used for rendering.
+     */
+    static final String STYLE_FILE = "styles/standard/elemstyles.mapcss";
+
+    /**
+     * The data file to be rendered
+     */
+    static final String DATA_FILE = "data_nodist/neubrandenburg.osm.bz2";
+    /* ------------------------ / configuration section  ---------------------------- */
+
+    DataSet ds;
+
+    static void checkTestEnvironment() {
+          File f = new File(STYLE_FILE);
+          if (!f.isFile() || !f.exists()) {
+              fail("STYLE_FILE refers to '"+STYLE_FILE+"'. This is either not a file or doesn't exist.\n" +
+                      "Please update configuration settings in the unit test file.");
+          }
+    }
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void createJOSMFixture() {
+        JOSMFixture.createPerformanceTestFixture().init(true);
+    }
+
+    long timed(Runnable callable) {
+        long before = System.currentTimeMillis();
+        callable.run();
+        long after = System.currentTimeMillis();
+        return after - before;
+    }
+
+    void loadStyle() {
+        System.out.println("Loading style '"+STYLE_FILE+"' ...");
+        MapCSSStyleSource source = new MapCSSStyleSource(
+            new SourceEntry(
+                STYLE_FILE,
+                "test style",
+                "a test style",
+                true // active
+            )
+        );
+        source.loadStyleSource();
+        Collection<Throwable> errors = source.getErrors();
+        if (!errors.isEmpty()) {
+            fail("Failed to load style file ''"+STYLE_FILE+"''. Errors: "+errors);
+        }
+        MapRendererPerformanceTest.resetStylesToSingle(source);
+        System.out.println("DONE");
+    }
+
+    void loadData() throws IllegalDataException, IOException {
+        System.out.print("Loading data file '"+DATA_FILE+"' ...");
+        ds = OsmReader.parseDataSet(Compression.getUncompressedFileInputStream(new File(DATA_FILE)), null);
+        System.out.println("DONE");
+    }
+
+    /**
+     * Measures time for style preparation.
+     * @throws IOException if any I/O error occurs
+     * @throws IllegalDataException if any invalid data is found
+     */
+    @Test
+    public void measureTimeForStylePreparation() throws IllegalDataException, IOException {
+        loadStyle();
+        loadData();
+
+        NavigatableComponent mv = new NavigatableComponent();
+        mv.setBounds(0, 0, 1024, 768);
+        BufferedImage img = new BufferedImage(mv.getWidth(), mv.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
+        Graphics2D g = img.createGraphics();
+        g.setClip(0, 0, mv.getWidth(), mv.getHeight());
+        StyledMapRenderer visitor = new StyledMapRenderer(g, mv, false);
+
+        System.out.print("Rendering ...");
+        long time = timed(
+            () -> visitor.render(ds, false, new Bounds(-90, -180, 90, 180))
+        );
+        System.out.println("DONE");
+        System.out.println("data file : "+DATA_FILE);
+        System.out.println("style file: "+STYLE_FILE);
+        System.out.println("");
+        System.out.println("Rendering took "+time+" ms.");
+    }
+}
