Index: /trunk/.classpath
===================================================================
--- /trunk/.classpath	(revision 7067)
+++ /trunk/.classpath	(revision 7068)
@@ -4,6 +4,6 @@
 	<classpathentry kind="src" path="test/unit"/>
 	<classpathentry kind="src" path="test/functional"/>
+	<classpathentry kind="src" path="test/performance"/>
 	<classpathentry excluding="build/|data_nodist/|dist/|doc/|lib/|macosx/|nb/|src/|test/|test/build/|test/functional/|test/performance/|test/unit/|tools/|utils/" kind="src" path=""/>
-	<classpathentry kind="src" path="test/performance"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
 	<classpathentry kind="lib" path="test/lib/fest/fest-assert-1.0.jar"/>
Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 7067)
+++ /trunk/build.xml	(revision 7068)
@@ -199,13 +199,13 @@
     </target>
     <target name="compile" depends="init,javacc">
-    	<!-- COTS -->
+        <!-- COTS -->
         <javac srcdir="src" includes="com/**,oauth/**,org/apache/commons/codec/**,org/glassfish/**" nowarn="on"
-        	destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="iso-8859-1">
+            destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="iso-8859-1">
             <!-- get rid of "internal proprietary API" warning -->
-        	<compilerarg value="-XDignore.symbol.file"/>
+            <compilerarg value="-XDignore.symbol.file"/>
         </javac>
         <!-- JMapViewer/JOSM -->
         <javac srcdir="src" excludes="com/**,oauth/**,org/apache/commons/codec/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java" 
-        	destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
+            destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
             <compilerarg value="-Xlint:cast"/>
             <compilerarg value="-Xlint:deprecation"/>
@@ -261,7 +261,25 @@
         <pathelement path="tools/groovy-all-2.2.2.jar"/>
     </path>
+    <macrodef name="init-test-preferences">
+        <attribute name="testfamily"/>
+        <sequential>
+            <copy file="${test.dir}/config/preferences.template.xml" tofile="${test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
+            <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
+            <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
+        	<!-- Works only on Windows, does nothing on Unix -->
+        	<attrib file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" readonly="true"/>
+            <!-- Works only on Unix, does nothing on Windows -->
+        	<chmod file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" perm="a-w"/>
+        </sequential>
+    </macrodef>
     <target name="test-init">
         <mkdir dir="${test.dir}/build"/>
+        <mkdir dir="${test.dir}/build/unit"/>
+        <mkdir dir="${test.dir}/build/functional"/>
+        <mkdir dir="${test.dir}/build/performance"/>
         <mkdir dir="${test.dir}/report"/>
+        <init-test-preferences testfamily="unit"/>
+        <init-test-preferences testfamily="functional"/>
+        <init-test-preferences testfamily="performance"/>
     </target>
     <target name="test-clean">
@@ -269,37 +287,77 @@
         <delete dir="${test.dir}/report"/>
         <delete file="${test.dir}/jacoco.exec" />
-    </target>
+        <delete file="${test.dir}/config/unit-josm.home/preferences.xml" />
+        <delete file="${test.dir}/config/functional-josm.home/preferences.xml" />
+        <delete file="${test.dir}/config/performance-josm.home/preferences.xml" />
+        <delete dir="${test.dir}/config/unit-josm.home/cache" failonerror="false"/>
+        <delete dir="${test.dir}/config/functional-josm.home/cache" failonerror="false"/>
+        <delete dir="${test.dir}/config/performance-josm.home/cache" failonerror="false"/>
+    </target>
+    <macrodef name="call-groovyc">
+        <attribute name="testfamily"/>
+        <element name="cp-elements"/>
+        <sequential>
+            <groovyc srcdir="${test.dir}/@{testfamily}" destdir="${test.dir}/build/@{testfamily}" encoding="UTF-8">
+                <classpath>
+                    <cp-elements/>
+                </classpath>
+                <javac target="1.7" source="1.7" debug="on">
+                    <compilerarg value="-Xlint:all"/>
+                    <compilerarg value="-Xlint:-serial"/>
+                </javac>
+            </groovyc>
+        </sequential>
+    </macrodef>
     <target name="test-compile" depends="test-init,dist">
         <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="tools/groovy-all-2.2.2.jar"/>
-        <groovyc classpathref="test.classpath" destdir="${test.dir}/build" encoding="UTF-8">
-        	<src path="${test.dir}/unit"/>
-            <src path="${test.dir}/functional"/>
-            <src path="${test.dir}/performance"/>
-        	<javac target="1.7" source="1.7" debug="on">
-                <compilerarg value="-Xlint:all"/>
-                <compilerarg value="-Xlint:-serial"/>
-        	</javac>
-        </groovyc>
-    </target>
-    <target name="test" depends="test-compile">
+        <call-groovyc testfamily="unit">
+            <cp-elements>
+                <path refid="test.classpath"/>
+            </cp-elements>
+        </call-groovyc>
+        <call-groovyc testfamily="functional">
+            <cp-elements>
+                <path refid="test.classpath"/>
+                <pathelement path="${test.dir}/build/unit"/>
+            </cp-elements>
+        </call-groovyc>
+        <call-groovyc testfamily="performance">
+            <cp-elements>
+                <path refid="test.classpath"/>
+                <pathelement path="${test.dir}/build/unit"/>
+            </cp-elements>
+        </call-groovyc>
+    </target>
+    <macrodef name="call-junit">
+        <attribute name="testfamily"/>
+        <sequential>
+            <echo message="Running @{testfamily} tests with JUnit"/>
+            <jacoco:coverage destfile="${test.dir}/jacoco.exec">
+                <junit printsummary="yes" fork="true" forkmode="once">
+                    <sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/>
+                    <sysproperty key="josm.test.data" value="${test.dir}/data"/>
+                    <sysproperty key="java.awt.headless" value="true"/>
+                    <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
+                    <classpath>
+                        <path refid="test.classpath"/>
+                        <pathelement path="${test.dir}/build/unit"/>
+                        <pathelement path="${test.dir}/build/@{testfamily}"/>
+                        <pathelement path="${test.dir}/config"/>
+                    </classpath>
+                    <formatter type="plain"/>
+                    <formatter type="xml"/>
+                    <batchtest fork="yes" todir="${test.dir}/report">
+                        <fileset dir="${test.dir}/build/@{testfamily}" includes="**/*Test.class"/>
+                    </batchtest>
+                </junit>
+            </jacoco:coverage>
+        </sequential>
+    </macrodef>
+    <target name="test" depends="test-compile" 
+    	description="Run unit, functional and performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
         <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
