Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 1750)
+++ /trunk/build.xml	(revision 1751)
@@ -1,3 +1,6 @@
 <project name="josm" default="dist" basedir=".">
+	<property name="test.dir" value="test" />
+	<property name="src.dir" value="src" />
+	<property name="build.dir" value="build"/>
 
 	<!-- Java classpath addition (all jar files to compile tests with this) -->
@@ -9,5 +12,5 @@
 
 	<target name="dist" depends="compile">
-		
+
 		<exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
 			<env key="LANG" value="C"/>
@@ -39,6 +42,6 @@
 			<zipfileset dir="images" prefix="images" />
 			<zipfileset src="lib/josm-translation.jar" />
-			
-			<!-- All jar files necessary to run only JOSM (no tests) -->			
+
+			<!-- All jar files necessary to run only JOSM (no tests) -->
 			<zipfileset src="lib/gettext-commons-0.9.6.jar" />
 			<zipfileset src="lib/metadata-extractor-2.3.1-nosun.jar" />
@@ -77,4 +80,44 @@
 	</target>
 
+	<path id="test.classpath">
+		<fileset dir="${test.dir}/lib">
+			<include name="**/*.jar"/>
+		</fileset>
+		<fileset dir="lib">
+			<include name="**/*.jar"/>
+		</fileset>
+	</path>
+
+	<target name="test-init">
+		<mkdir dir="${test.dir}/${build.dir}" />
+		<mkdir dir="${test.dir}/report" />
+	</target>
+
+	<target name="test-clean">
+		<delete dir="${test.dir}/${build.dir}"/>
+		<delete dir="${test.dir}/report"/>
+	</target>
+
+	<target name="test-compile" depends="test-init">
+		<javac srcdir="${src.dir}:${test.dir}/unit" classpathref="test.classpath" destdir="${test.dir}/${build.dir}"
+				target="1.5" source="1.5" debug="on" encoding="UTF-8">
+			<compilerarg value="-Xlint:deprecation"/>
+		</javac>
+	</target>
+
+    <target name="test" depends="test-compile">
+        <junit printsummary="yes">
+        	<sysproperty key="josm.home" value="${test.dir}/config/unit-josm.home"/>
+            <classpath>
+                <path refid="test.classpath"/>
+                <pathelement path="${test.dir}/${build.dir}"/>
+            	<pathelement path="${test.dir}/config"/>
+            </classpath>
+            <formatter type="plain"/>
+            <batchtest fork="no" todir="${test.dir}/report">
+                <fileset dir="${test.dir}/unit" includes="**/*.java"/>
+            </batchtest>
+        </junit>
+    </target>
 
 </project>
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeVisitorTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeVisitorTest.java	(revision 1750)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeVisitorTest.java	(revision 1751)
@@ -33,27 +33,30 @@
     @BeforeClass
     static public void init() {
-        testProperties = new Properties();
-
-        // load properties
-        //
-        try {
-            testProperties.load(MergeVisitorTest.class.getResourceAsStream("/test-unit-env.properties"));
-        } catch(Exception e){
-            logger.log(Level.SEVERE, MessageFormat.format("failed to load property file ''{0}''", "/test-unit-env.properties"));
-            fail(MessageFormat.format("failed to load property file ''{0}''", "/test-unit-env.properties"));
+
+        if(System.getProperty("josm.home") == null){
+            testProperties = new Properties();
+
+            // load properties
+            //
+            try {
+                testProperties.load(MergeVisitorTest.class.getResourceAsStream("/test-unit-env.properties"));
+            } catch(Exception e){
+                logger.log(Level.SEVERE, MessageFormat.format("failed to load property file ''{0}''", "/test-unit-env.properties"));
+                fail(MessageFormat.format("failed to load property file ''{0}''", "/test-unit-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));
+                }
+            }
+            System.setProperty("josm.home", josmHome);
         }
-
-        // 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));
-            }
-        }
-        System.setProperty("josm.home", josmHome);
         Main.pleaseWaitDlg = new PleaseWaitDialog(null);
         Main.pref.init(false);
@@ -65,5 +68,5 @@
     /**
      * two identical nodes, even in id and version. No confict expected.
-     * 
+     *
      * Can happen if data is loaded in two layers and then merged from one layer
      * on the other.
@@ -104,5 +107,5 @@
      * two  nodes, my is unmodified, their is updated and has a higher version
      * => their version is going to be the merged version
-     * 
+     *
      */
     @Test
@@ -143,5 +146,5 @@
      * node with same id, my is modified, their has a higher version
      * => results in a conflict
-     * 
+     *
      * Use case: node which is modified locally and updated by another mapper on
      * the server
@@ -181,5 +184,5 @@
      * node with same id, my is deleted, their has a higher version
      * => results in a conflict
-     * 
+     *
      * Use case: node which is deleted locally and updated by another mapper on
      * the server
@@ -217,5 +220,5 @@
      * My node is visible, their version has a higher version and is not visible
      * => create a conflict
-     * 
+     *
      */
     @Test
@@ -251,5 +254,5 @@
      * My node is deleted, their node has the same id and version and is not deleted.
      * => mine has precedence
-     * 
+     *
      */
     @Test
@@ -281,7 +284,7 @@
     /**
      * My and their node are new but semantically equal. My node is deleted.
-     * 
+     *
      * => create a conflict
-     * 
+     *
      */
     @Test
@@ -309,7 +312,7 @@
     /**
      * My and their node are new but semantically equal. Both are deleted.
-     * 
+     *
      * => take mine
-     * 
+     *
      */
     @Test
@@ -339,5 +342,5 @@
      * their node is not visible and doesn't exist in my data set
      * => ignore their node
-     * 
+     *
      */
     @Test
@@ -372,7 +375,7 @@
      * their node has no assigned id (id == 0) and is semantically equal to one of my
      * nodes with id == 0
-     * 
+     *
      * => merge it onto my node.
-     * 
+     *
      */
     @Test
@@ -422,7 +425,7 @@
     /**
      * my node is incomplete, their node is complete
-     * 
+     *
      * => merge it onto my node. My node becomes complete
-     * 
+     *
      */
     @Test
@@ -461,7 +464,7 @@
      * their way has a higher version and different tags. the nodes are the same. My
      * way is not modified. Merge is possible. No conflict.
-     * 
+     *
      * => merge it onto my way.
-     * 
+     *
      */
     @Test
@@ -531,7 +534,7 @@
      * their way has a higher version and different tags. And it has more nodes. Two
      * of the existing nodes are modified.
-     * 
+     *
      * => merge it onto my way, no conflict
-     * 
+     *
      */
     @Test
@@ -605,7 +608,7 @@
     /**
      * their way has a higher version and different nodes. My way is modified.
-     * 
+     *
      * => merge it onto my way not possbile, conflict
-     * 
+     *
      */
     @Test
@@ -681,7 +684,7 @@
     /**
      * their way is not visible anymore.
-     * 
+     *
      * => conflict
-     * 
+     *
      */
     @Test
@@ -731,7 +734,7 @@
      * my and  their way are semantically equal. so technical attributes of
      * their way can be merged on my way. No conflict.
-     * 
-     * 
-     * 
+     *
+     *
+     *
      */
     @Test
@@ -795,5 +798,5 @@
      * my and  their way are semantically equal. so technical attributes of
      * their way can be merged on my way. No conflict.
-     * 
+     *
      */
     @Test
Index: unk/test/unit/test-unit-env.properties
===================================================================
--- /trunk/test/unit/test-unit-env.properties	(revision 1750)
+++ 	(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 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\\tag-editor-plugin
-
