Bug fix: Create missing dir.
diff --git a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/AbstractJavaSDTest.java b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/AbstractJavaSDTest.java
index 0a18f8a..80a58fd 100644
--- a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/AbstractJavaSDTest.java
+++ b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/AbstractJavaSDTest.java
@@ -23,6 +23,18 @@
 
 	private IProject project;
 
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		emptyProjectDir("bin");
+	}
+
+	@Override
+	protected void tearDown() throws Exception {
+		super.tearDown();
+		emptyProjectDir("bin");
+	}
+
 	protected AbstractJavaSDTest(String projectName) throws Exception {
 		IProjectDescription description = ResourcesPlugin.getWorkspace().loadProjectDescription(new Path(SDActivator.getAbsoluteDir(TEST_PROJECTS_DIR + projectName) + ".project"));
 		project = ResourcesPlugin.getWorkspace().getRoot().getProject(description.getName());
@@ -117,7 +129,8 @@
 	}
 
 	/**
-	 * Remove all entries of a directory. The directory itself will not be deleted.
+	 * Remove all entries of a directory. The directory itself will not be
+	 * deleted.
 	 * 
 	 * @param relativePath
 	 * @return <code>true</code> if successful
@@ -130,12 +143,13 @@
 		return true;
 	}
 
-	private String getProjectFilePath(String relativePath) {
+	protected String getProjectFilePath(String relativePath) {
 		return SDActivator.getAbsoluteDir(TEST_PROJECTS_DIR + project.getName() + "/" + relativePath);
 	}
 
 	/**
-	 * Delete a file or or folder. In case of a directory, all entries need to be deleted first.
+	 * Delete a file or or folder. In case of a directory, all entries need to be
+	 * deleted first.
 	 * 
 	 * @param file
 	 *          a file or a directory
diff --git a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/GenNotOverrideTest.java b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/GenNotOverrideTest.java
index ae0ba0f..735b0b7 100644
--- a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/GenNotOverrideTest.java
+++ b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/GenNotOverrideTest.java
@@ -28,12 +28,6 @@
 		doGenerate("/bin/GenNotOverride/my_SD/SDModel.class");
 	}
 
-	@Override
-	protected void tearDown() throws Exception {
-		super.tearDown();
-		emptyProjectDir("bin");
-	}
-
 	/**
 	 * Methods with "generated NOT" annotations must <emph>not</emph> be overwritten by the code generator.
 	 * 
diff --git a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/XPandCodeGenTest.java b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/XPandCodeGenTest.java
index e83d6d9..b88434e 100644
--- a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/XPandCodeGenTest.java
+++ b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.sd.gen/test/org/eclipse/amp/amf/sd/gen/builder/XPandCodeGenTest.java
@@ -1,15 +1,18 @@
 package org.eclipse.amp.amf.sd.gen.builder;
 
+import java.io.File;
 import java.io.IOException;
 
 import org.eclipse.amp.escape.runtime.extension.IAgentChild;
 import org.eclipse.core.runtime.CoreException;
 
 /**
- * Check basic code generation issues. Are system dynamic Java classes being generated? The tests in this class are very
- * fragmentary. If there's a better way to test this, please go ahead.
+ * Check basic code generation issues. Are system dynamic Java classes being
+ * generated? The tests in this class are very fragmentary. If there's a better
+ * way to test this, please go ahead.
  * <p/>
- * Usually, you'll need to increase PermGenSpace to run this test! Use <code>-XX:MaxPermSize=128m</code> as VM argument.
+ * Usually, you'll need to increase PermGenSpace to run this test! Use
+ * <code>-XX:MaxPermSize=128m</code> as VM argument.
  * 
  * @author fei
  */
@@ -40,8 +43,12 @@
 	@Override
 	protected void setUp() throws Exception {
 		super.setUp();
+		String projectFilePath = getProjectFilePath("");
+		File dir = new File(projectFilePath, "srcgen");
+		if (!dir.exists()) {
+			dir.mkdir();
+		}
 		emptyProjectDir("srcgen");
-		emptyProjectDir("bin");
 
 		String[] expectedFilesToBeGenerated = new String[javaFiles.length * 2];
 		for (int i = 0; i < javaFiles.length; i++) {
@@ -58,7 +65,6 @@
 	protected void tearDown() throws Exception {
 		super.tearDown();
 		emptyProjectDir("srcgen");
-		emptyProjectDir("bin");
 	}
 
 	public void testMy() throws IOException, CoreException {