Index: trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.groovy
===================================================================
--- trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.groovy	(revision 7141)
+++ trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.groovy	(revision 7142)
@@ -8,4 +8,5 @@
 
 import org.junit.*
+import org.openstreetmap.josm.JOSMFixture
 import org.openstreetmap.josm.Main
 import org.openstreetmap.josm.data.Bounds
@@ -13,7 +14,8 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer
 import org.openstreetmap.josm.gui.MainApplication
-import org.openstreetmap.josm.gui.layer.OsmDataLayer
+import org.openstreetmap.josm.gui.NavigatableComponent
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles
 import org.openstreetmap.josm.gui.preferences.SourceEntry
+import org.openstreetmap.josm.gui.preferences.ToolbarPreferences
 import org.openstreetmap.josm.io.Compression
 import org.openstreetmap.josm.io.OsmReader
@@ -27,9 +29,4 @@
 
     /* ------------------------ configuration section  ---------------------------- */
-    /**
-     * The path to the JOSM home environment
-     */
-    def static JOSM_HOME="test/config/performance-josm.home"
-
     /**
      * The path to the style file used for rendering.
@@ -46,10 +43,5 @@
 
     def static boolean checkTestEnvironment() {
-          File f = new File(JOSM_HOME)
-          if  (!f.isDirectory() || !f.exists()) {
-              fail("JOSM_HOME refers to '${JOSM_HOME}. This is either not a directory or doesn't exist.\nPlease update configuration settings in the unit test file.")
-          }
-
-          f = new File(STYLE_FILE);
+          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.")
@@ -58,8 +50,8 @@
 
     @BeforeClass
-    public static void createJOSMFixture(){
-        checkTestEnvironment()
-        System.setProperty("josm.home", JOSM_HOME)
-        MainApplication.main(new String[0])
+    public static void createJOSMFixture() {
+        JOSMFixture.createPerformanceTestFixture().init();
+        Main.toolbar = new ToolbarPreferences();
+        new MainApplication();
     }
 
@@ -71,5 +63,5 @@
     }
 
-    def  loadStyle() {
+    def loadStyle() {
         print "Loading style '$STYLE_FILE' ..."
         MapCSSStyleSource source = new MapCSSStyleSource(
@@ -93,5 +85,4 @@
         print "Loading data file '$DATA_FILE' ..."
         ds = OsmReader.parseDataSet(Compression.getUncompressedFileInputStream(new File(DATA_FILE)), null);
-        Main.main.addLayer(new OsmDataLayer(ds,"test layer",null /* no file */));
         println "DONE"
     }
@@ -102,10 +93,10 @@
         loadData()
 
-        def mv = Main.map.mapView
-
+        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())
-        def visitor = new StyledMapRenderer(g, Main.map.mapView, false)
+        StyledMapRenderer visitor = new StyledMapRenderer(g, mv, false)
 
         print "Rendering ..."
