Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 6534)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 6538)
@@ -4,4 +4,5 @@
 import org.junit.Test;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.command.ChangePropertyCommand;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.osm.Node;
@@ -10,7 +11,9 @@
 import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.validation.Severity;
 import org.openstreetmap.josm.tools.TextTagParser;
 
 import java.io.StringReader;
+import java.text.MessageFormat;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -35,6 +38,6 @@
         final List<MapCSSTagChecker.TagCheck> checks = MapCSSTagChecker.TagCheck.readMapCSS(new StringReader("" +
                 "*[natural=marsh] {\n" +
-                "   throwWarning: tr(\"{0} is deprecated\", \"natural=marsh\");\n" +
-                "   fixRemove: \"natural\";\n" +
+                "   throwWarning: tr(\"{0} is deprecated\", \"{0.tag}\");\n" +
+                "   fixRemove: \"{0.key}\";\n" +
                 "   fixAdd: \"natural=wetland\";\n" +
                 "   fixAdd: \"wetland=marsh\";\n" +
@@ -43,14 +46,20 @@
         final MapCSSTagChecker.TagCheck check = checks.get(0);
         assertThat(check, notNullValue());
-        assertThat(check.change.get(0).apply(null), is(new Tag("natural")));
+        assertThat(check.getDescription(), is("{0.tag} is deprecated"));
+        assertThat(check.change.get(0).apply(null), is(new Tag("{0.key}")));
         assertThat(check.change.get(1).apply(null), is(new Tag("natural", "wetland")));
         assertThat(check.change.get(2).apply(null), is(new Tag("wetland", "marsh")));
-        assertThat(check.errors.keySet().iterator().next(), is("natural=marsh is deprecated"));
         final Node n1 = new Node();
         n1.put("natural", "marsh");
         assertTrue(check.matchesPrimitive(n1));
+        assertThat(check.getErrorForPrimitive(n1).getMessage(), is("natural=marsh is deprecated"));
+        assertThat(check.getErrorForPrimitive(n1).getSeverity(), is(Severity.WARNING));
+        assertThat(((ChangePropertyCommand) check.fixPrimitive(n1).getChildren().iterator().next()).getTags().toString(),
+                is("{natural=}"));
         final Node n2 = new Node();
         n2.put("natural", "wood");
         assertFalse(check.matchesPrimitive(n2));
+        assertThat(MapCSSTagChecker.TagCheck.insertArguments(check.selector.get(0), "The key is {0.key} and the value is {0.value}"),
+                is("The key is natural and the value is marsh"));
     }
 
@@ -97,5 +106,6 @@
                 final OsmPrimitive p = createPrimitiveForAssertion(i.getKey());
                 if (check.matchesPrimitive(p) != i.getValue()) {
-                    final String error = "Expecting test '" + check.getMessage() + "' to " + (i.getValue() ? "" : "not ") + "match " + i.getKey() + ", i.e., " + p.getKeys();
+                    final String error = MessageFormat.format("Expecting test ''{0}'' (i.e., {1}) to {2} {3} (i.e., {4})",
+                            check.getMessage(), check.selector, i.getValue() ? "match" : "not match", i.getKey(), p.getKeys());
                     System.err.println(error);
                     assertionErrors.add(error);