-        <jacoco:coverage destfile="${test.dir}/jacoco.exec">
-            <junit printsummary="yes" fork="true" forkmode="once">
-                <sysproperty key="josm.home" value="${test.dir}/config/unit-josm.home"/>
-                <sysproperty key="josm.test.data" value="${test.dir}/data"/>
-                <sysproperty key="java.awt.headless" value="true"/>
-                <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
-                <classpath>
-                    <path refid="test.classpath"/>
-                    <pathelement path="${test.dir}/build"/>
-                    <pathelement path="${test.dir}/config"/>
-                </classpath>
-                <formatter type="plain"/>
-                <formatter type="xml"/>
-                <batchtest fork="yes" todir="${test.dir}/report">
-                    <fileset dir="${test.dir}/build" includes="**/*Test.class"/>
-                </batchtest>
-            </junit>
-        </jacoco:coverage>
+        <call-junit testfamily="unit"/>
+        <call-junit testfamily="functional"/>
+        <call-junit testfamily="performance"/>
     </target>
     <target name="test-html" depends="test" description="Generate HTML test reports">
Index: /trunk/test/config/preferences.template.xml
===================================================================
--- /trunk/test/config/preferences.template.xml	(revision 7068)
+++ /trunk/test/config/preferences.template.xml	(revision 7068)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<preferences xmlns="http://josm.openstreetmap.de/preferences-1.0">
+  <tag key='expert' value='true'/>
+  <tag key='language' value='en'/>
+  <tag key='osm-server.url' value='http://api06.dev.openstreetmap.org/api'/>
+  <tag key='osm-server.username' value='@OSM_USERNAME@'/>
+  <tag key='osm-server.password' value='@OSM_PASSWORD@'/>
+</preferences>
Index: unk/test/config/test-functional-env.properties
===================================================================
--- /trunk/test/config/test-functional-env.properties	(revision 7067)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#
-# This file includes properties which are used by all JOSM functional tests 
-#
-
-#### 
-# josm.home - the home directory of the JOSM installation to be used in functional tests
-#
-# This is the home directory for JOSM preferences: ${josm.home}\preferences
-# This is the home directory for JOSM plugins: ${josm.home}\plugins\*.jar
-#
-josm.home=C:\\data\\projekte\\osm\\josm-dev
-
-
-####
-# test.functional.tempdir - the directory in which functional test case can save
-#   temporary results 
-#
-test.functional.tempdir=C:\\data\\projekte\\osm\\josm-dev\\temp
-
Index: unk/test/config/test-unit-env.properties
===================================================================
--- /trunk/test/config/test-unit-env.properties	(revision 7067)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#
-# This file includes properties which are used by all JOSM unit test 
-#
-
-#### 
-# josm.home - the home directory of the JOSM installation to be used in unit tests
-#
-# This is the home directory for JOSM preferences: ${josm.home}\preferences
-# This is the home directory for JOSM plugins: ${josm.home}\plugins\*.jar
-#
-josm.home=C:\\data\\projekte\\osm\\repositories\\josm-github-Gubaer\\test\\config\\unit-josm.home
-
Index: unk/test/config/unit-josm.home/preferences
===================================================================
--- /trunk/test/config/unit-josm.home/preferences	(revision 7067)
+++ 	(revision )
@@ -1,57 +1,0 @@
-agpifoj.visible=true
-cache.motd.html=1243869814
-color.background=#FFFFFF
-color.gps marker=#660066
-color.gps point=#660066
-commandstack.visible=true
-conflict.resolution=extended
-conflict.visible=true
-conflictresolutiondialog.height=824
-conflictresolutiondialog.width=1193
-conflictresolutiondialog.x=149
-conflictresolutiondialog.y=88
-coordinates=DECIMAL_DEGREES
-download.gps=false
-download.osm=true
-download.tab=2
-draw.rawgps.direction=true
-history.visible=true
-josm.version=1627 SVN
-laf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel
-language=en
-layerlist.visible=true
-marker.audiofromstart=false
-marker.buttonlabels=false
-marker.show test.osm=hide
-osm-server.url=http://api06.dev.openstreetmap.org/api
-projection=org.openstreetmap.josm.data.projection.Epsg4326
-propertiesdialog.visible=true
-proxy.anonymous=false
-proxy.enable=false
-relationlist.visible=true
-save.keepbackup=false
-selectionlist.visible=true
-shortcut.groups.1=128
-shortcut.groups.10=64
-shortcut.groups.11=576
-shortcut.groups.12=64
-shortcut.groups.13=512
-shortcut.groups.15=640
-shortcut.groups.16=640
-shortcut.groups.17=576
-shortcut.groups.18=512
-shortcut.groups.19=128
-shortcut.groups.2=128
-shortcut.groups.20=512
-shortcut.groups.3=0
-shortcut.groups.4=512
-shortcut.groups.5=0
-shortcut.groups.6=512
-shortcut.groups.8=192
-shortcut.groups.9=192
-shortcut.groups.configured=true
-slippy_map_chooser.max_tiles=200
-upload.comment.history=automatic test uploadÂ§Â§Â§test§§§rcn84 - some fixes§§§testing JOSM ticket #2545 §§§bug hunting - please ignore§§§test uploadsdf§§§test upload§§§test swissgrid
-validator.tests=OverlappingWays=true,UnconnectedWays=true,SelfIntersectingWay=true,Coastlines=true,UnclosedWays=true,UntaggedWay=true,DuplicatedWayNodes=true,CrossingWays=true,SimilarNamedWays=true,WronglyOrderedWays=true,TagChecker=true,NodesWithSameName=true,DuplicateNode=true,UntaggedNode=true
-validator.testsBeforeUpload=OverlappingWays=true,UnconnectedWays=true,SelfIntersectingWay=true,Coastlines=true,UnclosedWays=true,UntaggedWay=true,DuplicatedWayNodes=true,CrossingWays=true,SimilarNamedWays=true,WronglyOrderedWays=true,TagChecker=true,NodesWithSameName=true,DuplicateNode=true,UntaggedNode=true
-validator.visible=true
Index: /trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
===================================================================
--- /trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java	(revision 7067)
+++ /trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java	(revision 7068)
@@ -10,5 +10,4 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
@@ -16,7 +15,5 @@
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Properties;
 import java.util.Set;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -24,4 +21,5 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -40,4 +38,8 @@
 import org.openstreetmap.josm.tools.Utils;
 
