Index: trunk/test/unit/org/openstreetmap/josm/data/preferences/ColorPropertyTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/preferences/ColorPropertyTest.java	(revision 10824)
+++ trunk/test/unit/org/openstreetmap/josm/data/preferences/ColorPropertyTest.java	(revision 10824)
@@ -0,0 +1,82 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.preferences;
+
+import static org.junit.Assert.assertEquals;
+
+import java.awt.Color;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+/**
+ * Test {@link ColorProperty}
+ * @author Michael Zangl
+ */
+public class ColorPropertyTest {
+    /**
+     * This is a preference test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules().preferences();
+    private ColorProperty base;
+
+    /**
+     * Set up test case
+     */
+    @Before
+    public void createTestProperty() {
+        base = new ColorProperty("test", Color.RED);
+    }
+
+    /**
+     * Test {@link ColorProperty#get()}
+     */
+    @Test
+    public void testGet() {
+        assertEquals(Color.RED, base.get());
+
+        Main.pref.put("color.test", "#00ff00");
+        assertEquals(new Color(0xff00ff00), base.get());
+    }
+
+    /**
+     * Test {@link ColorProperty#put}
+     */
+    @Test
+    public void testPut() {
+        assertEquals(Color.RED, base.get());
+
+        base.put(new Color(0xff00ff00));
+        assertEquals(new Color(0xff00ff00), base.get());
+        assertEquals("#00ff00", Main.pref.get("color.test").toLowerCase());
+
+        base.put(null);
+        assertEquals(Color.RED, base.get());
+    }
+
+    /**
+     * Test {@link ColorProperty#getChildColor(String)}
+     */
+    @Test
+    public void testGetChildColor() {
+        AbstractToStringProperty<Color> child = base.getChildColor("test2");
+
+        assertEquals(Color.RED, child.get());
+
+        base.put(Color.GREEN);
+        assertEquals(Color.GREEN, child.get());
+
+        child.put(Color.YELLOW);
+        assertEquals(Color.YELLOW, child.get());
+        assertEquals(Color.GREEN, base.get());
+
+        child.put(null);
+        assertEquals(Color.GREEN, child.get());
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java	(revision 10823)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java	(revision 10824)
@@ -74,5 +74,5 @@
         assertEquals("foo", layer.getName());
         assertFalse(layer.isLocalFile());
-        assertEquals(Color.MAGENTA, layer.getColor(false));
+        assertEquals(Color.MAGENTA, layer.getColorProperty().get());
         assertEquals("<html>0 tracks, 0 routes, 0 waypoints<br>Length: < 0.01 m<br></html>", layer.getToolTipText());
 
@@ -80,5 +80,5 @@
         assertEquals("bar", layer2.getName());
         assertTrue(layer2.isLocalFile());
-        assertEquals(Color.MAGENTA, layer2.getColor(true));
+        assertEquals(Color.MAGENTA, layer2.getColorProperty().get());
         assertEquals("<html>0 tracks, 0 routes, 0 waypoints<br>Length: < 0.01 m<br></html>", layer2.getToolTipText());
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java	(revision 10823)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java	(revision 10824)
@@ -4,4 +4,5 @@
 import static org.junit.Assert.assertEquals;
 
+import java.awt.Color;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -17,4 +18,5 @@
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.data.gpx.WayPoint;
+import org.openstreetmap.josm.data.preferences.ColorProperty;
 import org.openstreetmap.josm.io.GpxReaderTest;
 import org.openstreetmap.josm.tools.ColorHelper;
@@ -125,5 +127,5 @@
     static List<String> calculateColors(String fileName, String layerName, int n) throws IOException, SAXException {
         final GpxData data = GpxReaderTest.parseGpxData(fileName);
-        final GpxDrawHelper gdh = new GpxDrawHelper(data);
+        final GpxDrawHelper gdh = new GpxDrawHelper(data, new ColorProperty("x", Color.MAGENTA));
         gdh.readPreferences(layerName);
         gdh.calculateColors();
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 10823)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 10824)
@@ -42,5 +42,5 @@
 
         assertEquals("foo", layer.getName());
-        assertEquals(Color.magenta, layer.getColor(false));
+        assertEquals(Color.magenta, layer.getColorProperty().get());
         assertNotNull(layer.getIcon());
         assertEquals("0 markers", layer.getToolTipText());
@@ -59,5 +59,5 @@
 
         assertEquals("bar", layer.getName());
-        assertEquals(Color.magenta, layer.getColor(false));
+        assertEquals(Color.magenta, layer.getColorProperty().get());
         assertNotNull(layer.getIcon());
         assertEquals("3 markers", layer.getToolTipText());
