Index: applications/editors/josm/plugins/turnrestrictions/.classpath
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/.classpath	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/.classpath	(revision 23510)
@@ -2,7 +2,11 @@
 <classpath>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="test"/>
+	<classpathentry kind="src" path="test/src"/>
+	<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry kind="lib" path="/JOSM/dist/josm-custom.jar" sourcepath="/JOSM/src"/>
+	<classpathentry kind="lib" path="/JOSM/test/build" sourcepath="/JOSM/test/functional"/>
+	<classpathentry kind="lib" path="test/config"/>
 	<classpathentry kind="output" path="build"/>
 </classpath>
Index: applications/editors/josm/plugins/turnrestrictions/.project
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/.project	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/.project	(revision 23510)
@@ -13,4 +13,5 @@
 	</buildSpec>
 	<natures>
+		<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
Index: applications/editors/josm/plugins/turnrestrictions/build.xml
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/build.xml	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/build.xml	(revision 23510)
@@ -43,7 +43,6 @@
 	<property name="plugin.src.dir"         value="src"/>
 	<!-- this is the directory where the plugin jar is copied to -->
-	<property name="plugin.dist.dir"        value="../../dist"/>
+	<property name="plugin.dist.dir"        value="dist"/>
 	<property name="ant.build.javac.target" value="1.5"/>
-	<property name="plugin.dist.dir"        value="../../dist"/>
 	<property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
 
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java	(revision 23510)
@@ -7,7 +7,4 @@
 import java.util.logging.Logger;
 
-import javax.swing.ActionMap;
-import javax.swing.InputMap;
-import javax.swing.JComponent;
 import javax.swing.KeyStroke;
 
