Use static methods in static way.

Change-Id: I49af39f44f494a6053b75f6637b02a5826f241ce
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/buildpath/BuildpathTests.java b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/buildpath/BuildpathTests.java
index 8a34c4b..4029a97 100644
--- a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/buildpath/BuildpathTests.java
+++ b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/buildpath/BuildpathTests.java
@@ -24,6 +24,7 @@
 import org.eclipse.dltk.core.IScriptProject;
 import org.eclipse.dltk.core.environment.EnvironmentManager;
 import org.eclipse.dltk.core.environment.EnvironmentPathUtils;
+import org.eclipse.dltk.core.tests.model.AbstractModelTests;
 import org.eclipse.dltk.core.tests.model.ModifyingResourceTests;
 import org.eclipse.dltk.internal.core.BuildpathEntry;
 import org.eclipse.dltk.python.core.PythonNature;
@@ -166,7 +167,7 @@
 			// ((ScriptProject)proj).printNode(printer);
 			printer.flush();
 		} finally {
-			this.deleteProject("P");
+			AbstractModelTests.deleteProject("P");
 		}
 	}
 }
diff --git a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/CopyMoveElementsTests.java b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/CopyMoveElementsTests.java
index 1ff445b..91e1a7b 100644
--- a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/CopyMoveElementsTests.java
+++ b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/CopyMoveElementsTests.java
@@ -22,6 +22,7 @@
 import org.eclipse.dltk.core.ISourceModule;
 import org.eclipse.dltk.core.IType;
 import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.core.tests.model.AbstractModelTests;
 import org.eclipse.dltk.core.tests.model.CopyMoveTests;
 import org.eclipse.dltk.python.core.PythonNature;
 import org.eclipse.dltk.python.tests.PythonTestsPlugin;
@@ -82,13 +83,13 @@
  */
 @Override
 public void tearDown() throws Exception {
-	this.deleteProject("P");
+	AbstractModelTests.deleteProject("P");
 
 	super.tearDown();
 }
 @Override
 public void tearDownSuite() throws Exception {
-	this.deleteProject("BinaryProject");
+	AbstractModelTests.deleteProject("BinaryProject");
 	super.tearDownSuite();
 }
 //TODO: Implement or drop BinaryField tests
