Index: /trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java	(revision 14541)
+++ /trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java	(revision 14542)
@@ -130,6 +130,13 @@
         if (!isEnabled())
             return;
-
-        DataSet ds = getLayerManager().getEditDataSet();
+        runOn(getLayerManager().getEditDataSet());
+    }
+
+    /**
+     * Run the action on the given dataset.
+     * @param ds dataset
+     * @since 14542
+     */
+    public static void runOn(DataSet ds) {
         Collection<OsmPrimitive> sel = ds.getSelected();
         List<Node> nodes = OsmPrimitive.getFilteredList(sel, Node.class);
Index: /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 14541)
+++ /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 14542)
@@ -26,4 +26,5 @@
 import org.openstreetmap.josm.command.SplitWayCommand;
 import org.openstreetmap.josm.data.UndoRedoHandler;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.Node;
@@ -66,4 +67,13 @@
     @Override
     public void actionPerformed(ActionEvent e) {
+        runOn(getLayerManager().getEditDataSet());
+    }
+
+    /**
+     * Run the action on the given dataset.
+     * @param ds dataset
+     * @since 14542
+     */
+    public static void runOn(DataSet ds) {
 
         if (SegmentToKeepSelectionDialog.DISPLAY_COUNT.get() > 0) {
@@ -73,5 +83,5 @@
         }
 
-        Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
+        Collection<OsmPrimitive> selection = ds.getSelected();
 
         List<Node> selectedNodes = OsmPrimitive.getFilteredList(selection, Node.class);
@@ -284,5 +294,5 @@
         List<? extends PrimitiveId> newSel = result.getNewSelection();
         if (newSel != null && !newSel.isEmpty()) {
-            MainApplication.getLayerManager().getEditDataSet().setSelected(newSel);
+            way.getDataSet().setSelected(newSel);
         }
     }
Index: /trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 14541)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 14542)
@@ -17,6 +17,4 @@
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.GeoProperty;
@@ -38,5 +36,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().main();
+    public JOSMTestRules test = new JOSMTestRules().projection();
 
     /**
@@ -49,5 +47,4 @@
     public void testTicket7421case0() throws ReflectiveOperationException {
         DataSet dataSet = new DataSet();
-        OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
 
         Node n1 = new Node(new EastNorth(0, 0));
@@ -64,13 +61,5 @@
         dataSet.addSelected(w);
 
-        CreateCircleAction action = new CreateCircleAction();
-        action.setEnabled(true);
-        try {
-            MainApplication.getLayerManager().addLayer(layer);
-            action.actionPerformed(null);
-        } finally {
-            // Ensure we clean the place before leaving, even if test fails.
-            MainApplication.getLayerManager().removeLayer(layer);
-        }
+        CreateCircleAction.runOn(dataSet);
 
         // Expected result: Dataset contain one closed way, clockwise
@@ -115,5 +104,4 @@
     public void testTicket7421case1() throws ReflectiveOperationException {
         DataSet dataSet = new DataSet();
-        OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
 
         Node n1 = new Node(new EastNorth(0, 0));
@@ -135,13 +123,5 @@
 
         try {
-            CreateCircleAction action = new CreateCircleAction();
-            action.setEnabled(true);
-            try {
-                MainApplication.getLayerManager().addLayer(layer);
-                action.actionPerformed(null);
-            } finally {
-                // Ensure we clean the place before leaving, even if test fails.
-                MainApplication.getLayerManager().removeLayer(layer);
-            }
+            CreateCircleAction.runOn(dataSet);
 
             // Expected result: Dataset contain one closed way, clockwise
Index: /trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java	(revision 14541)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java	(revision 14542)
@@ -7,5 +7,4 @@
 import java.util.Arrays;
 
-import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -14,6 +13,4 @@
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -25,7 +22,4 @@
 public final class SplitWayActionTest {
 
-    /** Class under test. */
-    private static SplitWayAction action;
-
     /**
      * Setup test.
@@ -33,16 +27,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
-    /**
-     * Setup test.
-     */
-    @Before
-    public void setUp() {
-        if (action == null) {
-            action = MainApplication.getMenu().splitWay;
-            action.setEnabled(true);
-        }
-    }
+    public JOSMTestRules test = new JOSMTestRules().projection();
 
     /**
@@ -53,5 +36,4 @@
     public void testTicket11184() {
         DataSet dataSet = new DataSet();
-        OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
 
         Node n1 = new Node(new EastNorth(0, 0));
@@ -81,11 +63,5 @@
         dataSet.addSelected(w2);
 
-        try {
-            MainApplication.getLayerManager().addLayer(layer);
-            action.actionPerformed(null);
-        } finally {
-            // Ensure we clean the place before leaving, even if test fails.
-            MainApplication.getLayerManager().removeLayer(layer);
-        }
+        SplitWayAction.runOn(dataSet);
 
         // Ensures 3 ways.