@@ -30,30 +27,5 @@
 public class CreateOrEditTurnRestrictionAction extends JosmAction {
     static private final Logger logger = Logger.getLogger(CreateOrEditTurnRestrictionAction.class.getName());
-
-    /**
-     * Installs the global key stroke with which creating/editing a turn restriction
-     * is triggered.
-     *
-     * @param keyStroke the key stroke
-     */
-    static public void install(KeyStroke keyStroke){
-        InputMap im = Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
-        Object actionMapKey = im.get(keyStroke);
-        if (actionMapKey != null && !actionMapKey.toString().equals("turnrestrictions:create-or-edit")) {
-            System.out.println(tr("Warning: turnrestrictions plugin replaces already existing action ''{0}'' behind shortcut ''{1}'' by action ''{2}''", actionMapKey.toString(), keyStroke.toString(), "turnrestrictions:create-or-edit"));
-        }
-        KeyStroke[] keys = im.keys();
-        if (keys != null){
-            for(KeyStroke ks: im.keys()){
-                if (im.get(ks).equals("turnrestrictions:create-or-edit")) {
-                    im.remove(ks);
-                }
-            }
-        }
-        im.put(keyStroke, "turnrestrictions:create-or-edit");
-        ActionMap am = Main.contentPane.getActionMap();
-        am.put("turnrestrictions:create-or-edit", getInstance());
-    }
-
+  
     /**
      * Installs  global key stroke configured in the preferences.
@@ -68,5 +40,5 @@
             key = KeyStroke.getKeyStroke("shift ctrl T");
         }
-        install(key);
+        Main.registerActionShortcut(getInstance(), key);
     }
 
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java	(revision 23510)
@@ -16,5 +16,5 @@
  * TurnRestrictionBuilder creates a turn restriction and initializes it with
  * objects from a selection of OSM primitives, i.e. the current selection
- * in a {@see OsmDataLayer}.
+ * in a {@link OsmDataLayer}.
  *
  */
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListTransferHandler.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListTransferHandler.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListTransferHandler.java	(revision 23510)
@@ -11,10 +11,10 @@
 
 /**
- * PrimitiveIdListTransferHandler is a transfer handler for components which 
- * provide and/or accept a list of {@see PrimitiveId} via copy/paste or
- * drag-and-drop.
+ * <p>PrimitiveIdListTransferHandler is a transfer handler for components which 
+ * provide and/or accept a list of {@link PrimitiveId} via copy/paste or
+ * drag-and-drop.</p>
  * 
- * It creates a {@see Transferable} by retrieving the list of primitive IDs
- * from a {@see PrimitiveIdListProvider}.
+ * <p>It creates a {@link Transferable} by retrieving the list of primitive IDs
+ * from a {@link PrimitiveIdListProvider}.</p>
  * 
  */
@@ -24,8 +24,8 @@
     
     /**
-     * Replies true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
+     * Replies true if {@code transferFlavors} includes the data flavor {@link PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
 
      * @param transferFlavors an array of transferFlavors
-     * @return true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
+     * @return true if {@code transferFlavors} includes the data flavor {@link PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
      */
     public static boolean isSupportedFlavor(DataFlavor[] transferFlavors) {
@@ -46,6 +46,4 @@
         this.provider = provider;
     }
-
-    
     
     protected Transferable createTransferable(JComponent c) {
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdTransferable.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdTransferable.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdTransferable.java	(revision 23510)
@@ -13,5 +13,5 @@
 
 /**
- * To be used for Drag-and-Drop of a set of {@see PrimitiveId}s between
+ * To be used for Drag-and-Drop of a set of {@link PrimitiveId}s between
  * two components. 
  *
@@ -24,8 +24,8 @@
     
     /** 
-     * this transferable supports two flavors: (1) {@see #PRIMITIVE_ID_LIST_FLAVOR} and
-     * (2) {@see DataFlavor#stringFlavor}.
+     * this transferable supports two flavors: (1) {@link #PRIMITIVE_ID_LIST_FLAVOR} and
+     * (2) {@link DataFlavor#stringFlavor}.
      * 
-     * See also {@see #getPrimitiveIds()} and {@see #getAsString()}
+     * See also {@link #getPrimitiveIds()} and {@link #getAsString()}
      */
     static public final DataFlavor[] SUPPORTED_FLAVORS = new DataFlavor[] {
@@ -38,5 +38,5 @@
     
     /**
-     * Creates a transferable from a collection of {@see PrimitiveId}s
+     * Creates a transferable from a collection of {@link PrimitiveId}s
      * 
      * @param ids
@@ -50,9 +50,9 @@
     
     /**
-     * If flavor is {@see #PRIMITIVE_ID_SET_FLAVOR}, replies a the list of
-     * transferred {@see PrimitiveId}s 
+     * <p>If flavor is {@link #PRIMITIVE_ID_SET_FLAVOR}, replies a the list of
+     * transferred {@link PrimitiveId}s</p>
      * 
-     * If flavor is {@see DataFlavor#stringFlavor}, replies a string representation
-     * of the list of transferred {@see PrimitiveId}s
+     * <p>If flavor is {@link DataFlavor#stringFlavor}, replies a string representation
+     * of the list of transferred {@link PrimitiveId}s</p>
      */
     public Object getTransferData(DataFlavor flavor)
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java	(revision 23510)
@@ -156,5 +156,5 @@
     /**
      * Initializes the set of icons used from the preference key
-     * {@see PreferenceKeys#ROAD_SIGNS}.
+     * {@link PreferenceKeys#ROAD_SIGNS}.
      * 
      * @param prefs the JOSM preferences 
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModel.java	(revision 23510)
@@ -44,5 +44,4 @@
     private boolean isStandard = true;
     private final Set<String> vehicleExceptions = new HashSet<String>();
-    
     
     protected void parseValue(String value) {
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java	(revision 23510)
@@ -3,7 +3,4 @@
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -17,5 +14,4 @@
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent;
@@ -28,5 +24,4 @@
 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent;
 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java	(revision 23510)
@@ -22,8 +22,7 @@
 import javax.swing.TransferHandler;
 
-import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.event.DatasetEventManager;
+import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
 import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
-import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberColumnModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberColumnModel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberColumnModel.java	(revision 23510)
@@ -10,6 +10,6 @@
 
 /**
- * RelationMemberColumnModel is the column model for the table of relation members
- * displayed in the {@see AdvancedEditorPanel}.
+ * <strong>RelationMemberColumnModel</strong> is the column model for the table of relation members
+ * displayed in the {@link AdvancedEditorPanel}.
  */
 public class RelationMemberColumnModel extends DefaultTableColumnModel{
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java	(revision 23510)
@@ -32,7 +32,7 @@
     
     /**
-     * Creates a new model in the context of an {@see OsmDataLayer}. Internally allocates
-     * a row and a column selection model, see {@see #getRowSelectionModel()} and 
-     * {@see #getColSelectionModel()}.
+     * Creates a new model in the context of an {@link OsmDataLayer}. Internally allocates
+     * a row and a column selection model, see {@link #getRowSelectionModel()} and 
+     * {@link #getColSelectionModel()}.
      * 
      * @param layer the data layer. Must not be null.
@@ -47,5 +47,5 @@
 
     /**
-     *  Creates a new model in the context of an {@see OsmDataLayer}
+     *  Creates a new model in the context of an {@link OsmDataLayer}
      *  
      * @param layer layer the data layer. Must not be null.
@@ -84,8 +84,8 @@
     
     /**
-     * Replies the set of {@see OsmPrimitive}s with the role {@code role}. If no
+     * Replies the set of {@link OsmPrimitive}s with the role {@code role}. If no
      * such primitives exists, the empty set is returned.
      * 
-     * @return the set of {@see OsmPrimitive}s with the role {@code role}
+     * @return the set of {@link OsmPrimitive}s with the role {@code role}
      */
     protected Set<OsmPrimitive> getPrimitivesWithRole(String role) {
@@ -103,8 +103,8 @@
     
     /**
-     * Replies the list of {@see RelationMemberModel}s with the role {@code role}. If no
+     * Replies the list of {@link RelationMemberModel}s with the role {@code role}. If no
      * such primitives exists, the empty set is returned.
      * 
-     * @return the set of {@see RelationMemberModel}s with the role {@code role}
+     * @return the set of {@link RelationMemberModel}s with the role {@code role}
      */
     protected List<RelationMemberModel> getRelationMembersWithRole(String role) {
@@ -138,8 +138,8 @@
         
     /**
-     * Replies the set of {@see OsmPrimitive}s with the role 'from'. If no
+     * Replies the set of {@link OsmPrimitive}s with the role 'from'. If no
      * such primitives exists, the empty set is returned.
      * 
-     * @return the set of {@see OsmPrimitive}s with the role 'from'
+     * @return the set of {@link OsmPrimitive}s with the role 'from'
      */
     public Set<OsmPrimitive> getFromPrimitives() {
@@ -148,8 +148,8 @@
     
     /**
-     * Replies the set of {@see OsmPrimitive}s with the role 'to'. If no
+     * Replies the set of {@link OsmPrimitive}s with the role 'to'. If no
      * such primitives exists, the empty set is returned.
      * 
-     * @return the set of {@see OsmPrimitive}s with the role 'from'
+     * @return the set of {@link OsmPrimitive}s with the role 'from'
      */
     public Set<OsmPrimitive> getToPrimitives() {
@@ -175,5 +175,5 @@
      * 
      * null vias are skipped. A via must belong to the dataset of the layer in whose context
-     * this editor is working, otherwise an {@see IllegalArgumentException} is thrown.
+     * this editor is working, otherwise an {@link IllegalArgumentException} is thrown.
      * 
      * @param vias the vias.
@@ -262,8 +262,8 @@
     
     /**
-     * Replies the set of {@see OsmPrimitive}s referred to by members in
+     * Replies the set of {@link OsmPrimitive}s referred to by members in
      * this model.
      * 
-     * @return the set of {@see OsmPrimitive}s referred to by members in
+     * @return the set of {@link OsmPrimitive}s referred to by members in
      * this model.
      */
@@ -404,11 +404,11 @@
     
     /**
-     * Inserts a list of new relation members with the empty role for the primitives
+     * <p>Inserts a list of new relation members with the empty role for the primitives
      * with id in {@code ids}. Inserts the new primitives at the position of the first
-     * selected row. If no row is selected, at the end of the list. 
-     * 
-     *  null values are skipped. If there is an id for which there is no primitive in the context 
-     *  layer, if the primitive is deleted or invisible, an {@see IllegalArgumentException}
-     *  is thrown and nothing is inserted. 
+     * selected row. If no row is selected, at the end of the list.</p>
+     * 
+     * <p> null values are skipped. If there is an id for which there is no primitive in the context 
+     *  layer, if the primitive is deleted or invisible, an {@link IllegalArgumentException}
+     *  is thrown and nothing is inserted.</p>
      * 
      * @param ids the list of ids. Ignored if null.
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberModel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberModel.java	(revision 23510)
@@ -10,5 +10,5 @@
 /**
  * RelationMemberModel is a mutable relation member. In contrast to
- * {@see RelationMember} it doesn't keep references to the referred
+ * {@link RelationMember} it doesn't keep references to the referred
  * primitive. Internally, it only keeps their the unique id.
  *
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTable.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTable.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTable.java	(revision 23510)
@@ -3,5 +3,4 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.MenuItem;
 import java.awt.Toolkit;
 import java.awt.datatransfer.Clipboard;
@@ -22,5 +21,4 @@
 
 import javax.swing.AbstractAction;
-import javax.swing.Action;
 import javax.swing.JComponent;
 import javax.swing.JMenuItem;
@@ -286,5 +284,5 @@
         
         /**
-         * Replies true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
+         * Replies true if {@code transferFlavors} includes the data flavor {@link PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
 
          * @param transferFlavors an array of transferFlavors
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBox.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBox.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBox.java	(revision 23510)
@@ -4,5 +4,4 @@
 
 import org.openstreetmap.josm.data.Preferences;
-import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceKeys;
 /**
  * A combo box for selecting a turn restriction type.
@@ -32,5 +31,5 @@
     /**
      * Initializes the set of icons used from the preference key
-     * {@see PreferenceKeys#ROAD_SIGNS}.
+     * {@link PreferenceKeys#ROAD_SIGNS}.
      * 
      * @param prefs the JOSM preferences 
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 23510)
@@ -61,11 +61,11 @@
     
     /** the property name for the current turn restriction
-     * @see #setRelation(Relation)
-     * @see #getRelation()
+     * @link #setRelation(Relation)
+     * @link #getRelation()
      */
     static public final String TURN_RESTRICION_PROP = RelationEditor.class.getName() + ".turnRestriction";
 
     /** the property name for the current relation snapshot
-     * @see #getRelationSnapshot()
+     * @link #getRelationSnapshot()
      */
     static public final String TURN_RESTRICION_SNAPSHOT_PROP = RelationEditor.class.getName() + ".turnRestrictionSnapshot";
@@ -213,5 +213,5 @@
     *
     * @param owner the component relative to which the dialog is displayed 
-    * @param layer  the {@see OsmDataLayer} in whose context a relation is edited. Must not be null.
+    * @param layer  the {@link OsmDataLayer} in whose context a relation is edited. Must not be null.
     * @throws IllegalArgumentException thrown if layer is null
     */
@@ -224,5 +224,5 @@
      *
      * @param owner the component relative to which the dialog is displayed 
-     * @param layer  the {@see OsmDataLayer} in whose context a relation is edited. Must not be null.
+     * @param layer  the {@link OsmDataLayer} in whose context a relation is edited. Must not be null.
      * @param turnRestriction the relation. Can be null if a new relation is to be edited.
      * @throws IllegalArgumentException thrown if layer is null
@@ -246,15 +246,15 @@
 
     /**
-     * Sets the currently edited turn restriction. Creates a snapshot of the current
-     * state of the turn restriction. See {@see #getTurnRestrictionSnapshot()}
-     *
-     * {@code turnRestriction} can be null if a new restriction is created. A turn
+     * <p>Sets the currently edited turn restriction. Creates a snapshot of the current
+     * state of the turn restriction. See {@link #getTurnRestrictionSnapshot()}</p>
+     *
+     * <p>{@code turnRestriction} can be null if a new restriction is created. A turn
      * restriction which isn't assigned to a data set is allowed too. If {@code turnRestriction}
-     * is already assigned to a dataset, the dataset of {@see #getLayer()} is required, otherwise
-     * a {@see IllegalArgumentException} is thrown.
+     * is already assigned to a dataset, the dataset of {@link #getLayer()} is required, otherwise
+     * a {@link IllegalArgumentException} is thrown.</p>
      * 
      * @param turnRestriction the turn restriction
      * @throws IllegalArgumentException thrown if {@code turnRestriction} belongs to a different dataset than
-     * that owned by the layer {@see #getLayer()}
+     * that owned by the layer {@link #getLayer()}
      */
     protected void setTurnRestriction(Relation turnRestriction) {      
@@ -287,8 +287,8 @@
     
     /**
-     * Replies the {@see OsmDataLayer} in whose context this relation editor is
+     * Replies the {@link OsmDataLayer} in whose context this relation editor is
      * open
      *
-     * @return the {@see OsmDataLayer} in whose context this relation editor is
+     * @return the {@link OsmDataLayer} in whose context this relation editor is
      * open
      */
@@ -317,8 +317,8 @@
     
     /**
-     * Replies true if the currently edited turn restriction has been changed elsewhere.
-     *
-     * In this case a turn restriction editor can't apply updates to the turn restriction
-     * directly. Rather, it has to create a conflict.
+     * <p>Replies true if the currently edited turn restriction has been changed elsewhere.</p>
+     *
+     * <p>In this case a turn restriction editor can't apply updates to the turn restriction
+     * directly. Rather, it has to create a conflict.</p>
      *
      * @return true if the currently edited turn restriction has been changed elsewhere.
@@ -469,10 +469,10 @@
         
         /**
-         * Asks the user how to proceed if a turn restriction refers to deleted or invisible
-         * primitives.
+         * <p>Asks the user how to proceed if a turn restriction refers to deleted or invisible
+         * primitives.</p>
          * 
-         * If this method returns true the respective members should be removed and the turn
+         * <p>If this method returns true the respective members should be removed and the turn
          * restriction should be saved anyway. If it replies false, the turn restriction must not
-         * be saved.  
+         * be saved. </p>
          * 
          * @param deletedMembers the list of members referring to deleted or invisible primitives  
@@ -866,10 +866,10 @@
     
     /**
-     * Listens to changes of the preference {@see PreferenceKeys#ROAD_SIGNS}
-     * and refreshes the set of road icons.
+     * <p>Listens to changes of the preference {@link PreferenceKeys#ROAD_SIGNS}
+     * and refreshes the set of road icons.</p>
      * 
-     * Listens to changes of the preference {@see PreferenceKeys#SHOW_VIAS_IN_BASIC_EDITOR}
-     * and toggles the visibility af the list of via-objects in the Basic
-     * Editor. 
+     * <p>Listens to changes of the preference {@link PreferenceKeys#SHOW_VIAS_IN_BASIC_EDITOR}
+     * and toggles the visibility of the list of via-objects in the Basic
+     * Editor.</p>
      *
      */
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java	(revision 23510)
@@ -29,7 +29,7 @@
 
     /**
-     * Replies the singleton {@see TurnRestrictionEditorManager}
-     *
-     * @return the singleton {@see TurnRestrictionEditorManager}
+     * Replies the singleton {@link TurnRestrictionEditorManager}
+     *
+     * @return the singleton {@link TurnRestrictionEditorManager}
      */
     static public TurnRestrictionEditorManager getInstance() {
@@ -43,5 +43,5 @@
     /**
      * Helper class for keeping the context of a turn restriction editor. A turn
-     * restriction editor is open for turn restriction in a  {@see OsmDataLayer}
+     * restriction editor is open for turn restriction in a  {@link OsmDataLayer}
      */
     static private class DialogContext {
@@ -107,5 +107,5 @@
     /**
      * Register the editor for a turn restriction managed by a
-     * {@see OsmDataLayer}.
+     * {@link OsmDataLayer}.
      *
      * @param layer the layer
@@ -177,5 +177,5 @@
      * is currently open.
      *
-     * @see #isOpenInEditor(OsmDataLayer, Relation)
+     * @link #isOpenInEditor(OsmDataLayer, Relation)
      */
     public TurnRestrictionEditor getEditorForRelation(OsmDataLayer layer, Relation relation) {
@@ -201,5 +201,5 @@
 
     /**
-     * Positions an {@see TurnRestrictionEditor} centered on the screen
+     * Positions an {@link TurnRestrictionEditor} centered on the screen
      *
      * @param editor the editor
@@ -216,9 +216,9 @@
 
     /**
-     * Replies true, if there is another open {@see TurnRestrictionEditor} whose
+     * Replies true, if there is another open {@link TurnRestrictionEditor} whose
      * upper left corner is close to <code>p</code>.
      *
      * @param p  the reference point to check
-     * @return true, if there is another open {@see TurnRestrictionEditor} whose
+     * @return true, if there is another open {@link TurnRestrictionEditor} whose
      * upper left corner is close to <code>p</code>.
      */
@@ -234,6 +234,6 @@
 
     /**
-     * Positions a {@see TurnRestrictionEditor} close to the center of the screen, in such
-     * a way, that it doesn't entirely cover another {@see TurnRestrictionEditor}
+     * Positions a {@link TurnRestrictionEditor} close to the center of the screen, in such
+     * a way, that it doesn't entirely cover another {@link TurnRestrictionEditor}
      *
      * @param editor
@@ -254,5 +254,5 @@
 
     /**
-     * Positions a {@see TurnRestrictionEditor} on the screen. Tries to center it on the
+     * Positions a {@link TurnRestrictionEditor} on the screen. Tries to center it on the
      * screen. If it hides another instance of an editor at the same position this
      * method tries to reposition <code>editor</code> by moving it slightly down and
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java	(revision 23510)
@@ -71,5 +71,5 @@
     
     /**
-     * Creates a model in the context of a {@see OsmDataLayer}
+     * Creates a model in the context of a {@link OsmDataLayer}
      * 
      * @param layer the layer. Must not be null.
@@ -97,5 +97,5 @@
      * @exception IllegalArgumentException thrown if role is null
      */
-    public void setTurnRestrictionLeg(TurnRestrictionLegRole role, Way way) {
+    public void setTurnRestrictionLeg(TurnRestrictionLegRole role, Way way) throws IllegalArgumentException{
         CheckParameterUtil.ensureParameterNotNull(role, "role");
         switch(role){
@@ -136,13 +136,13 @@
     
     /**
-     * "Officially" a turn restriction should have exactly one member with 
-     * role {@see TurnRestrictionLegRole#FROM} and one member with role {@see TurnRestrictionLegRole#TO},
-     * both referring to an OSM {@see Way}. In order to deals with turn restrictions where these
+     * <p>"Officially" a turn restriction should have exactly one member with 
+     * role {@link TurnRestrictionLegRole#FROM FROM} and one member with role {@link TurnRestrictionLegRole#TO TO},
+     * both referring to an OSM {@link Way}. In order to deals with turn restrictions where these
      * integrity constraints are violated, this model also supports relation with multiple or no
-     * 'from' or 'to' members.
-     * 
-     * Replies the turn restriction legs with role {@code role}. If no leg with this
+     * 'from' or 'to' members.</p>
+     * 
+     * <p>Replies the turn restriction legs with role {@code role}. If no leg with this
      * role exists, an empty set is returned. If multiple legs exists, the set of referred
-     * primitives is returned.  
+     * primitives is returned.</p>  
      * 
      * @param role the role. Must not be null.
@@ -260,11 +260,11 @@
     
     /**
-     * Sets the list of vias for the edited turn restriction.
-     * 
-     * If {@code vias} is null, all vias are removed. All primitives
+     * <p>Sets the list of vias for the edited turn restriction.</p>
+     * 
+     * <p>If {@code vias} is null, all vias are removed. All primitives
      * in {@code vias} must be assigned to a dataset and the dataset
-     * must be equal to the dataset of this editor model, see {@see #getDataSet()}
-     * 
-     * null values in {@see vias} are skipped. 
+     * must be equal to the dataset of this editor model, see {@link #getDataSet()}</p>
+     * 
+     * <p>null values in {@link vias} are skipped.</p>
      * 
      * @param vias the list of vias 
@@ -285,5 +285,5 @@
     
     /**
-     * Registers this model with global event sources like {@see DatasetEventManager}
+     * Registers this model with global event sources like {@link DatasetEventManager}
      */
     public void registerAsEventListener(){
@@ -292,5 +292,5 @@
     
     /**
-     * Removes this model as listener from global event sources like  {@see DatasetEventManager}
+     * Removes this model as listener from global event sources like  {@link DatasetEventManager}
      */
     public void unregisterAsEventListener() {
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java	(revision 23510)
@@ -44,5 +44,5 @@
 
 /**
- * TurnRestrictionSelectionPopupPanel is displayed in a {@see Popup} to select whether
+ * TurnRestrictionSelectionPopupPanel is displayed in a {@link Popup} to select whether
  * the user wants to create a new turn restriction or whether he wants to edit one
  * of a list of turn restrictions.
@@ -59,6 +59,4 @@
     private JTable tblTurnRestrictions; 
     private OsmDataLayer layer;
-    
-    
     
     /**
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRenderer.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRenderer.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRenderer.java	(revision 23510)
@@ -55,5 +55,5 @@
     /**
      * Initializes the set of icons used from the preference key
-     * {@see PreferenceKeys#ROAD_SIGNS}.
+     * {@link PreferenceKeys#ROAD_SIGNS}.
      * 
      * @param prefs the JOSM preferences 
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java	(revision 23510)
@@ -39,8 +39,8 @@
 
 /**
- * ViaList is a JList which displays the 'via' members of a turn restriction.
+ * <p>ViaList is a JList which displays the 'via' members of a turn restriction.</p>
  * 
- * A ViaList is connected to a {@see TurnRestrictionEditorModel} through its
- * {@code ViaListModel}. 
+ * <p>A ViaList is connected to a {@link TurnRestrictionEditorModel} through its
+ * {@link ViaListModel}.</p> 
  * 
  */
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java	(revision 23510)
@@ -37,5 +37,5 @@
  * 
  * It can be used a cell renderer in lists of turn restrictions and as cell renderer in
- * {@see JTable}s displaying turn restrictions. 
+ * {@link JTable}s displaying turn restrictions. 
  * 
  */
@@ -217,5 +217,5 @@
     /**
      * Initializes the set of icons used from the preference key
-     * {@see PreferenceKeys#ROAD_SIGNS}.
+     * {@link PreferenceKeys#ROAD_SIGNS}.
      * 
      * @param prefs the JOSM preferences 
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java	(revision 23510)
@@ -24,11 +24,11 @@
 
 /**
- * This is the list model for the list of turn restrictions in the current data set.
+ * <p>This is the list model for the list of turn restrictions in the current data set.</p>
  * 
- * The model is a {@see EditLayerChangeListener}. It initializes itself from the data set of
- * the current edit layer.
+ * <p>The model is a {@link EditLayerChangeListener}. It initializes itself from the data set of
+ * the current edit layer.</p>
  * 
- * The model is a {@see DataSetListener}. It updates itself to reflect the list of turn
- * restrictions in the current data set. 
+ * <p>The model is a {@link DataSetListener}. It updates itself to reflect the list of turn
+ * restrictions in the current data set.</p> 
  *
  */
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java	(revision 23510)
@@ -444,5 +444,5 @@
     
     /**
-     * Listens the changes of the preference {@see PreferenceKeys#ROAD_SIGNS}
+     * Listens the changes of the preference {@link PreferenceKeys#ROAD_SIGNS}
      * and refreshes the set of road icons 
      *
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceKeys.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceKeys.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceKeys.java	(revision 23510)
@@ -1,5 +1,4 @@
 package org.openstreetmap.josm.plugins.turnrestrictions.preferences;
 
-import javax.swing.KeyStroke;
 
 /**
@@ -34,5 +33,5 @@
     /**
      * The shortcut which triggers creating a new or editing and existing turn
-     * restriction. The value must be parseable by {@see KeyStroke#getKeyStroke(String)}.
+     * restriction. The value must be parseable by {@link KeyStroke#getKeyStroke(String)}.
      * If missing, the default value "ctrl shift T" is assumed.
      */
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/ShortcutPreferencePanel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/ShortcutPreferencePanel.java	(revision 23503)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/ShortcutPreferencePanel.java	(revision 23510)
@@ -27,4 +27,5 @@
 import javax.swing.UIManager;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
@@ -131,6 +132,6 @@
         KeyStroke ks = KeyStroke.getKeyStroke(code, modifiers);
         
-        pref.put(PreferenceKeys.EDIT_SHORTCUT, ks.toString());      
-        CreateOrEditTurnRestrictionAction.install(ks);
+        pref.put(PreferenceKeys.EDIT_SHORTCUT, ks.toString());     
+        Main.registerActionShortcut(CreateOrEditTurnRestrictionAction.getInstance(), ks);
     }
     
Index: applications/editors/josm/plugins/turnrestrictions/test/README
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/README	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/README	(revision 23510)
@@ -0,0 +1,18 @@
+
+This directory includes the test resources for the turnrestictions plugin.
+
+
+src/             test sources (Unit tests, functional tests)
+
+config/          configuration files for running tests
+
+                 Note: make sure this directory is on the classpath when unit tests
+                 are executed. Unit tests look for the configuration files
+                 'test-unit-env.properties'.
+                 
+data/            test data
+
+josm.home/       Some unit test have to run in the context of a running JOSM instance.
+                 This is the home directory for this JOSM instance. It includes 
+                 a preferences files with default entries. 
+
Index: applications/editors/josm/plugins/turnrestrictions/test/config/test-unit-env.properties
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/config/test-unit-env.properties	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/config/test-unit-env.properties	(revision 23510)
@@ -0,0 +1,11 @@
+#
+# This file includes properties which are used by all turnrestrictions unit tests 
+#
+
+#### 
+# 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\\eclipse-ws\\eclipse-3.6.1\\turnrestrictions\\test\\josm.home
Index: applications/editors/josm/plugins/turnrestrictions/test/data/test-cases.osm
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/data/test-cases.osm	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/data/test-cases.osm	(revision 23510)
@@ -0,0 +1,165 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version='0.6' generator='JOSM'>
+  <bounds minlat='46.914158099999995' minlon='7.3788643' maxlat='46.930806499999996' maxlon='7.4164581' origin='OpenStreetMap server' />
+  <node id='-94' action='modify' visible='true' lat='46.92118998017687' lon='7.383993510066159' />
+  <node id='-92' action='modify' visible='true' lat='46.91990939642803' lon='7.38399351006616'>
+    <tag k='name' v='node 7.3' />
+  </node>
+  <node id='-91' visible='true' lat='46.9199878003943' lon='7.380435012966924' />
+  <node id='-78' visible='true' lat='46.923359062408515' lon='7.383840456427483' />
+  <node id='-76' action='modify' visible='true' lat='46.921921728576876' lon='7.383802193017814'>
+    <tag k='name' v='node 6.3' />
+  </node>
+  <node id='-75' visible='true' lat='46.921973995937314' lon='7.38016716909924' />
+  <node id='-38' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92880973833219' lon='7.402406615822886' />
+  <node id='-36' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92880973833219' lon='7.39972817714604' />
+  <node id='-34' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92752933671926' lon='7.396934948240187' />
+  <node id='-32' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.927581598608725' lon='7.3936442950086345' />
+  <node id='-30' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92828712912576' lon='7.396820158011179' />
+  <node id='-28' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92828712912576' lon='7.393606031598966' />
+  <node id='-26' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.928835868658666' lon='7.396743631191842' />
+  <node id='-24' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.928861998972394' lon='7.393606031598966' />
+  <node id='-22' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92888812927337' lon='7.390162324728737' />
+  <node id='-20' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92888812927337' lon='7.386948198316524' />
+  <node id='-18' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92773838397117' lon='7.383657545084972' />
+  <node id='-16' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92779064565668' lon='7.380252101624412' />
+  <node id='-14' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92833939027588' lon='7.3837340719043105' />
+  <node id='-12' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.928365520831804' lon='7.3802903650340825' />
+  <node id='-10' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92888812927337' lon='7.383619281675304' />
+  <node id='-8' timestamp='2010-03-27T10:39:59Z' visible='true' lat='46.92888812927337' lon='7.3802903650340825' />
+  <node id='-6' timestamp='2010-03-27T10:52:49Z' visible='true' lat='46.9243377340131' lon='7.380169082269725' />
+  <node id='-4' action='modify' timestamp='2010-03-27T10:52:49Z' visible='true' lat='46.9242959219737' lon='7.383689315959293'>
+    <tag k='name' v='node 5.3' />
+  </node>
+  <node id='-2' action='modify' timestamp='2010-03-27T10:52:49Z' visible='true' lat='46.925759323935175' lon='7.383689315959293' />
+  <node id='3193150' action='delete' timestamp='2010-03-14T11:36:30Z' uid='1' user='guggis' visible='true' version='1' changeset='3301' lat='46.9295464' lon='7.3922341' />
+  <node id='3193151' action='delete' timestamp='2010-03-14T11:36:30Z' uid='1' user='guggis' visible='true' version='1' changeset='3301' lat='46.9295464' lon='7.397716' />
+  <node id='3193152' action='delete' timestamp='2010-03-14T11:36:56Z' uid='1' user='guggis' visible='true' version='1' changeset='3300' lat='46.9276142' lon='7.3927056' />
+  <node id='3193153' action='delete' timestamp='2010-03-14T11:36:56Z' uid='1' user='guggis' visible='true' version='1' changeset='3300' lat='46.9273727' lon='7.3963602' />
+  <way id='-96' action='modify' visible='true'>
+    <nd ref='-92' />
+    <nd ref='-94' />
+    <tag k='name' v='way 7.2' />
+  </way>
+  <way id='-93' action='modify' visible='true'>
+    <nd ref='-91' />
+    <nd ref='-92' />
+    <tag k='name' v='way 7.1' />
+  </way>
+  <way id='-81' action='modify' visible='true'>
+    <nd ref='-76' />
+    <nd ref='-78' />
+    <tag k='name' v='way 6.2' />
+  </way>
+  <way id='-77' action='modify' visible='true'>
+    <nd ref='-75' />
+    <nd ref='-76' />
+    <tag k='name' v='way 6.1' />
+  </way>
+  <way id='-62' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <nd ref='-36' />
+    <nd ref='-38' />
+    <tag k='name' v='way 4.1' />
+  </way>
+  <way id='-60' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <nd ref='-32' />
+    <nd ref='-34' />
+    <tag k='name' v='way 3.3' />
+  </way>
+  <way id='-58' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <nd ref='-28' />
+    <nd ref='-30' />
+    <tag k='name' v='way 3.2' />
+  </way>
+  <way id='-56' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <nd ref='-24' />
+    <nd ref='-26' />
+    <tag k='name' v='way 3.1' />
+  </way>
+  <way id='-54' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <nd ref='-20' />
+    <nd ref='-22' />
+    <tag k='name' v='way 2.1' />
+  </way>
+  <way id='-52' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <nd ref='-16' />
+    <nd ref='-18' />
+    <tag k='name' v='way 1.3' />
+  </way>
+  <way id='-50' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <nd ref='-12' />
+    <nd ref='-14' />
+    <tag k='name' v='way 1.2' />
+  </way>
+  <way id='-48' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <nd ref='-8' />
+    <nd ref='-10' />
+    <tag k='name' v='way 1.1' />
+  </way>
+  <way id='-46' action='modify' timestamp='2010-03-27T10:52:49Z' visible='true'>
+    <nd ref='-6' />
+    <nd ref='-4' />
+    <tag k='name' v='way 5.1' />
+  </way>
+  <way id='-44' action='modify' timestamp='2010-03-27T10:52:49Z' visible='true'>
+    <nd ref='-4' />
+    <nd ref='-2' />
+    <tag k='name' v='way 5.2' />
+  </way>
+  <way id='85091' action='delete' timestamp='2010-03-14T11:36:30Z' uid='1' user='guggis' visible='true' version='1' changeset='3301'>
+  </way>
+  <way id='85092' action='delete' timestamp='2010-03-14T11:36:56Z' uid='1' user='guggis' visible='true' version='1' changeset='3300'>
+  </way>
+  <relation id='-103' action='modify' visible='true'>
+    <member type='way' ref='-93' role='from' />
+    <member type='way' ref='-96' role='to' />
+    <member type='node' ref='-92' role='via' />
+    <tag k='except' v='non-standard-except' />
+    <tag k='name' v='Test Case 7 - Non-Standard-Excepts' />
+    <tag k='restriction' v='no_right_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-90' visible='true'>
+    <member type='way' ref='-77' role='from' />
+    <member type='way' ref='-81' role='to' />
+    <tag k='name' v='Test Case 6 - Missing node as &apos;via&apos;' />
+    <tag k='restriction' v='no_left_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-74' action='modify' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <member type='way' ref='-62' role='from' />
+    <tag k='name' v='Test Case 4 - No &apos;to&apos; ways' />
+    <tag k='restriction' v='no_left_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-72' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <member type='way' ref='-56' role='from' />
+    <member type='way' ref='-58' role='to' />
+    <member type='way' ref='-60' role='to' />
+    <tag k='name' v='Test Case 3 - 2 &apos;tp&apos; ways' />
+    <tag k='restriction' v='no_left_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-70' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <member type='way' ref='-54' role='to' />
+    <tag k='name' v='Test Case 2 - No from way' />
+    <tag k='restriction' v='no_left_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-68' timestamp='2010-03-27T10:39:59Z' visible='true'>
+    <member type='way' ref='-48' role='from' />
+    <member type='way' ref='-50' role='from' />
+    <member type='way' ref='-52' role='to' />
+    <tag k='name' v='Test Case 1 - 2 from ways' />
+    <tag k='restriction' v='no_left_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-66' action='modify' timestamp='2010-03-27T10:52:49Z' visible='true'>
+    <member type='way' ref='-46' role='from' />
+    <member type='way' ref='-44' role='to' />
+    <member type='node' ref='-4' role='via' />
+    <tag k='name' v='Test Case 5 - Non-Standard restriction' />
+    <tag k='restriction' v='non-standard-restriction' />
+    <tag k='type' v='restriction' />
+  </relation>
+</osm>
Index: applications/editors/josm/plugins/turnrestrictions/test/data/test-data-set-1.osm
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/data/test-data-set-1.osm	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/data/test-data-set-1.osm	(revision 23510)
@@ -0,0 +1,186 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version='0.6' generator='JOSM'>
+  <bounds minlat='46.9185552' minlon='7.3901081' maxlat='46.9271138' maxlon='7.4086475' origin='OpenStreetMap server' />
+  <node id='-56' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.920401695281015' lon='7.392672484176534' />
+  <node id='-54' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.91947481836078' lon='7.394608244994619' />
+  <node id='-52' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.91947481836078' lon='7.392692440473628' />
+  <node id='-50' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.9194611876982' lon='7.391036067814855' />
+  <node id='-48' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.920906018634135' lon='7.399118368137783' />
+  <node id='-46' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.921737460284035' lon='7.40135347341227' />
+  <node id='-44' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.921737460284035' lon='7.39909841184069' />
+  <node id='-42' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.921737460284035' lon='7.3971426947255114' />
+  <node id='-40' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92280059638277' lon='7.392991784930033' />
+  <node id='-38' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92175109036751' lon='7.394767895371367' />
+  <node id='-36' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92175109036752' lon='7.393011741227126' />
+  <node id='-34' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.921737460284014' lon='7.390916330032293' />
+  <node id='-32' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92375467491946' lon='7.391245608934339' />
+  <node id='-30' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92378193405656' lon='7.394298922389664' />
+  <node id='-28' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92450429613562' lon='7.394298922389665' />
+  <node id='-26' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.924517925515175' lon='7.391285521528527' />
+  <node id='-24' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.925969434589156' lon='7.404077507965554' />
+  <node id='-22' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.925955805578894' lon='7.401802490096877' />
+  <node id='-20' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.925955805578894' lon='7.39940773444564' />
+  <node id='-18' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92569685372496' lon='7.3913653467169' />
+  <node id='-16' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92566959556225' lon='7.393261194940797' />
+  <node id='-14' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92654852689992' lon='7.393198680597321' />
+  <node id='-12' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.9265827364623' lon='7.395296737244347' />
+  <node id='-10' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.9265827364623' lon='7.397511886221743' />
+  <node id='-8' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.925560562772716' lon='7.397471973627557' />
+  <node id='-6' action='modify' timestamp='2010-03-15T22:32:09Z' visible='true' lat='46.91930201488541' lon='7.399142698913044' />
+  <node id='-4' action='modify' timestamp='2010-03-15T22:32:09Z' visible='true' lat='46.919302014885396' lon='7.401068288768116'>
+    <tag k='name' v='node 8.3' />
+  </node>
+  <node id='-2' action='modify' timestamp='2010-03-15T22:32:09Z' visible='true' lat='46.92028078273882' lon='7.401045898188405' />
+  <way id='-96' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-52' />
+    <nd ref='-54' />
+    <tag k='name' v='way 7.2' />
+  </way>
+  <way id='-94' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-52' />
+    <nd ref='-56' />
+  </way>
+  <way id='-92' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-50' />
+    <nd ref='-52' />
+    <tag k='name' v='way 7.1' />
+  </way>
+  <way id='-90' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-44' />
+    <nd ref='-46' />
+  </way>
+  <way id='-88' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-44' />
+    <nd ref='-48' />
+    <tag k='name' v='way 6.2' />
+  </way>
+  <way id='-86' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-42' />
+    <nd ref='-44' />
+    <tag k='name' v='way 6.1' />
+  </way>
+  <way id='-84' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-36' />
+    <nd ref='-38' />
+  </way>
+  <way id='-82' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-36' />
+    <nd ref='-40' />
+    <tag k='name' v='way 5.2' />
+  </way>
+  <way id='-80' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-34' />
+    <nd ref='-36' />
+    <tag k='name' v='way 5.1' />
+  </way>
+  <way id='-78' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-28' />
+    <nd ref='-30' />
+  </way>
+  <way id='-76' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-30' />
+    <nd ref='-32' />
+    <tag k='name' v='way 4.2' />
+  </way>
+  <way id='-74' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-26' />
+    <nd ref='-28' />
+    <tag k='name' v='way 4.1' />
+  </way>
+  <way id='-72' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-22' />
+    <nd ref='-24' />
+    <tag k='name' v='Weg 3.2' />
+  </way>
+  <way id='-70' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <nd ref='-20' />
+    <nd ref='-22' />
+    <tag k='name' v='Weg 3.1' />
+  </way>
+  <way id='-68' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
+    <nd ref='-18' />
+    <nd ref='-16' />
+    <tag k='name' v='Weg 1.1' />
+  </way>
+  <way id='-66' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
+    <nd ref='-16' />
+    <nd ref='-14' />
+    <tag k='name' v='Weg 1.2' />
+  </way>
+  <way id='-64' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
+    <nd ref='-12' />
+    <nd ref='-10' />
+    <tag k='name' v='Weg 2.1' />
+  </way>
+  <way id='-62' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
+    <nd ref='-10' />
+    <nd ref='-8' />
+    <tag k='name' v='Weg 2.2' />
+  </way>
+  <way id='-60' action='modify' timestamp='2010-03-15T22:32:09Z' visible='true'>
+    <nd ref='-6' />
+    <nd ref='-4' />
+    <tag k='name' v='way.8.1' />
+  </way>
+  <way id='-58' action='modify' timestamp='2010-03-15T22:32:09Z' visible='true'>
+    <nd ref='-4' />
+    <nd ref='-2' />
+    <tag k='name' v='way.8.2' />
+  </way>
+  <relation id='-114' visible='true'>
+    <member type='way' ref='-60' role='from' />
+    <member type='way' ref='-58' role='to' />
+    <member type='node' ref='-4' role='via' />
+    <tag k='restriction' v='no_left_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-110' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <member type='way' ref='-92' role='from' />
+    <member type='way' ref='-96' role='to' />
+    <member type='node' ref='-52' role='via' />
+    <tag k='restriction' v='only_straight_on' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-108' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <member type='way' ref='-86' role='from' />
+    <member type='way' ref='-88' role='to' />
+    <member type='node' ref='-44' role='via' />
+    <tag k='restriction' v='only_right_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-106' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <member type='way' ref='-80' role='from' />
+    <member type='way' ref='-82' role='to' />
+    <member type='node' ref='-36' role='via' />
+    <tag k='restriction' v='only_left_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-104' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <member type='way' ref='-74' role='from' />
+    <member type='way' ref='-76' role='to' />
+    <member type='way' ref='-78' role='via' />
+    <tag k='restriction' v='no_u_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-102' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
+    <member type='way' ref='-70' role='from' />
+    <member type='way' ref='-72' role='to' />
+    <member type='node' ref='-22' role='via' />
+    <tag k='restriction' v='no_straight_on' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-100' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
+    <member type='way' ref='-68' role='from' />
+    <member type='way' ref='-66' role='to' />
+    <member type='node' ref='-16' role='via' />
+    <tag k='restriction' v='no_left_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+  <relation id='-98' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
+    <member type='way' ref='-64' role='from' />
+    <member type='way' ref='-62' role='to' />
+    <member type='node' ref='-10' role='via' />
+    <tag k='restriction' v='no_right_turn' />
+    <tag k='type' v='restriction' />
+  </relation>
+</osm>
Index: applications/editors/josm/plugins/turnrestrictions/test/josm.home/preferences
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/josm.home/preferences	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/josm.home/preferences	(revision 23510)
@@ -0,0 +1,1 @@
+osm-server.url=http://localhost:8080/api
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/AllUnitTests.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/AllUnitTests.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/AllUnitTests.java	(revision 23510)
@@ -0,0 +1,14 @@
+package org.openstreetmap.josm.plugins.turnrestrictions;
+
+import org.openstreetmap.josm.plugins.turnrestrictions.editor.AllEditorTests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllUnitTests {
+	public static Test suite() throws Exception {
+		TestSuite suite = new TestSuite(AllUnitTests.class.getName());
+		suite.addTest(AllEditorTests.suite());
+		return suite;
+	}
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/AllEditorTests.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/AllEditorTests.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/AllEditorTests.java	(revision 23510)
@@ -0,0 +1,26 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import groovy.util.GroovyTestSuite;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class AllEditorTests extends TestCase{
+
+	private static final String TEST_ROOT = "test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/";
+	private static final GroovyTestSuite gsuite = new GroovyTestSuite();
+	
+	private static <T extends TestCase> Class<T> groovyts(String className) throws Exception {
+		return gsuite.compile(TEST_ROOT + className + ".groovy");
+	}
+	
+	public static Test suite() throws Exception {
+		TestSuite suite = new TestSuite(AllEditorTests.class.getName());
+		suite.addTestSuite(groovyts("JosmSelectionListModelTest"));
+		suite.addTestSuite(groovyts("TurnRestrictionEditorModelUnitTest"));
+		suite.addTestSuite(groovyts("TurnRestrictionLegEditorUnitTest"));
+		suite.addTestSuite(groovyts("TurnRestrictionTypeRendererTest"));
+		suite.addTestSuite(groovyts("TurnRestrictionTypeTest"));
+		return suite;
+	}
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanelTest.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanelTest.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanelTest.java	(revision 23510)
@@ -0,0 +1,49 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+
+import javax.swing.JFrame;
+
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+
+/**
+ * Simple functional test for the layout / basic functionality of {@see BasicEditorPanel} 
+ *   
+ */
+public class BasicEditorPanelTest extends JFrame {
+
+    private TurnRestrictionEditorModel model;
+    private DataSet ds;
+    
+    public BasicEditorPanelTest() {
+        ds = new DataSet();
+        OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
+
+            public void gotoBasicEditor() {
+            }
+
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        model = new TurnRestrictionEditorModel(layer, controler);
+        
+        BasicEditorPanel panel = new BasicEditorPanel(model);
+        
+        Container c = getContentPane();
+        c.setLayout(new BorderLayout());
+        c.add(panel, BorderLayout.CENTER);      
+        setSize(600,600);
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
+    }
+    
+    
+    static public void main(String args[]) {
+        new BasicEditorPanelTest().setVisible(true);
+    }
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModelTest.groovy
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModelTest.groovy	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModelTest.groovy	(revision 23510)
@@ -0,0 +1,163 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import groovy.util.GroovyTestCase;
+
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import javax.swing.DefaultListSelectionModel;
+import org.openstreetmap.josm.data.osm.*;
+import org.openstreetmap.josm.data.coor.*;
+
+import org.openstreetmap.josm.plugins.turnrestrictions.fixtures.JOSMFixture;
+
+import static org.junit.Assert.*;
+import org.junit.*;
+import javax.swing.JFrame;
+
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+
+/**
+ * Unit test for {@see JosmSelctionListModel}
+ */
+class JosmSelectionListModelTest extends GroovyTestCase {
+	final shouldFail = new GroovyTestCase().&shouldFail
+	
+	@Before
+	public void setUp() {
+		JOSMFixture.createUnitTestFixture().init()
+	}
+	
+	@Test
+	public void test_Constructor(){
+		DataSet ds = new DataSet()
+		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+		JosmSelectionListModel model = new JosmSelectionListModel(layer, new DefaultListSelectionModel());		
+		
+		shouldFail(IllegalArgumentException){
+			model = new JosmSelectionListModel(layer, null)
+		}
+		
+		shouldFail(IllegalArgumentException){
+			model = new JosmSelectionListModel(null, new DefaultListSelectionModel())
+		}
+	}
+	
+	@Test
+	public void test_setJOSMSelection() {
+		DataSet ds = new DataSet()
+		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+		JosmSelectionListModel model = new JosmSelectionListModel(layer, new DefaultListSelectionModel());
+		
+		// set a selection with three objects 
+		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]
+		model.setJOSMSelection objects
+		assert model.getSize() == 3
+		
+		// null is allowed 
+		model.setJOSMSelection(null)
+		assert model.getSize() == 0
+		assert model.getSelected().isEmpty()
+		
+		// empty has the same effect
+		model.setJOSMSelection([])
+		assert model.getSize() == 0
+		assert model.getSelected().isEmpty()
+	}
+	
+	@Test
+	public void test_setJOSMSelection_withSelected() {
+		DataSet ds = new DataSet()
+		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+		JosmSelectionListModel model = new JosmSelectionListModel(layer, new DefaultListSelectionModel());
+		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]	
+		model.setJOSMSelection(objects)
+		model.setSelected(objects[0..1])
+		assert model.getSelected().asList() as Set == objects[0..1] as Set
+		
+		// set new selection which includes one object which is currently
+        // selected in the model. Should still be selected after setting
+		// the new JOSM selection
+		objects = objects[1..2] 
+		model.setJOSMSelection(objects)
+		assert model.getSelected().asList() == [objects[0]]
+	}	
+	
+	@Test
+	public void test_getSelected() {
+		DataSet ds = new DataSet()
+		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+		DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
+		
+		JosmSelectionListModel model = new JosmSelectionListModel(layer, selectionModel);
+		assert model.getSelected() != null
+		assert model.getSelected().isEmpty()
+	
+		// select one element 
+		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]	
+		model.setJOSMSelection(objects)
+		selectionModel.setSelectionInterval(0, 0)
+		assert model.getSelected().asList() == [model.getElementAt(0)];
+		
+		// select two elements
+		selectionModel.setSelectionInterval(1,2)
+		assert model.getSelected().asList() as Set == [model.getElementAt(1),model.getElementAt(2)] as Set;
+	}
+	
+	@Test
+	public void test_setSelected() {
+		DataSet ds = new DataSet()
+		OsmDataLayer layer = new OsmDataLayer(ds, "test", null)
+		DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
+		
+		// set selected with null is OK - nothing selected thereafter
+		JosmSelectionListModel model = new JosmSelectionListModel(layer, selectionModel);
+		model.setSelected(null)
+		assert model.getSelected().isEmpty()
+		
+		// set selected with empty list is OK - nothing selected thereafter
+		model.setSelected([])
+		assert model.getSelected().isEmpty()
+		
+		// select an object existing in the list of displayed objects 
+		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]	
+		model.setJOSMSelection(objects)
+		model.setSelected([objects[0]])
+		assert model.getSelected().asList() == [objects[0]];
+		
+		// select an object not-existing in the list of displayed objects 	
+		model.setJOSMSelection(objects)
+		model.setSelected([new Way()])
+		assert model.getSelected().isEmpty()
+	}
+	
+	@Test 
+	public void test_editLayerChanged() {
+		DataSet ds = new DataSet()
+		DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();		
+		def objects = [new Node(new LatLon(1,1)), new Way(), new Relation()]	
+		objects.each {ds.addPrimitive(it)}
+		
+		OsmDataLayer layer1 = new OsmDataLayer(ds,"layer1", null)
+		OsmDataLayer layer2 = new OsmDataLayer(new DataSet(),"layer2", null)
+		
+		JosmSelectionListModel model = new JosmSelectionListModel(layer1, selectionModel);
+		
+		// switch from edit layer1 to edit layer2. content of the JOSM selection 
+		// should be empty thereafter 
+		model.editLayerChanged(layer1, layer2)
+		assert model.getSize() == 0
+		
+		// switch from layer2 to layer1 which has one object selected. Object should
+		// be displayed in the JOSM selection list 
+		ds.setSelected([objects[0]])
+		model.editLayerChanged(layer2, layer1)
+		assert model.getSize() == 1
+		assert model.getElementAt(0) == objects[0];
+		
+		// switch to a "null" edit layer (i.e. no edit layer)- nothing should
+		// be displayed in the selection list 
+		model.editLayerChanged(layer1, null)
+		assert model.getSize() == 0
+	}
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxTest.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxTest.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxTest.java	(revision 23510)
@@ -0,0 +1,61 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import java.awt.Container;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JFrame;
+
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+
+/**
+ * This is a simple test application to test the functionality/layout of 
+ * the {@see TurnRestrictionComboBox}
+ * 
+ */
+public class TurnRestrictionComboBoxTest extends JFrame {
+    
+    private TurnRestrictionEditorModel model;
+    private DataSet ds = new DataSet();
+    
+    protected void build() {
+        ds = new DataSet();
+        OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
+
+            public void gotoBasicEditor() {
+            }
+
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        model = new TurnRestrictionEditorModel(layer, controler);
+        
+        Container c = getContentPane();
+        c.setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        
+        TurnRestrictionComboBox cb = new TurnRestrictionComboBox(
+                new TurnRestrictionComboBoxModel(model)
+        );
+        add(cb, gc);        
+    }
+    
+    public TurnRestrictionComboBoxTest() {
+        build();
+        setSize(600,600);
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
+    }
+    
+    public static void main(String args[]) {
+        new TurnRestrictionComboBoxTest().setVisible(true);
+    }
+
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModelUnitTest.groovy
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModelUnitTest.groovy	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModelUnitTest.groovy	(revision 23510)
@@ -0,0 +1,284 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+import groovy.util.GroovyTestCase;
+
+import static org.junit.Assert.*;
+import org.junit.*;
+import static org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionLegRole.*
+import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
+import org.openstreetmap.josm.data.osm.Relation
+import org.openstreetmap.josm.data.osm.RelationMember
+import org.openstreetmap.josm.data.osm.Node
+import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
+import org.openstreetmap.josm.data.osm.Way
+import org.openstreetmap.josm.data.osm.DataSet
+import org.openstreetmap.josm.data.coor.*
+import org.openstreetmap.josm.fixtures.JOSMFixture;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+
+import org.openstreetmap.josm.plugins.turnrestrictions.fixtures.JOSMFixture;
+
+/**
+ * This is a unit test for {@link TurnRestrictionEditorModel}
+ *
+ */
+class TurnRestrictionEditorModelUnitTest extends GroovyTestCase{
+
+	final shouldFail = new GroovyTestCase().&shouldFail
+	
+	def navigationControlerMock = [
+       gotoBasicEditor:{}, 
+       gotoAdvancedEditor: {}
+	] as NavigationControler
+	 
+	private DataSet ds
+	private OsmDataLayer layer
+	private TurnRestrictionEditorModel model 
+	
+	def createNode(id = null, coor = null) {
+	    Node n
+	    if (id == null){
+	    	n = new Node()
+	    } else {
+	    	n = new Node(id)
+	    }
+	    if (coor != null) n.setCoor(coor)
+	    ds.addPrimitive(n)
+	    return n
+	}
+	
+	def createWay(id=null) {
+	    Way w
+	    if (id == null){
+	    	w = new Way()
+	    } else {
+	    	w = new Way(id)
+	    }
+	    ds.addPrimitive(w)
+	    return w
+	}
+	
+	def node(id){
+		return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.NODE))
+	}
+	
+	def way(id) {
+		return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.WAY))
+	}
+	
+	def rel(id){
+		return ds.getPrimitiveById(new SimplePrimitiveId(id, OsmPrimitiveType.RELATION))
+	}
+	
+	def rm(role,object){
+		return new RelationMember(role, object);
+	}
+	
+	def buildDataSet1() {		
+		// prepare some nodes and ways
+		createNode(21)
+		createNode(22)
+		createNode(31)
+		createNode(32)
+		createWay(2)
+		createWay(3)
+			
+		way(2).setNodes([node(21), node(22)])
+		way(3).setNodes([node(22), node(31)])
+		
+		// a standard turn restriction with a from, a to and a via
+		Relation r = new Relation(1)
+		r.setMembers([rm("from", way(2)), rm("to", way(3)), rm("via", node(22))])
+		r.put "type", "restriction"
+		r.put "restriction", "no_left_turn"		
+		ds.addPrimitive r
+	}
+	
+	@Before
+	public void setUp() {
+		JOSMFixture.createUnitTestFixture().init()
+			
+		ds = new DataSet()
+		layer = new OsmDataLayer(ds, "test", null)		
+		model = new TurnRestrictionEditorModel(layer, navigationControlerMock);
+	}
+	
+	
+	
+	/**
+	 * Test the constructor 
+	 */
+	@Test
+	public void test_Constructor() {		
+		shouldFail(IllegalArgumentException){
+			model = new TurnRestrictionEditorModel(null, navigationControlerMock);			
+		}
+
+		shouldFail(IllegalArgumentException){
+			model = new TurnRestrictionEditorModel(layer, null);			
+		}
+	}
+	
+	@Test
+	public void test_populate_EmptyTurnRestriction() {		
+		// an "empty" turn restriction with a public id 
+		Relation r = new Relation(1)
+		ds.addPrimitive r
+		assert model.getTurnRestrictionLeg(FROM).isEmpty()
+		assert model.getTurnRestrictionLeg(TO).isEmpty()
+		assert model.getVias().isEmpty()
+		assert model.getRestrictionTagValue() == ""
+	    assert model.getExcept().getValue() == ""
+	}
+	
+	/**
+	 * Populating the model with a simple default turn restriction: one from member (a way),
+	 * one to member (a way), one via (the common node of these ways), minimal tag set with
+	 * type=restriction and restriction=no_left_turn
+	 * 
+	 */
+	@Test
+	public void test_populate_SimpleStandardTurnRestriction() {		
+		buildDataSet1()		
+		model.populate(rel(1))
+		
+		assert model.getTurnRestrictionLeg(FROM).asList() == [way(2)]
+		assert model.getTurnRestrictionLeg(TO).asList() == [way(3)]
+		assert model.getVias() == [node(22)]
+		assert model.getRestrictionTagValue() == "no_left_turn"
+	    assert model.getExcept().getValue() == ""
+	}
+	
+	@Test
+	public void setFrom() {
+		buildDataSet1()		
+		model.populate(rel(1))
+		
+		createNode(41)
+		createNode(42)
+		createWay(4).setNodes([node(41),node(42)]);
+		
+		// set another way as from 
+		model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, way(4).getPrimitiveId())
+		assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM).asList() == [way(4)];
+		
+		// delete the/all members with role 'from'
+		model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, null)
+		assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM).isEmpty()
+		
+		
+		shouldFail(IllegalArgumentException) {
+			// can't add a node as 'from'
+			model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, node(21).getPrimitiveId())
+		}
+		
+		shouldFail(IllegalStateException) {
+			// can't set a way as 'from' if it isn't part of the dataset 
+			Way way = new Way() 
+			model.setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, way.getPrimitiveId())
+		}
+	}
+	
+	@Test
+	public void setTo() {
+		buildDataSet1()		
+		model.populate(rel(1))
+		
+		createNode(41)
+		createNode(42)
+		createWay(4).setNodes([node(41),node(42)]);
+		
+		// set another way as from 
+		model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, way(4).getPrimitiveId())
+		assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.TO).asList() == [way(4)];
+		
+		// delete the/all members with role 'from'
+		model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, null)
+		assert model.getTurnRestrictionLeg(TurnRestrictionLegRole.TO).isEmpty()
+		
+		
+		shouldFail(IllegalArgumentException) {
+			// can't add a node as 'from'
+			model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, node(21).getPrimitiveId())
+		}
+		
+		shouldFail(IllegalStateException) {
+			// can't set a way as 'from' if it isn't part of the dataset 
+			Way way = new Way() 
+			model.setTurnRestrictionLeg(TurnRestrictionLegRole.TO, way.getPrimitiveId())
+		}
+	}
+	
+	/**
+	 * Test setting or deleting the tag 'restriction'
+	 */
+	@Test
+	public void setRestrictionTagValue() {
+		buildDataSet1()		
+		model.populate(rel(1))
+		
+		model.setRestrictionTagValue("no_left_turn")
+		assert model.getRestrictionTagValue() == "no_left_turn";
+		
+		model.setRestrictionTagValue(null)
+		assert model.getRestrictionTagValue() == "";
+		
+		model.setRestrictionTagValue("  ")
+		assert model.getRestrictionTagValue() == "";
+		
+		model.setRestrictionTagValue(" no_right_Turn ")
+		assert model.getRestrictionTagValue() == "no_right_turn";		
+	}
+	
+	/**
+	 * Test setting vias
+	 */
+	@Test
+	public void setVias() {
+		buildDataSet1()		
+		model.populate(rel(1))
+		
+		// one node as via - OK
+		model.setVias([node(22)])
+		assert model.getVias() == [node(22)];
+		
+		// pass in null as vias -> remove all vias 
+		model.setVias(null)
+		assert model.getVias().isEmpty()
+		
+		// pass in empty list -> remove all vias 
+		model.setVias([])
+		assert model.getVias().isEmpty()
+		
+		// create a list of vias with a way and twice a node (which doesn't
+		// make sense but is technically allowed)
+		//
+		createNode(41)
+		createNode(42)
+		createWay(4).setNodes([node(41), node(42)])
+		model.setVias([way(4), node(22), node(22)])
+		assert model.getVias() == [way(4), node(22), node(22)];
+
+        // null values in the list of vias are skipped 		                     
+        model.setVias([null, node(22)])
+        assert model.getVias() == [node(22)]
+                                   
+        shouldFail(IllegalArgumentException) {
+			// an object which doesn't belong to the same dataset can't
+			// be a via
+			Node n = new Node(new LatLon(0,0))
+			model.setVias([n])
+		}
+	}
+	
+	/**
+	 * Tests whether the three sub models exist
+	 */
+	@Test
+	public void submodelsExist() {
+		assert model.getIssuesModel() != null
+		assert model.getRelationMemberEditorModel() != null
+		assert model.getTagEditorModel() != null
+		
+		assert model.getLayer() == layer 
+	}	
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorTest.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorTest.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorTest.java	(revision 23510)
@@ -0,0 +1,25 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import javax.swing.JFrame;
+
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+/**
+ * Simple application to test functionality and layout of the turn restriction editor.
+ *
+ */
+public class TurnRestrictionEditorTest extends JFrame {
+    
+    public TurnRestrictionEditorTest() {
+        setSize(10,10);
+        TurnRestrictionEditor editor = new TurnRestrictionEditor(this, new OsmDataLayer(new DataSet(), "test", null));
+        editor.setSize(600,600);
+        editor.setVisible(true);
+        
+        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+    }
+    
+    static public void main(String args[]) {
+        new TurnRestrictionEditorTest().setVisible(true);
+    }
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorTest.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorTest.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorTest.java	(revision 23510)
@@ -0,0 +1,158 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.PrimitiveId;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.plugins.turnrestrictions.dnd.PrimitiveIdListProvider;
+import org.openstreetmap.josm.plugins.turnrestrictions.dnd.PrimitiveIdListTransferHandler;
+
+/**
+ * Simple test application to test functionality and layout of the 
+ * {@see TurnRestrictionLegEditor}
+ */
+public class TurnRestrictionLegEditorTest extends JFrame {
+    
+    private JTextArea taTest;
+    private TurnRestrictionLegEditor editor;
+    private TurnRestrictionEditorModel model;
+    private JList lstObjects;
+    private DefaultListModel listModel;
+    private DataSet dataSet;
+    
+    
+    protected JPanel buildLegEditorPanel() {
+        DataSet ds = new DataSet();
+        OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
+
+            public void gotoBasicEditor() {
+            }
+
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        JPanel pnl = new JPanel(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 0.0;       
+        pnl.add(new JLabel("From"), gc);
+        
+        gc.weightx = 1.0;
+        gc.gridx = 1;
+        model = new TurnRestrictionEditorModel(layer, controler);
+        dataSet = new DataSet();
+        model.populate(new Relation());
+        pnl.add(editor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.FROM), gc);
+        
+        return pnl;
+    }
+    
+    protected JPanel buildObjectListPanel() {
+        JPanel pnl = new JPanel(new BorderLayout());
+        listModel = new DefaultListModel();
+        pnl.add(new JScrollPane(lstObjects = new JList(listModel)), BorderLayout.CENTER);
+        lstObjects.setCellRenderer(new OsmPrimitivRenderer());      
+        
+        PrimitiveIdListProvider provider = new PrimitiveIdListProvider() {          
+            public List<PrimitiveId> getSelectedPrimitiveIds() {
+                List<PrimitiveId> ret = new ArrayList<PrimitiveId>();
+                int [] sel = lstObjects.getSelectedIndices();
+                for (int i: sel){
+                    ret.add(((OsmPrimitive)lstObjects.getModel().getElementAt(i)).getPrimitiveId());
+                }
+                return ret;
+            }
+        };
+        
+        lstObjects.setTransferHandler(new PrimitiveIdListTransferHandler(provider));
+        lstObjects.setDragEnabled(true);
+        return pnl;
+    }
+    
+    protected void build() {
+        Container c = getContentPane();
+        c.setLayout(new GridBagLayout());
+        
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;    
+        gc.insets = new Insets(20, 0, 20, 0);
+        gc.weightx = 1.0;       
+        gc.weighty = 0.0;
+        add(buildLegEditorPanel(), gc);
+        
+        gc.gridy = 1;
+        gc.weightx = 1.0;
+        gc.weighty = 1.0;
+        gc.fill = GridBagConstraints.BOTH;
+        add(buildObjectListPanel(), gc);
+        setSize(600,600);   
+    }
+    
+    protected void initForTest1() {
+        Way w = new Way(1);
+        w.put("name", "way-1");
+        
+        editor.getModel().setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, w);
+    }
+    
+    protected void initForTest2() {
+        Way w = new Way(1);
+        w.put("name", "way-1");     
+        dataSet.addPrimitive(w);
+        editor.getModel().setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, w);
+        
+        Node n = new Node(new LatLon(1,1));
+        n.setOsmId(1, 1);
+        n.put("name", "node.1");
+        dataSet.addPrimitive(n);
+        listModel.addElement(n);
+        
+        w = new Way();
+        w.setOsmId(2,1);
+        w.put("name", "way.1");
+        dataSet.addPrimitive(w);
+        listModel.addElement(w);
+        
+        Relation r = new Relation();
+        r.setOsmId(3,1);
+        r.put("name", "relation.1");
+        dataSet.addPrimitive(r);
+        listModel.addElement(r);
+    }
+
+    public TurnRestrictionLegEditorTest(){
+        build();
+        initForTest2();
+    }
+    
+    static public void main(String args[]) {
+        new TurnRestrictionLegEditorTest().setVisible(true);
+    }
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorUnitTest.groovy
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorUnitTest.groovy	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorUnitTest.groovy	(revision 23510)
@@ -0,0 +1,53 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import groovy.util.GroovyTestCase;
+
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+
+import org.openstreetmap.josm.plugins.turnrestrictions.fixtures.JOSMFixture;
+
+import static org.junit.Assert.*;
+import org.junit.*;
+/**
+ * Unit test for the {@link TurnRestrictionLegEditor}
+ * 
+ */
+class TurnRestrictionLegEditorUnitTest extends GroovyTestCase {
+	final shouldFail = new GroovyTestCase().&shouldFail
+	
+	def navigationControlerMock = [
+       gotoBasicEditor:{}, 
+       gotoAdvancedEditor: {}
+	] as NavigationControler
+	
+	private DataSet ds
+	private OsmDataLayer layer
+	private TurnRestrictionEditorModel model 
+	
+	@Before
+	public void setUp() {
+		JOSMFixture.createUnitTestFixture().init()
+		
+		ds = new DataSet()
+		layer = new OsmDataLayer(ds, "test", null)		
+		model = new TurnRestrictionEditorModel(layer, navigationControlerMock);
+	}
+	 
+	@Test
+	public void test_Constructor() {
+		
+		TurnRestrictionLegEditor editor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.FROM)
+		
+		assert editor.getModel() == model
+		assert editor.getRole() == TurnRestrictionLegRole.FROM
+		
+		shouldFail(IllegalArgumentException) {
+			editor = new TurnRestrictionLegEditor(null, TurnRestrictionLegRole.FROM)
+		}
+
+		shouldFail(IllegalArgumentException) {
+			editor = new TurnRestrictionLegEditor(model, null)
+		}
+	}
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRendererTest.groovy
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRendererTest.groovy	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRendererTest.groovy	(revision 23510)
@@ -0,0 +1,42 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import static org.junit.Assert.*;
+import org.junit.*;
+
+import groovy.util.GroovyTestCase;
+
+import java.awt.Component
+import org.openstreetmap.josm.plugins.turnrestrictions.fixtures.JOSMFixture;
+
+class TurnRestrictionTypeRendererTest extends GroovyTestCase{
+
+	@Before
+	public void setUp() {
+		JOSMFixture.createUnitTestFixture().init()			
+	}
+	
+	@Test
+	public void test_Constructor() {
+		TurnRestrictionTypeRenderer renderer = new TurnRestrictionTypeRenderer();
+		
+		assert renderer.@icons != null
+		assert renderer.@icons.get(TurnRestrictionType.NO_LEFT_TURN) != null
+	}
+	
+	@Test
+	public void test_getListCellRendererComponent_1() {
+		TurnRestrictionTypeRenderer renderer = new TurnRestrictionTypeRenderer();
+		
+		def c = renderer.getListCellRendererComponent(null, null, 0, false, false)		
+		assert c.getIcon() == null
+		assert c.getText() != null
+		
+		c = renderer.getListCellRendererComponent(null, "non-standard-value", 0, false, false)		
+		assert c.getIcon() == null
+		assert c.getText() == "non-standard-value"	
+
+		c = renderer.getListCellRendererComponent(null, TurnRestrictionType.NO_LEFT_TURN, 0, false, false)		
+		assert c.getIcon() == renderer.@icons.get(TurnRestrictionType.NO_LEFT_TURN)
+		assert c.getText() == TurnRestrictionType.NO_LEFT_TURN.getDisplayName()
+	}
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeTest.groovy
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeTest.groovy	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeTest.groovy	(revision 23510)
@@ -0,0 +1,20 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+import groovy.util.GroovyTestCase;
+
+import static org.junit.Assert.*;
+import org.junit.*
+class TurnRestrictionTypeTest extends GroovyTestCase{
+	
+	@Test
+	public void test_fromTagValue() {
+		
+		TurnRestrictionType type = TurnRestrictionType.fromTagValue("no_left_turn")
+		assert type == TurnRestrictionType.NO_LEFT_TURN
+		
+		type = TurnRestrictionType.fromTagValue("doesnt_exist")
+		assert type == null
+		
+		type = TurnRestrictionType.fromTagValue(null)
+		assert type == null
+	}
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditorTest.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditorTest.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditorTest.java	(revision 23510)
@@ -0,0 +1,60 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+
+import javax.swing.JFrame;
+
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.tagging.TagModel;
+
+/**
+ * Simple test application to test the vehicle exception editor
+ * 
+ */
+public class VehicleExceptionEditorTest extends JFrame {
+    TurnRestrictionEditorModel model;
+    OsmDataLayer layer;
+    VehicleExceptionEditor editor;
+    
+    protected void build() {
+        Container c = getContentPane();
+        c.setLayout(new BorderLayout());
+        layer = new OsmDataLayer(new DataSet(), "test", null);
+
+        model = new TurnRestrictionEditorModel(layer, new MockNavigationControler());       
+        editor = new VehicleExceptionEditor(model);
+        c.add(editor, BorderLayout.CENTER);
+        
+        model.getTagEditorModel().add(new TagModel("except", "non-standard-value"));
+    }
+    
+    public VehicleExceptionEditorTest(){
+        build();
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
+        setSize(500,500);       
+    }
+    
+    public static void main(String args[]){
+        new VehicleExceptionEditorTest().setVisible(true);
+    }
+    
+    static private class MockNavigationControler implements NavigationControler{
+
+        public void gotoAdvancedEditor() {
+            // TODO Auto-generated method stub
+            
+        }
+
+        public void gotoBasicEditor() {
+            // TODO Auto-generated method stub
+            
+        }
+
+        public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            // TODO Auto-generated method stub
+            
+        }
+    }
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListTest.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListTest.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListTest.java	(revision 23510)
@@ -0,0 +1,86 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.editor;
+
+import java.awt.Container;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.DefaultListSelectionModel;
+import javax.swing.JFrame;
+import javax.swing.JList;
+
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+
+/**
+ * Simple test application to test the via list editor
+ *
+ */
+public class ViaListTest  extends JFrame{
+    
+    private ViaList lstVias;
+    private TurnRestrictionEditorModel model;
+    private JList lstJOSMSelection;
+    
+    
+    protected void build() {
+        DataSet ds = new DataSet();
+        OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
+
+            public void gotoBasicEditor() {
+            }
+
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        model = new TurnRestrictionEditorModel(layer, controler);
+        Container c = getContentPane();
+        
+        c.setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.insets = new Insets(5,5,5,20);
+        gc.fill = GridBagConstraints.BOTH;
+        gc.weightx = 0.5;
+        gc.weighty = 1.0;
+        
+        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
+        c.add(lstVias = new ViaList(new ViaListModel(model, selectionModel), selectionModel), gc);
+        
+        gc.gridx = 1;
+        c.add(lstJOSMSelection = new JList(), gc);
+        
+        setSize(600,600);       
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
+    }
+    
+    protected void initTest1() {
+        DataSet ds = new DataSet();
+        Relation r = new Relation();
+        Node n;
+        for (int i = 1; i<10; i++){
+            n = new Node(new LatLon(i,i));  
+            n.put("name", "node." + i);
+            ds.addPrimitive(n);
+            r.addMember(new RelationMember("via",n));
+        }       
+        model.populate(r);
+    }
+    
+    public ViaListTest() {
+        build();        
+        initTest1();
+    }
+    
+    static public void main(String args[]) {
+        new ViaListTest().setVisible(true);
+    }
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/fixtures/JOSMFixture.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/fixtures/JOSMFixture.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/fixtures/JOSMFixture.java	(revision 23510)
@@ -0,0 +1,76 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.fixtures;
+
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Preferences;
+import org.openstreetmap.josm.data.projection.Mercator;
+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-unit-env.properties");
+    }
+
+    private Properties testProperties;
+    private String testPropertiesResourceName;
+
+    public JOSMFixture(String testPropertiesResourceName) {
+        this.testPropertiesResourceName = testPropertiesResourceName;
+    }
+
+    public void init() {
+        testProperties = new Properties();
+     
+        // load properties
+        //
+        try {
+            testProperties.load(JOSMFixture.class.getResourceAsStream(testPropertiesResourceName));
+        } catch(Exception e){
+            logger.log(Level.SEVERE, MessageFormat.format("failed to load property file ''{0}''", testPropertiesResourceName));
+            fail(MessageFormat.format("failed to load property file ''{0}''. \nMake sure the path ''$project_root/test/config'' is on the classpath.", testPropertiesResourceName));
+        }
+
+        // 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.\nEdit ''{2}'' and update the value ''josm.home''. ", "josm.home", josmHome,testPropertiesResourceName ));
+            }
+        }
+        System.setProperty("josm.home", josmHome);
+        Main.pref = new Preferences();
+        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.proj = new 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")) {
+            fail(MessageFormat.format("configured server url ''{0}'' seems to be a productive url, aborting.", url));
+        }
+    }
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesViewTest.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesViewTest.java	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesViewTest.java	(revision 23510)
@@ -0,0 +1,65 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.qa;
+
+import java.awt.Container;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JFrame;
+import javax.swing.JScrollPane;
+
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.plugins.turnrestrictions.editor.NavigationControler;
+import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditorModel;
+
+/**
+ * Simple test application for layout and functionality of the issues view.
+ */
+public class IssuesViewTest extends JFrame {
+    private IssuesModel model;
+    
+    protected void build() {
+        Container c = getContentPane();
+        c.setLayout(new GridBagLayout());
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
+
+            public void gotoBasicEditor() {
+            }
+
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        OsmDataLayer layer = new OsmDataLayer(new DataSet(), "test", null);
+        TurnRestrictionEditorModel editorModel = new TurnRestrictionEditorModel(layer, controler);
+        model = new IssuesModel(editorModel);
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.BOTH;
+        gc.weightx = 1.0;
+        gc.weighty = 1.0;
+        JScrollPane pane = new JScrollPane(new IssuesView(model));
+        pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+        c.add(pane, gc);
+        
+        List<Issue> issues = new ArrayList<Issue>();
+        issues.add(new RequiredTagMissingError(model, "type", "restriction"));
+        issues.add(new MissingRestrictionTypeError(model));
+        model.populate(issues);
+    }
+    
+    public IssuesViewTest() {
+        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        setSize(400,600);
+        build();
+    }
+    
+    public static void main(String args[]) {
+        new IssuesViewTest().setVisible(true);
+    }
+}
Index: applications/editors/josm/plugins/turnrestrictions/test/test.xml
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/test/test.xml	(revision 23510)
+++ applications/editors/josm/plugins/turnrestrictions/test/test.xml	(revision 23510)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="turnrestrictions-test">
+
+	
+</project>