@@ -172,7 +173,7 @@
 		copyPositive(methodSource, typeDest, null, null, false);
 
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -246,7 +247,7 @@
 
 		copyPositive(fieldSource, typeDest, null, null, true);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -273,7 +274,7 @@
 
 		copyPositive(fieldSource, typeDest, null, null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -349,7 +350,7 @@
 
 		copyPositive(fieldSource, typeDest, null, "bar", true);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -377,7 +378,7 @@
 
 		copyPositive(fieldSource, typeDest, null, "bar", false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -508,7 +509,7 @@
 		assertTrue("Copy should exist", copy.exists());
 	} finally {
 		stopDeltas();
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -561,7 +562,7 @@
 
 		copyNegative(fieldSource, typeDest, null, null, false, IModelStatusConstants.NAME_COLLISION);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -600,7 +601,7 @@
 
 		copyNegative(fieldSource, cf.getType("X"), null, null, false, IModelStatusConstants.INVALID_DESTINATION);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -663,7 +664,7 @@
 			false,
 			IModelStatusConstants.INVALID_SIBLING);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -715,7 +716,7 @@
 
 		copyPositive(fieldSource, typeDest, typeDest.getField("bar"), null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /*
@@ -936,7 +937,7 @@
 
 		copyPositive(typeSource,  typeDest, typeDest.getMethod("foo"), null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 ///**
@@ -1006,7 +1007,7 @@
 
 		copyPositive(typeSource,  cuDest, null, null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1081,7 +1082,7 @@
 
 		copyPositive(methodSource, typeDest, null, null, true);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1108,7 +1109,7 @@
 
 		copyPositive(methodSource, typeDest, null, null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1184,7 +1185,7 @@
 
 		copyPositive(methodSource, typeDest, null, "bar", true);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1212,7 +1213,7 @@
 
 		copyPositive(methodSource, typeDest, null, "bar", false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1281,7 +1282,7 @@
 
 		copyNegative(methodSource, typeDest, null, null, false, IModelStatusConstants.NAME_COLLISION);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1325,7 +1326,7 @@
 
 		copyNegative(methodSource, methodDest, null, null, false, IModelStatusConstants.INVALID_DESTINATION);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1353,7 +1354,7 @@
 
 		copyPositive(methodSource, typeDest, typeDest.getMethod("bar"), null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1423,7 +1424,7 @@
 
 		copyPositive(methodSource, typeDest, null, null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1472,7 +1473,7 @@
 
 		copyPositive(typeSource,  cuDest, null, null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1499,7 +1500,7 @@
 
 		copyPositive(typeSource,  cuDest, cuDest.getType("Y"), null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1560,7 +1561,7 @@
 			"Constructor was not renamed",
 			typeDest.getMethod("Y").exists());
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1634,7 +1635,7 @@
 
 		movePositive(fieldSource, typeDest, null, null, true);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1661,7 +1662,7 @@
 
 		movePositive(fieldSource, typeDest, null, null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1737,7 +1738,7 @@
 
 		movePositive(fieldSource, typeDest, null, "bar", true);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1765,7 +1766,7 @@
 
 		movePositive(fieldSource, typeDest, null, "bar", false);
 	} finally {
-		this.deleteProject("P2");
+			AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1795,7 +1796,7 @@
 
 		movePositive(fieldSource, typeDest, typeDest.getField("bar"), "fred", true);
 	} finally {
-		this.deleteProject("P2");
+			AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1863,7 +1864,7 @@
 
 		moveNegative(fieldSource, typeDest, null, null, false, IModelStatusConstants.NAME_COLLISION);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1902,7 +1903,7 @@
 
 		moveNegative(fieldSource, cf.getType("X"), null, null, false, IModelStatusConstants.INVALID_DESTINATION);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -1931,7 +1932,7 @@
 
 		movePositive(fieldSource, typeDest, typeDest.getField("bar"), null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 ////TODO: Implement initializers part2
@@ -2105,7 +2106,7 @@
 
 		movePositive(typeSource,  typeDest, typeDest.getMethod("foo"), "T", false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2134,7 +2135,7 @@
 
 		movePositive(typeSource,  typeDest, typeDest.getMethod("foo"), null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2233,7 +2234,7 @@
 
 		movePositive(methodSource, typeDest, null, null, true);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2260,7 +2261,7 @@
 
 		movePositive(methodSource, typeDest, null, null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2336,7 +2337,7 @@
 
 		movePositive(methodSource, typeDest, null, "bar", true);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2364,7 +2365,7 @@
 
 		movePositive(methodSource, typeDest, null, "bar", false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2393,7 +2394,7 @@
 
 		movePositive(methodSource, typeDest, typeDest.getMethod("bar"), "fred", false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2477,7 +2478,7 @@
 		}
 		assertTrue("Operation should have thrown an operation canceled exception", isCanceled);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2530,7 +2531,7 @@
 
 		moveNegative(methodSource, typeDest, null, null, false, IModelStatusConstants.NAME_COLLISION);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2574,7 +2575,7 @@
 
 		moveNegative(methodSource, methodDest, null, null, false, IModelStatusConstants.INVALID_DESTINATION);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2603,7 +2604,7 @@
 
 		movePositive(methodSource, typeDest, typeDest.getMethod("bar"), null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2653,7 +2654,7 @@
 
 		movePositive(methodSource, typeDest, null, null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2680,7 +2681,7 @@
 
 		movePositive(typeSource,  cuDest, cuDest.getType("Y"), "T", false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 /**
@@ -2707,7 +2708,7 @@
 
 		movePositive(typeSource,  cuDest, cuDest.getType("Y"), null, false);
 	} finally {
-		this.deleteProject("P2");
+		AbstractModelTests.deleteProject("P2");
 	}
 }
 }
diff --git a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/CopyMoveResourcesTests.java b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/CopyMoveResourcesTests.java
index 9c8fea6..1d7fcc3 100644
--- a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/CopyMoveResourcesTests.java
+++ b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/CopyMoveResourcesTests.java
@@ -21,6 +21,7 @@
 import org.eclipse.dltk.core.ISourceManipulation;
 import org.eclipse.dltk.core.ISourceModule;
 import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.core.tests.model.AbstractModelTests;
 import org.eclipse.dltk.core.tests.model.CopyMoveTests;
 import org.eclipse.dltk.python.core.PythonNature;
 import org.eclipse.dltk.python.tests.PythonTestsPlugin;
@@ -224,7 +225,7 @@
  */
 @Override
 public void tearDown() throws Exception {
-	this.deleteProject("P");
+	AbstractModelTests.deleteProject("P");
 
 	super.tearDown();
 }
diff --git a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/EncodingTests.java b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/EncodingTests.java
index 4dc9b37..0b2deae 100644
--- a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/EncodingTests.java
+++ b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/EncodingTests.java
@@ -30,6 +30,7 @@
 import org.eclipse.dltk.core.ISourceModule;
 import org.eclipse.dltk.core.ISourceReference;
 import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.core.tests.model.AbstractModelTests;
 import org.eclipse.dltk.core.tests.model.ModifyingResourceTests;
 import org.eclipse.dltk.internal.core.util.Util;
 import org.eclipse.dltk.python.core.PythonNature;
@@ -563,7 +564,7 @@
 			if (workingCopy != null) {
 				workingCopy.discardWorkingCopy();
 			}
-			this.deleteProject("P");
+			AbstractModelTests.deleteProject("P");
 		}
 
 	}
@@ -612,7 +613,7 @@
 			if (workingCopy != null) {
 				workingCopy.discardWorkingCopy();
 			}
-			this.deleteProject("P");
+			AbstractModelTests.deleteProject("P");
 		}
 	}
 
diff --git a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/WorkingCopyTests.java b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/WorkingCopyTests.java
index c473665..94a8d53 100644
--- a/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/WorkingCopyTests.java
+++ b/tests/org.eclipse.dltk.python.tests/src/org/eclipse/dltk/python/tests/model/WorkingCopyTests.java
@@ -20,6 +20,7 @@
 import org.eclipse.dltk.core.IType;
 import org.eclipse.dltk.core.ModelException;
 import org.eclipse.dltk.core.WorkingCopyOwner;
+import org.eclipse.dltk.core.tests.model.AbstractModelTests;
 import org.eclipse.dltk.core.tests.model.ModifyingResourceTests;
 import org.eclipse.dltk.core.tests.model.TestBuffer;
 import org.eclipse.dltk.python.core.PythonNature;
@@ -79,7 +80,7 @@
 	protected void tearDown() throws Exception {
 		if (this.copy != null)
 			this.copy.discardWorkingCopy();
-		this.deleteProject("P");
+		AbstractModelTests.deleteProject("P");
 		super.tearDown();
 	}