Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 11858)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 11859)
@@ -15,4 +15,5 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.projection.CustomProjection;
+import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -25,6 +26,6 @@
 public class TemplatedWMSTileSourceTest {
 
-    private ImageryInfo testImageryWMS = new ImageryInfo("test imagery", "http://localhost", "wms", null, null);
-    private ImageryInfo testImageryTMS = new ImageryInfo("test imagery", "http://localhost", "tms", null, null);
+    private final ImageryInfo testImageryWMS = new ImageryInfo("test imagery", "http://localhost", "wms", null, null);
+    private final ImageryInfo testImageryTMS = new ImageryInfo("test imagery", "http://localhost", "tms", null, null);
 
     /**
@@ -40,6 +41,7 @@
     @Test
     public void testEPSG3857() {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
-        TemplatedWMSTileSource source = new TemplatedWMSTileSource(testImageryWMS);
+        Projection projection = Projections.getProjectionByCode("EPSG:3857");
+        Main.setProjection(projection);
+        TemplatedWMSTileSource source = new TemplatedWMSTileSource(testImageryWMS, projection);
         verifyMercatorTile(source, 0, 0, 1);
         verifyMercatorTile(source, 0, 0, 2);
@@ -64,6 +66,7 @@
     @Test
     public void testEPSG4326() {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:4326"));
-        TemplatedWMSTileSource source = getSource();
+        Projection projection = Projections.getProjectionByCode("EPSG:4326");
+        Main.setProjection(projection);
+        TemplatedWMSTileSource source = getSource(projection);
 
         verifyLocation(source, new LatLon(53.5937132, 19.5652017));
@@ -79,6 +82,7 @@
     @Test
     public void testEPSG4326widebounds() {
-        Main.setProjection(new CustomProjection("+proj=lonlat +datum=WGS84 +axis=neu +bounds=-180,53,180,54"));
-        TemplatedWMSTileSource source = getSource();
+        Projection projection = new CustomProjection("+proj=lonlat +datum=WGS84 +axis=neu +bounds=-180,53,180,54");
+        Main.setProjection(projection);
+        TemplatedWMSTileSource source = getSource(projection);
 
         verifyLocation(source, new LatLon(53.5937132, 19.5652017));
@@ -91,6 +95,7 @@
     @Test
     public void testEPSG4326narrowbounds() {
-        Main.setProjection(new CustomProjection("+proj=lonlat +datum=WGS84 +axis=neu +bounds=18,-90,20,90"));
-        TemplatedWMSTileSource source = getSource();
+        Projection projection = new CustomProjection("+proj=lonlat +datum=WGS84 +axis=neu +bounds=18,-90,20,90");
+        Main.setProjection(projection);
+        TemplatedWMSTileSource source = getSource(projection);
 
         verifyLocation(source, new LatLon(53.5937132, 19.5652017));
@@ -103,6 +108,7 @@
     @Test
     public void testEPSG2180() {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:2180"));
-        TemplatedWMSTileSource source = getSource();
+        Projection projection = Projections.getProjectionByCode("EPSG:2180");
+        Main.setProjection(projection);
+        TemplatedWMSTileSource source = getSource(projection);
 
         verifyLocation(source, new LatLon(53.5937132, 19.5652017));
@@ -119,8 +125,9 @@
     @Test
     public void testEPSG3006withbounds() {
-        Main.setProjection(
+        Projection projection =
                 new CustomProjection("+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "
-                        + "+units=m +no_defs +axis=neu +wmssrs=EPSG:3006 +bounds=10.5700,55.2000,24.1800,69.1000 "));
-        TemplatedWMSTileSource source = getSource();
+                        + "+units=m +no_defs +axis=neu +wmssrs=EPSG:3006 +bounds=10.5700,55.2000,24.1800,69.1000 ");
+        Main.setProjection(projection);
+        TemplatedWMSTileSource source = getSource(projection);
 
         verifyTileSquarness(source, 0, 1, 4);
@@ -134,8 +141,9 @@
     @Test
     public void testEPSG3006withoutbounds() {
-        Main.setProjection(
+        Projection projection =
                 new CustomProjection("+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "
-                        + "+units=m +no_defs +axis=neu +wmssrs=EPSG:3006"));
-        TemplatedWMSTileSource source = getSource();
+                        + "+units=m +no_defs +axis=neu +wmssrs=EPSG:3006");
+        Main.setProjection(projection);
+        TemplatedWMSTileSource source = getSource(projection);
 
         verifyTileSquarness(source, 0, 1, 4);
@@ -236,6 +244,6 @@
     }
 
-    private TemplatedWMSTileSource getSource() {
-        return new TemplatedWMSTileSource(testImageryWMS);
+    private TemplatedWMSTileSource getSource(Projection projection) {
+        return new TemplatedWMSTileSource(testImageryWMS, projection);
     }
 }
