Fix broken submit tests

The test for submitting whole topic on multiple branches was broken in
several ways:

- It was resetting the "dev" branch using the initial head of the default
  test project, rather than that of the specifically created project.

- The base revision of the created "dev" branch was not specified, so it
  was not clear where it was being created from.

- The call to the API to create the "dev" branch was done without using
  the properly namespaced project name.

Fix all of these problems.

Also, when running the whole suite of tests under Java 7 some of them
failed, while the same tests passed when running individually. The root
cause of this is not yet known, but it would seem that the tests are
somehow interfering with each other.

Annotate the AbstractSubmit class with @Sandboxed so that each test is
run on a separate server instance. This makes the tests somewhat slower,
but makes sure they don't interfere with each other any more.

Change-Id: I2728106fce71d239b09572928b0f7489b96cdc64
diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java
index aad35f4..56dfa21 100644
--- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java
+++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java
@@ -32,6 +32,7 @@
 import com.google.gerrit.acceptance.AbstractDaemonTest;
 import com.google.gerrit.acceptance.PushOneCommit;
 import com.google.gerrit.acceptance.RestResponse;
+import com.google.gerrit.acceptance.Sandboxed;
 import com.google.gerrit.acceptance.TestProjectInput;
 import com.google.gerrit.common.EventListener;
 import com.google.gerrit.common.EventSource;
@@ -85,6 +86,7 @@
 import java.util.List;
 import java.util.Map;
 
+@Sandboxed
 public abstract class AbstractSubmit extends AbstractDaemonTest {
   @ConfigSuite.Config
   public static Config submitWholeTopicEnabled() {
@@ -186,13 +188,17 @@
     String topic = "test-topic";
 
     // Create test project
+    String projectName = "project-a";
     TestRepository<?> repoA = createProjectWithPush(
-        "project-a", null, getSubmitType());
+        projectName, null, getSubmitType());
+
+    RevCommit initialHead =
+        getRemoteHead(new Project.NameKey(name(projectName)), "master");
 
     // Create the dev branch on the test project
     BranchInput in = new BranchInput();
-    gApi.projects().name(name("project-a")).branch("dev").create(in);
-    RevCommit initialHead = getRemoteHead(project, "master");
+    in.revision = initialHead.name();
+    gApi.projects().name(name(projectName)).branch("dev").create(in);
 
     // Create changes on master
     PushOneCommit.Result change1 =