+/**
+ * Reads primitives referring to a particular primitive (ways including a node, relations referring to a relation)
+ * @since 1806
+ */
 public class OsmServerBackreferenceReaderTest {
     static private final Logger logger = Logger.getLogger(OsmServerBackreferenceReader.class.getName());
@@ -47,7 +49,7 @@
             if (("node-" + i).equals(n.get("name"))) return n;
         }
+        fail("Cannot find node "+i);
         return null;
     }
-
 
     protected static Way lookupWay(DataSet ds, int i) {
@@ -55,4 +57,5 @@
             if (("way-" + i).equals(w.get("name"))) return w;
         }
+        fail("Cannot find way "+i);
         return null;
     }
@@ -62,4 +65,5 @@
             if (("relation-" + i).equals(r.get("name"))) return r;
         }
+        fail("Cannot find relation "+i);
         return null;
     }
@@ -107,5 +111,4 @@
         }
     }
-
 
     protected static DataSet buildTestDataSet() {
@@ -137,69 +140,21 @@
     }
 
-    static Properties testProperties;
     static DataSet testDataSet;
 
     @BeforeClass
-    public static void  init() throws OsmTransferException {
+    public static void init() throws OsmTransferException {
         logger.info("initializing ...");
-        testProperties = new Properties();
-
-        // load properties
-        //
-        try (InputStream is = MultiFetchServerObjectReaderTest.class.getResourceAsStream("/test-functional-env.properties")) {
-            if (is == null) {
-                throw new IOException();
-            }
-            testProperties.load(is);
-        } catch(IOException e){
-            logger.log(Level.SEVERE, MessageFormat.format("failed to load property file ''{0}''", "test-functional-env.properties"));
-            fail(MessageFormat.format("failed to load property file ''{0}''", "test-functional-env.properties"));
-        }
-
-        // check josm.home
-        //
-        String josmHome = testProperties.getProperty("josm.home");
-        if (josmHome == null) {
-            fail(MessageFormat.format("property ''{0}'' not set in test environment", "josm.home"));
-        } else {
-            File f = new File(josmHome);
-            if (! f.exists() || ! f.canRead()) {
-                fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing or not readable", "josm.home", josmHome));
-            }
-        }
-
-        // check temp output dir
-        //
-        String tempOutputDir = testProperties.getProperty("test.functional.tempdir");
-        if (tempOutputDir == null) {
-            fail(MessageFormat.format("property ''{0}'' not set in test environment", "test.functional.tempdir"));
-        } else {
-            File f = new File(tempOutputDir);
-            if (! f.exists() || ! f.isDirectory() || ! f.canWrite()) {
-                fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing, not a directory, or not writeable", "test.functional.tempdir", tempOutputDir));
-            }
-        }
-
-
-        // init preferences
-        //
-        System.setProperty("josm.home", josmHome);
-        Main.pref.init(false);
+
+        JOSMFixture.createFunctionalTestFixture().init();
+
         // don't use atomic upload, the test API server can't cope with large diff uploads
         //
         Main.pref.put("osm-server.atomic-upload", false);
         Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
-
-        File dataSetCacheOutputFile = new File(tempOutputDir, MultiFetchServerObjectReaderTest.class.getName() + ".dataset");
-
-        // make sure we don't upload to production
-        //
-        String url = OsmApi.getOsmApi().getBaseUrl().toLowerCase().trim();
-        if (url.startsWith("http://www.openstreetmap.org") || url.startsWith("http://api.openstreetmap.org")
-            || url.startsWith("https://www.openstreetmap.org") || url.startsWith("https://api.openstreetmap.org")) {
-            fail(MessageFormat.format("configured url ''{0}'' seems to be a productive url, aborting.", url));
-        }
-
-        String p = System.getProperties().getProperty("useCachedDataset");
+        Main.logLevel = 4;
+
+        File dataSetCacheOutputFile = new File(System.getProperty("java.io.tmpdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset");
+
+        String p = System.getProperty("useCachedDataset");
         if (p != null && Boolean.parseBoolean(p.trim().toLowerCase())) {
             logger.info(MessageFormat.format("property ''{0}'' set, using cached dataset", "useCachedDataset"));
@@ -239,5 +194,5 @@
     @Before
     public void setUp() throws IOException, IllegalDataException {
-        File f = new File(testProperties.getProperty("test.functional.tempdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset");
+        File f = new File(System.getProperty("java.io.tmpdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset");
         logger.info(MessageFormat.format("reading cached dataset ''{0}''", f.toString()));
         ds = new DataSet();
Index: unk/test/performance/org/openstreetmap/josm/data/osm/MapPaintVisitorPerformanceTest.java
===================================================================
--- /trunk/test/performance/org/openstreetmap/josm/data/osm/MapPaintVisitorPerformanceTest.java	(revision 7067)
+++ 	(revision )
@@ -1,112 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.data.osm;
-
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-import java.io.FileInputStream;
-import java.io.InputStream;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
-import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
-import org.openstreetmap.josm.data.projection.Projections;
-import org.openstreetmap.josm.gui.NavigatableComponent;
-import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
-import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
-import org.openstreetmap.josm.io.OsmReader;
-
-public class MapPaintVisitorPerformanceTest {
-
-    private static final int IMG_WIDTH = 1400;
-    private static final int IMG_HEIGHT = 1050;
-
-    private static Graphics2D g;
-    private static BufferedImage img;
-    private static NavigatableComponent nc;
-    private static DataSet dsRestriction;
-    private static DataSet dsMultipolygon;
-    private static DataSet dsCity;
-
-    @BeforeClass
-    public static void load() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
-        img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_3BYTE_BGR);
-        g = (Graphics2D)img.getGraphics();
-        nc = new NavigatableComponent();
-        nc.setBounds(0, 0, IMG_WIDTH, IMG_HEIGHT);
-
-        // TODO Test should have it's own copy of styles because change in style can influence performance
-        Main.pref.load();
-        MapPaintStyles.readFromPreferences();
-
-        try (
-            InputStream fisR = new FileInputStream("data_nodist/restriction.osm");
-            InputStream fisM = new FileInputStream("data_nodist/multipolygon.osm");
-            InputStream fisC = new FileInputStream("data_nodist/neubrandenburg.osm");
-        ) {
-            dsRestriction = OsmReader.parseDataSet(fisR, NullProgressMonitor.INSTANCE);
-            dsMultipolygon = OsmReader.parseDataSet(fisM, NullProgressMonitor.INSTANCE);
-            dsCity = OsmReader.parseDataSet(fisC, NullProgressMonitor.INSTANCE);
-        }
-
-        // Warm up
-        new MapPaintVisitorPerformanceTest().testRestrictionSmall();
-        new MapPaintVisitorPerformanceTest().testCity();
-    }
-
-    private static void test(int iterations, DataSet ds, Bounds bounds) throws Exception {
-        Rendering visitor = new StyledMapRenderer(g,nc,false);
-        nc.zoomTo(bounds);
-        for (int i=0; i<iterations; i++) {
-            visitor.render(ds, true, bounds);
-        }
-    }
-
-    @Test
-    public void testRestriction() throws Exception {
-        test(700, dsRestriction, new Bounds(51.12, 14.147472381591795, 51.128, 14.162492752075195));
-    }
-
-    @Test
-    public void testRestrictionSmall() throws Exception {
-        test(1500, dsRestriction, new Bounds(51.125, 14.147, 51.128, 14.152));
-    }
-
-    @Test
-    public void testMultipolygon() throws Exception {
-        test(400, dsMultipolygon, new Bounds(60, -180, 85, -122));
-    }
-
-    @Test
-    public void testMultipolygonSmall() throws Exception {
-        test(850, dsMultipolygon, new Bounds(-90, -180, 90, 180));
-    }
-
-    @Test
-    public void testCity() throws Exception {
-        test(50, dsCity, new Bounds(53.51, 13.20, 53.59, 13.34));
-    }
-
-    @Test
-    public void testCitySmall() throws Exception {
-        test(70, dsCity, new Bounds(52, 11, 55, 14));
-    }
-
-    @Test
-    public void testCityPart1() throws Exception {
-        test(250, dsCity, new Bounds(53.56, 13.25, 53.57, 13.26));
-    }
-
-    @Test
-    public void testCityPart2() throws Exception {
-        test(200, dsCity, new Bounds(53.55, 13.29, 53.57, 13.30));
-    }
-
-    @Test
-    public void testCitySmallPart2() throws Exception {
-        test(200, dsCity, new Bounds(53.56, 13.295, 53.57, 13.30));
-    }
-}
Index: /trunk/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java
===================================================================
--- /trunk/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java	(revision 7067)
+++ /trunk/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java	(revision 7068)
@@ -1,3 +1,6 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.data.osm;
+
+import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
@@ -5,8 +8,6 @@
 import org.openstreetmap.josm.data.coor.LatLonTest;
 
-import static org.junit.Assert.assertTrue;
+public class RoundingPerformanceTest {
 
-public class RoundingPerformanceTest extends LatLonTest {
-    
     private static double oldRoundToOsmPrecision(double value) {
         return Math.round(value / LatLon.MAX_SERVER_PRECISION) * LatLon.MAX_SERVER_PRECISION; // Old method, causes rounding errors, but efficient
@@ -18,5 +19,5 @@
         long start = System.nanoTime();
         for (int i = 0; i < n; i++) {
-            for (double value : sampleValues) {
+            for (double value : LatLonTest.SAMPLE_VALUES) {
                 oldRoundToOsmPrecision(value);
             }
@@ -25,8 +26,8 @@
         long oldTime = end-start;
         System.out.println("Old time: "+oldTime/1000000.0 + " ms");
-        
+
         start = System.nanoTime();
         for (int i = 0; i < n; i++) {
-            for (double value : sampleValues) {
+            for (double value : LatLonTest.SAMPLE_VALUES) {
                 LatLon.roundToOsmPrecision(value);
             }
@@ -35,5 +36,5 @@
         long newTime = end-start;
         System.out.println("New time: "+newTime/1000000.0 + " ms");
-        
+
         assertTrue(newTime <= oldTime*10);
     }
Index: /trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java
===================================================================
--- /trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java	(revision 7068)
+++ /trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java	(revision 7068)
@@ -0,0 +1,113 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm.visitor.paint;
+
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
+import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
+import org.openstreetmap.josm.data.projection.Projections;
+import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
+import org.openstreetmap.josm.io.OsmReader;
+
+public class StyledMapRendererPerformanceTest {
+
+    private static final int IMG_WIDTH = 1400;
+    private static final int IMG_HEIGHT = 1050;
+
+    private static Graphics2D g;
+    private static BufferedImage img;
+    private static NavigatableComponent nc;
+    private static DataSet dsRestriction;
+    private static DataSet dsMultipolygon;
+    private static DataSet dsCity;
+
+    @BeforeClass
+    public static void load() throws Exception {
+        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+        img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_3BYTE_BGR);
+        g = (Graphics2D)img.getGraphics();
+        nc = new NavigatableComponent();
+        nc.setBounds(0, 0, IMG_WIDTH, IMG_HEIGHT);
+
+        // TODO Test should have it's own copy of styles because change in style can influence performance
+        Main.pref.load();
+        MapPaintStyles.readFromPreferences();
+
+        try (
+            InputStream fisR = new FileInputStream("data_nodist/restriction.osm");
+            InputStream fisM = new FileInputStream("data_nodist/multipolygon.osm");
+            InputStream fisC = new FileInputStream("data_nodist/neubrandenburg.osm");
+        ) {
+            dsRestriction = OsmReader.parseDataSet(fisR, NullProgressMonitor.INSTANCE);
+            dsMultipolygon = OsmReader.parseDataSet(fisM, NullProgressMonitor.INSTANCE);
+            dsCity = OsmReader.parseDataSet(fisC, NullProgressMonitor.INSTANCE);
+        }
+
+        // Warm up
+        new StyledMapRendererPerformanceTest().testRestrictionSmall();
+        new StyledMapRendererPerformanceTest().testCity();
+    }
+
+    private static void test(int iterations, DataSet ds, Bounds bounds) throws Exception {
+        Rendering visitor = new StyledMapRenderer(g,nc,false);
+        nc.zoomTo(bounds);
+        for (int i=0; i<iterations; i++) {
+            visitor.render(ds, true, bounds);
+        }
+    }
+
+    @Test
+    public void testRestriction() throws Exception {
+        test(700, dsRestriction, new Bounds(51.12, 14.147472381591795, 51.128, 14.162492752075195));
+    }
+
+    @Test
+    public void testRestrictionSmall() throws Exception {
+        test(1500, dsRestriction, new Bounds(51.125, 14.147, 51.128, 14.152));
+    }
+
+    @Test
+    public void testMultipolygon() throws Exception {
+        test(400, dsMultipolygon, new Bounds(60, -180, 85, -122));
+    }
+
+    @Test
+    public void testMultipolygonSmall() throws Exception {
+        test(850, dsMultipolygon, new Bounds(-90, -180, 90, 180));
+    }
+
+    @Test
+    public void testCity() throws Exception {
+        test(50, dsCity, new Bounds(53.51, 13.20, 53.59, 13.34));
+    }
+
+    @Test
+    public void testCitySmall() throws Exception {
+        test(70, dsCity, new Bounds(52, 11, 55, 14));
+    }
+
+    @Test
+    public void testCityPart1() throws Exception {
+        test(250, dsCity, new Bounds(53.56, 13.25, 53.57, 13.26));
+    }
+
+    @Test
+    public void testCityPart2() throws Exception {
+        test(200, dsCity, new Bounds(53.55, 13.29, 53.57, 13.30));
+    }
+
+    @Test
+    public void testCitySmallPart2() throws Exception {
+        test(200, dsCity, new Bounds(53.56, 13.295, 53.57, 13.30));
+    }
+}
Index: /trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.groovy
===================================================================
--- /trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.groovy	(revision 7068)
+++ /trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.groovy	(revision 7068)
@@ -0,0 +1,128 @@
+// 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.Main
+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.MainApplication
+import org.openstreetmap.josm.gui.layer.OsmDataLayer
+import org.openstreetmap.josm.gui.mappaint.MapPaintStyles
+import org.openstreetmap.josm.gui.preferences.SourceEntry
+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 JOSM home environment
+     */
+    def static JOSM_HOME="test/config/performance-josm.home"
+
+    /**
+     * 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 = "/my/test-data.osm"
+    /* ------------------------ / configuration section  ---------------------------- */
+
+    def DataSet ds
+
+    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);
+          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.")
+          }
+
+          f = new File(DATA_FILE);
+          if ( !f.isFile() || ! f.exists()) {
+              fail("DATA_FILE refers to '${DATA_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(){
+        checkTestEnvironment()
+        System.setProperty("josm.home", JOSM_HOME)
+        MainApplication.main(new String[0])
+    }
+
+    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(
+                new File(STYLE_FILE).toURI().toURL().toString(),
+                "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' ..."
+        new File(DATA_FILE).withInputStream {
+            InputStream is ->
+            ds = OsmReader.parseDataSet(is,null)
+        }
+        Main.main.addLayer(new OsmDataLayer(ds,"test layer",null /* no file */));
+        println "DONE"
+    }
+
+    @Test
+    public void measureTimeForStylePreparation() {
+        loadStyle()
+        loadData()
+
+        def mv = Main.map.mapView
+
+        BufferedImage img = mv.createImage(mv.getWidth(), mv.getHeight())
+        Graphics2D g = img.createGraphics()
+        g.setClip(0,0, mv.getWidth(), mv.getHeight())
+        def visitor = new StyledMapRenderer(g, Main.map.mapView, 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: unk/test/unit/org/openstreetmap/TestUtils.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/TestUtils.java	(revision 7067)
+++ 	(revision )
@@ -1,67 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.tools.TextTagParser;
-
-public class TestUtils {
-
-    /**
-     * Returns the path to test data root directory.
-     */
-    public static String getTestDataRoot() {
-        String testDataRoot = System.getProperty("josm.test.data");
-        if (testDataRoot == null || testDataRoot.isEmpty()) {
-            testDataRoot = "test/data";
-            System.out.println("System property josm.test.data is not set, using '" + testDataRoot + "'");
-        }
-        return testDataRoot.endsWith("/") ? testDataRoot : testDataRoot + "/";
-    }
-
-    public static OsmPrimitive createPrimitive(String assertion) {
-        if (Main.pref == null) {
-            Main.initApplicationPreferences();
-        }
-        final String[] x = assertion.split("\\s+", 2);
-        final OsmPrimitive p = "n".equals(x[0]) || "node".equals(x[0])
-                ? new Node()
-                : "w".equals(x[0]) || "way".equals(x[0])
-                ? new Way()
-                : "r".equals(x[0]) || "relation".equals(x[0])
-                ? new Relation()
-                : null;
-        if (p == null) {
-            throw new IllegalArgumentException("Expecting n/node/w/way/r/relation, but got " + x[0]);
-        }
-        for (final Map.Entry<String, String> i : TextTagParser.readTagsFromText(x[1]).entrySet()) {
-            p.put(i.getKey(), i.getValue());
-        }
-        return p;
-    }
-
-    @Test
-    public void testCreatePrimitive() throws Exception {
-        final OsmPrimitive p = createPrimitive("way name=Foo railway=rail");
-        assertTrue(p instanceof Way);
-        assertThat(p.keySet().size(), is(2));
-        assertThat(p.get("name"), is("Foo"));
-        assertThat(p.get("railway"), is("rail"));
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testCreatePrimitiveFail() throws Exception {
-        TestUtils.createPrimitive("noway name=Foo");
-    }
-
-}
Index: /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 7068)
+++ /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 7068)
@@ -0,0 +1,68 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.logging.Logger;
+
+import org.openstreetmap.josm.data.projection.Projections;
+import org.openstreetmap.josm.io.OsmApi;
+import org.openstreetmap.josm.tools.I18n;
+
+public class JOSMFixture {
+    static private final Logger logger = Logger.getLogger(JOSMFixture.class.getName());
+
+    static public JOSMFixture createUnitTestFixture() {
+        return new JOSMFixture("test/config/unit-josm.home");
+    }
+
+    static public JOSMFixture createFunctionalTestFixture() {
+        return new JOSMFixture("test/config/functional-josm.home");
+    }
+
+    static public JOSMFixture createPerformanceTestFixture() {
+        return new JOSMFixture("test/config/performance-josm.home");
+    }
+
+    private final String josmHome;
+
+    public JOSMFixture(String josmHome) {
+        this.josmHome = josmHome;
+    }
+
+    public void init() {
+
+        // check josm.home
+        //
+        if (josmHome == null) {
+            fail(MessageFormat.format("property ''{0}'' not set in test environment", "josm.home"));
+        } else {
+            File f = new File(josmHome);
+            if (! f.exists() || ! f.canRead()) {
+                fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing or not readable.", "josm.home", josmHome));
+            }
+        }
+        System.setProperty("josm.home", josmHome);
+        Main.initApplicationPreferences();
+        I18n.init();
+        // initialize the plaform hook, and
+        Main.determinePlatformHook();
+        // call the really early hook before we anything else
+        Main.platform.preStartupHook();
+
+        Main.pref.init(false);
+
+        // init projection
+        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+
+        // make sure we don't upload to or test against production
+        //
+        String url = OsmApi.getOsmApi().getBaseUrl().toLowerCase().trim();
+        if (url.startsWith("http://www.openstreetmap.org") || url.startsWith("http://api.openstreetmap.org")
+            || url.startsWith("https://www.openstreetmap.org") || url.startsWith("https://api.openstreetmap.org")) {
+            fail(MessageFormat.format("configured server url ''{0}'' seems to be a productive url, aborting.", url));
+        }
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/TestUtils.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/TestUtils.java	(revision 7068)
+++ /trunk/test/unit/org/openstreetmap/josm/TestUtils.java	(revision 7068)
@@ -0,0 +1,67 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.tools.TextTagParser;
+
+public class TestUtils {
+
+    /**
+     * Returns the path to test data root directory.
+     */
+    public static String getTestDataRoot() {
+        String testDataRoot = System.getProperty("josm.test.data");
+        if (testDataRoot == null || testDataRoot.isEmpty()) {
+            testDataRoot = "test/data";
+            System.out.println("System property josm.test.data is not set, using '" + testDataRoot + "'");
+        }
+        return testDataRoot.endsWith("/") ? testDataRoot : testDataRoot + "/";
+    }
+
+    public static OsmPrimitive createPrimitive(String assertion) {
+        if (Main.pref == null) {
+            Main.initApplicationPreferences();
+        }
+        final String[] x = assertion.split("\\s+", 2);
+        final OsmPrimitive p = "n".equals(x[0]) || "node".equals(x[0])
+                ? new Node()
+                : "w".equals(x[0]) || "way".equals(x[0])
+                ? new Way()
+                : "r".equals(x[0]) || "relation".equals(x[0])
+                ? new Relation()
+                : null;
+        if (p == null) {
+            throw new IllegalArgumentException("Expecting n/node/w/way/r/relation, but got " + x[0]);
+        }
+        for (final Map.Entry<String, String> i : TextTagParser.readTagsFromText(x[1]).entrySet()) {
+            p.put(i.getKey(), i.getValue());
+        }
+        return p;
+    }
+
+    @Test
+    public void testCreatePrimitive() throws Exception {
+        final OsmPrimitive p = createPrimitive("way name=Foo railway=rail");
+        assertTrue(p instanceof Way);
+        assertThat(p.keySet().size(), is(2));
+        assertThat(p.get("name"), is("Foo"));
+        assertThat(p.get("railway"), is("rail"));
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testCreatePrimitiveFail() throws Exception {
+        TestUtils.createPrimitive("noway name=Foo");
+    }
+
+}
Index: /trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.groovy	(revision 7068)
@@ -1,6 +1,6 @@
 package org.openstreetmap.josm.actions
 
-import org.openstreetmap.TestUtils
 import org.openstreetmap.josm.Main
+import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.search.SearchCompiler
 import org.openstreetmap.josm.data.osm.Relation
Index: /trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 7068)
@@ -6,11 +6,7 @@
 import org.junit.Test;
 
-/**
- * @author Vincent
- *
- */
 public class LatLonTest {
 
-    protected static final double[] sampleValues = new double[]{
+    public static final double[] SAMPLE_VALUES = new double[]{
             -180.0, -179.9, -179.6, -179.5, -179.4, -179.1, -179.0, -100.0, -99.9, -10.0, -9.9, -1.0, -0.1,
             180.0,  179.9,  179.6,  179.5,  179.4,  179.1,  179.0,  100.0,  99.9,  10.0,  9.9,  1.0,  0.1,
@@ -20,5 +16,5 @@
             100.12, 100.123, 100.1234, 100.12345, 100.123456, 100.1234567
            };
-    
+
     /**
      * Test of {@link LatLon#roundToOsmPrecisionStrict}
@@ -26,12 +22,12 @@
     @Test
     public void testRoundToOsmPrecisionStrict() {
-        
-        for (double value : sampleValues) {
+
+        for (double value : SAMPLE_VALUES) {
             assertEquals(LatLon.roundToOsmPrecisionStrict(value), value, 0);
         }
-        
+
         assertEquals(LatLon.roundToOsmPrecisionStrict(0.0), 0.0, 0);
         assertEquals(LatLon.roundToOsmPrecisionStrict(-0.0), 0.0, 0);
-        
+
         assertEquals(LatLon.roundToOsmPrecisionStrict(0.12345678),  0.1234568, 0);
         assertEquals(LatLon.roundToOsmPrecisionStrict(0.123456789), 0.1234568, 0);
@@ -76,5 +72,5 @@
         assertEquals(LatLon.roundToOsmPrecisionStrict(99.9999999),  99.9999999, 0);
     }
-    
+
     /**
      * Test of {@link LatLon#toIntervalLon}
@@ -107,7 +103,7 @@
     @Test
     public void testEquals() {
-        for (int i = 1; i < sampleValues.length; i++) {
-            LatLon a = new LatLon(sampleValues[i-1], sampleValues[i]);
-            LatLon b = new LatLon(sampleValues[i-1], sampleValues[i]);
+        for (int i = 1; i < SAMPLE_VALUES.length; i++) {
+            LatLon a = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
+            LatLon b = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
             assertEquals(a, b);
         }
@@ -119,7 +115,7 @@
     @Test
     public void testHashCode() {
-        for (int i = 1; i < sampleValues.length; i++) {
-            LatLon a = new LatLon(sampleValues[i-1], sampleValues[i]);
-            LatLon b = new LatLon(sampleValues[i-1], sampleValues[i]);
+        for (int i = 1; i < SAMPLE_VALUES.length; i++) {
+            LatLon a = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
+            LatLon b = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
             assertEquals(a.hashCode(), b.hashCode());
         }
Index: /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.groovy	(revision 7068)
@@ -1,5 +1,5 @@
 package org.openstreetmap.josm.data.validation.tests
 
-import org.openstreetmap.TestUtils
+import org.openstreetmap.josm.TestUtils;
 
 class LanesTest extends GroovyTestCase {
Index: /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 7068)
@@ -13,8 +13,8 @@
 import java.util.Map;
 
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
-import org.openstreetmap.TestUtils;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
 import org.openstreetmap.josm.data.osm.Node;
@@ -31,6 +31,6 @@
      * Setup test.
      */
-    @Before
-    public void setUp() throws Exception {
+    @BeforeClass
+    public static void setUp() {
         Main.initApplicationPreferences();
     }
Index: /trunk/test/unit/org/openstreetmap/josm/gui/JosmUserIdentityManagerTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/JosmUserIdentityManagerTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/JosmUserIdentityManagerTest.groovy	(revision 7068)
@@ -2,86 +2,86 @@
 package org.openstreetmap.josm.gui;
 
-import org.junit.BeforeClass;
-import org.junit.Test 
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.osm.UserInfo;
-import org.openstreetmap.josm.fixtures.JOSMFixture;
-
-import static org.junit.Assert.*;
+import static org.junit.Assert.*
+
+import org.junit.BeforeClass
+import org.junit.Test
+import org.openstreetmap.josm.JOSMFixture
+import org.openstreetmap.josm.Main
+import org.openstreetmap.josm.data.osm.UserInfo
 
 class JosmUserIdentityManagerTest {
-	
+
 	final shouldFail = new GroovyTestCase().&shouldFail
-	
+
 	private static JOSMFixture josmFixture
-	
+
 	@BeforeClass
 	public static void initTestCase() {
 	    josmFixture = JOSMFixture.createFunctionalTestFixture()
 	}
-	
+
 	@Test
 	public void test_SingletonAccess() {
-		
-		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()		
+
+		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
 
 		// created ?
 		assert im != null
-		
-		// registered as listener ? 
+
+		// registered as listener ?
 		assert Main.pref.@listeners.contains(im)
-		
+
 		JosmUserIdentityManager im2 = JosmUserIdentityManager.getInstance()
 
 		// only one instance
-		assert im == im2		
-	}
-	
+		assert im == im2
+	}
+
 	@Test
 	public void test_setAnonymouse() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
-		
+
 		im.setPartiallyIdentified "test"
 		im.setAnonymous()
-				
+
 		assert im.isAnonymous()
 		assert ! im.isPartiallyIdentified()
 		assert ! im.isFullyIdentified()
-		
+
 		assert im.getUserId() == 0
 		assert im.getUserName() == null
 		assert im.getUserInfo() == null
 	}
-	
+
 	@Test
 	public void test_setPartiallyIdentified() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
-		
+
 		im.setPartiallyIdentified "test"
-		
+
 		shouldFail(IllegalArgumentException) {
 		    im.setPartiallyIdentified null
 		}
-		
+
 		shouldFail(IllegalArgumentException) {
 			im.setPartiallyIdentified ""
 		}
-		
+
 		shouldFail(IllegalArgumentException) {
 			im.setPartiallyIdentified "  \t  "
 		}
-		
+
 		im.setPartiallyIdentified "test"
-		
+
 		assert ! im.isAnonymous()
 		assert im.isPartiallyIdentified()
 		assert ! im.isFullyIdentified()
-		
+
 		assert im.getUserId() == 0
 		assert im.getUserName() == "test"
 		assert im.getUserInfo() == null
 	}
-	
-	
+
+
 	@Test
 	public void test_setFullyIdentified() {
@@ -89,7 +89,7 @@
 
 		UserInfo userInfo = new UserInfo(id: 1, description: "a description")
-		
+
 		im.setFullyIdentified "test", userInfo
-		
+
 		shouldFail(IllegalArgumentException) {
 			im.setFullyIdentified null, userInfo
@@ -104,63 +104,63 @@
 			im.setFullyIdentified "test", null
 		}
-		
+
 		im.setFullyIdentified "test", userInfo
-		
+
 		assert ! im.isAnonymous()
 		assert ! im.isPartiallyIdentified()
 		assert im.isFullyIdentified()
-		
+
 		assert im.getUserId() == 1
 		assert im.getUserName() == "test"
 		assert im.getUserInfo() == userInfo
 	}
-	
+
 	/**
 	 * Preferences include neither an url nor a user name => we have
-	 * an anonymous user 
-	 */
-	@Test 
+	 * an anonymous user
+	 */
+	@Test
 	public void initFromPreferences_1() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
-		
-		// reset it 
-		im.@userName = null
-		im.@userInfo = null
-		
+
+		// reset it
+		im.@userName = null
+		im.@userInfo = null
+
 		Main.pref.put "osm-server.url", null
 		Main.pref.put "osm-server.username", null
-		
-		im.initFromPreferences()
-		
-		assert im.isAnonymous()
-	}
-	
+
+		im.initFromPreferences()
+
+		assert im.isAnonymous()
+	}
+
 	/**
 	 * Preferences include neither an url nor a user name => we have
-	 * an annoymous user 
-	 */
-	@Test 
+	 * an annoymous user
+	 */
+	@Test
 	public void initFromPreferences_2() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
-		
-		// reset it 
-		im.@userName = null
-		im.@userInfo = null
-		
+
+		// reset it
+		im.@userName = null
+		im.@userInfo = null
+
 		// for this test we disable the listener
 		Main.pref.removePreferenceChangeListener im
-		
-		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
-		Main.pref.put "osm-server.username", null
-		
-		im.initFromPreferences()
-		
-		assert im.isAnonymous()
-	}
-	
-	/**
-	 * Preferences include an user name => we have a partially identified user 
-	 */
-	@Test 
+
+		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
+		Main.pref.put "osm-server.username", null
+
+		im.initFromPreferences()
+
+		assert im.isAnonymous()
+	}
+
+	/**
+	 * Preferences include an user name => we have a partially identified user
+	 */
+	@Test
 	public void initFromPreferences_3() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
@@ -169,22 +169,22 @@
 		Main.pref.removePreferenceChangeListener im
 
-		// reset it 
-		im.@userName = null
-		im.@userInfo = null
-		
+		// reset it
+		im.@userName = null
+		im.@userInfo = null
+
 		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
 		Main.pref.put "osm-server.username", "test"
-		
-		im.initFromPreferences()
-		
-		assert im.isPartiallyIdentified()
-	}
-	
+
+		im.initFromPreferences()
+
+		assert im.isPartiallyIdentified()
+	}
+
 	/**
 	 * Preferences include an user name which is different from the current
 	 * user name and we are currently fully identifed => josm user becomes
-	 * partially identified  
-	 */
-	@Test 
+	 * partially identified
+	 */
+	@Test
 	public void initFromPreferences_4() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
@@ -194,13 +194,13 @@
 
 		im.setFullyIdentified "test1", new UserInfo(id: 1)
-		
+
 		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
 		Main.pref.put "osm-server.username", "test2"
-		
-		im.initFromPreferences()
-		
-		assert im.isPartiallyIdentified()
-	}
-	
+
+		im.initFromPreferences()
+
+		assert im.isPartiallyIdentified()
+	}
+
 	/**
 	 * Preferences include an user name which is the same as the current
@@ -208,5 +208,5 @@
 	 * fully identified
 	 */
-	@Test 
+	@Test
 	public void initFromPreferences_5() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
@@ -214,104 +214,104 @@
         // for this test we disable the listener
 		Main.pref.removePreferenceChangeListener im
-    	
+
 		im.setFullyIdentified "test1", new UserInfo(id: 1)
-		
+
 		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
 		Main.pref.put "osm-server.username", "test1"
-		
-		im.initFromPreferences()
-		
+
+		im.initFromPreferences()
+
 		assert im.isFullyIdentified()
 	}
-	
-	@Test 
+
+	@Test
 	public void apiUrlChanged() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
-		
-		// make sure im is a preference change listener 
+
+		// make sure im is a preference change listener
 		Main.pref.addPreferenceChangeListener im
-		
-		// reset it 
-		im.@userName = null
-		im.@userInfo = null
-				
-		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
-		assert im.isAnonymous()
-		
+
+		// reset it
+		im.@userName = null
+		im.@userInfo = null
+
+		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
+		assert im.isAnonymous()
+
          Main.pref.put "osm-server.url", null
          assert im.isAnonymous()
-		
-		// reset it 
+
+		// reset it
 		im.@userName = "test"
 		im.@userInfo = null
-		
-		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
-		assert im.isPartiallyIdentified()
-		assert im.getUserName() == "test"
-		
+
+		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
+		assert im.isPartiallyIdentified()
+		assert im.getUserName() == "test"
+
 		Main.pref.put "osm-server.url", null
 		assert im.isAnonymous()
-		
-		// reset it 
+
+		// reset it
 		im.@userName = "test"
 		im.@userInfo = new UserInfo(id:1)
-		
-		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
-		assert im.isPartiallyIdentified()
-		assert im.getUserName() == "test"
-		
-		// reset it 
+
+		Main.pref.put "osm-server.url", "http://api.openstreetmap.org"
+		assert im.isPartiallyIdentified()
+		assert im.getUserName() == "test"
+
+		// reset it
 		im.@userName = "test"
 		im.@userInfo = new UserInfo(id:1)
-		
-		
+
+
 		Main.pref.put "osm-server.url", null
-		assert im.isAnonymous()				
-	}
-	
-	@Test 
+		assert im.isAnonymous()
+	}
+
+	@Test
 	public void userNameChanged() {
 		JosmUserIdentityManager im = JosmUserIdentityManager.getInstance()
-		
-		// make sure im is a preference change listener 
+
+		// make sure im is a preference change listener
 		Main.pref.addPreferenceChangeListener im
-		
-		// reset it 
-		im.@userName = null
-		im.@userInfo = null
-		
+
+		// reset it
+		im.@userName = null
+		im.@userInfo = null
+
 		Main.pref.put "osm-server.username", "test"
 		assert im.isPartiallyIdentified()
 		assert im.getUserName() == "test"
-		
-		Main.pref.put "osm-server.username", null
-		assert im.isAnonymous()
-		
-		// reset it 
+
+		Main.pref.put "osm-server.username", null
+		assert im.isAnonymous()
+
+		// reset it
 		im.@userName = "test1"
 		im.@userInfo = null
-		
+
 		Main.pref.put "osm-server.username", "test2"
 		assert im.isPartiallyIdentified()
 		assert im.getUserName() == "test2"
-		
-		Main.pref.put "osm-server.username", null
-		assert im.isAnonymous()
-		
-		// reset it 
+
+		Main.pref.put "osm-server.username", null
+		assert im.isAnonymous()
+
+		// reset it
 		im.@userName = "test1"
 		im.@userInfo = new UserInfo(id:1)
-		
+
 		Main.pref.put "osm-server.username", "test2"
 		assert im.isPartiallyIdentified()
 		assert im.getUserName() == "test2"
-		
-		// reset it 
+
+		// reset it
 		im.@userName = "test1"
 		im.@userInfo = new UserInfo(id:1)
-		
-		
-		Main.pref.put "osm-server.username", null
-		assert im.isAnonymous()             
+
+
+		Main.pref.put "osm-server.username", null
+		assert im.isAnonymous()
 	}
 }
Index: /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategyTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategyTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategyTest.groovy	(revision 7068)
@@ -3,5 +3,5 @@
 
 import org.junit.*
-import org.openstreetmap.josm.fixtures.JOSMFixture;
+import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy 
 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.StaticLabelCompositionStrategy;
Index: /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.groovy	(revision 7068)
@@ -4,5 +4,5 @@
 
 import org.junit.*
-import org.openstreetmap.josm.fixtures.JOSMFixture
+import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.TagLookupCompositionStrategy
Index: /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.groovy	(revision 7068)
@@ -7,4 +7,5 @@
 
 import org.junit.*
+import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.LatLon
 import org.openstreetmap.josm.data.osm.DataSet
@@ -13,5 +14,4 @@
 import org.openstreetmap.josm.data.osm.RelationMember
 import org.openstreetmap.josm.data.osm.Way
-import org.openstreetmap.josm.fixtures.JOSMFixture
 import org.openstreetmap.josm.gui.mappaint.Environment
 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.ChildOrParentSelector
Index: /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy	(revision 7068)
@@ -5,4 +5,5 @@
 
 import org.junit.*
+import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.LatLon
 import org.openstreetmap.josm.data.osm.DataSet
@@ -10,5 +11,4 @@
 import org.openstreetmap.josm.data.osm.Relation
 import org.openstreetmap.josm.data.osm.RelationMember
-import org.openstreetmap.josm.fixtures.JOSMFixture
 import org.openstreetmap.josm.gui.mappaint.Environment
 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context
Index: /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy	(revision 7068)
@@ -5,4 +5,5 @@
 
 import org.junit.*
+import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.LatLon
 import org.openstreetmap.josm.data.osm.DataSet
@@ -10,5 +11,4 @@
 import org.openstreetmap.josm.data.osm.Relation
 import org.openstreetmap.josm.data.osm.RelationMember
-import org.openstreetmap.josm.fixtures.JOSMFixture
 import org.openstreetmap.josm.gui.mappaint.Environment
 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context
Index: /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy	(revision 7068)
@@ -5,6 +5,6 @@
 import org.junit.Before
 import org.junit.Test
-import org.openstreetmap.TestUtils
 import org.openstreetmap.josm.Main
+import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon
 import org.openstreetmap.josm.data.osm.DataSet
Index: /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.groovy
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.groovy	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.groovy	(revision 7068)
@@ -5,5 +5,5 @@
 
 import org.junit.*
-import org.openstreetmap.josm.fixtures.JOSMFixture
+import org.openstreetmap.josm.JOSMFixture;
 
 
Index: /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TaggingPresetReaderTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TaggingPresetReaderTest.java	(revision 7067)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TaggingPresetReaderTest.java	(revision 7068)
@@ -13,6 +13,6 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.openstreetmap.TestUtils;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
