Completed test migration to junit4, easymock updated to version 3.2
Change-Id: I6381045b3dae7133cc3589c5dd20ed977118a83d
This commit is contained in:

committed by
Shawn Pearce

parent
c8cffc8e92
commit
d215908bae
@@ -67,6 +67,7 @@ public class GarbageCollectionIT extends AbstractDaemonTest {
|
||||
|
||||
project2 = new Project.NameKey("p2");
|
||||
createProject(sshSession, project2.get());
|
||||
sshSession.close();
|
||||
|
||||
session = new RestSession(server, admin);
|
||||
}
|
||||
|
@@ -74,6 +74,7 @@ public class GetChildProjectIT extends AbstractDaemonTest {
|
||||
createProject(sshSession, p1.get());
|
||||
Project.NameKey p2 = new Project.NameKey("p2");
|
||||
createProject(sshSession, p2.get());
|
||||
sshSession.close();
|
||||
assertEquals(HttpStatus.SC_NOT_FOUND,
|
||||
GET("/projects/" + p1.get() + "/children/" + p2.get()).getStatusCode());
|
||||
}
|
||||
@@ -83,6 +84,7 @@ public class GetChildProjectIT extends AbstractDaemonTest {
|
||||
SshSession sshSession = new SshSession(server, admin);
|
||||
Project.NameKey child = new Project.NameKey("p1");
|
||||
createProject(sshSession, child.get());
|
||||
sshSession.close();
|
||||
RestResponse r = GET("/projects/" + allProjects.get() + "/children/" + child.get());
|
||||
assertEquals(HttpStatus.SC_OK, r.getStatusCode());
|
||||
ProjectInfo childInfo =
|
||||
@@ -98,6 +100,7 @@ public class GetChildProjectIT extends AbstractDaemonTest {
|
||||
createProject(sshSession, child.get());
|
||||
Project.NameKey grandChild = new Project.NameKey("p1.1");
|
||||
createProject(sshSession, grandChild.get(), child);
|
||||
sshSession.close();
|
||||
assertEquals(HttpStatus.SC_NOT_FOUND,
|
||||
GET("/projects/" + allProjects.get() + "/children/" + grandChild.get())
|
||||
.getStatusCode());
|
||||
@@ -111,6 +114,7 @@ public class GetChildProjectIT extends AbstractDaemonTest {
|
||||
createProject(sshSession, child.get());
|
||||
Project.NameKey grandChild = new Project.NameKey("p1.1");
|
||||
createProject(sshSession, grandChild.get(), child);
|
||||
sshSession.close();
|
||||
RestResponse r =
|
||||
GET("/projects/" + allProjects.get() + "/children/" + grandChild.get()
|
||||
+ "?recursive");
|
||||
|
@@ -99,6 +99,7 @@ public class ListBranchesIT extends AbstractDaemonTest {
|
||||
|
||||
@After
|
||||
public void cleanup() {
|
||||
sshSession.close();
|
||||
db.close();
|
||||
}
|
||||
|
||||
|
@@ -84,6 +84,7 @@ public class ListChildProjectsIT extends AbstractDaemonTest {
|
||||
Project.NameKey child2 = new Project.NameKey("p2");
|
||||
createProject(sshSession, child2.get());
|
||||
createProject(sshSession, "p1.1", child1);
|
||||
sshSession.close();
|
||||
|
||||
RestResponse r = GET("/projects/" + allProjects.get() + "/children/");
|
||||
assertEquals(HttpStatus.SC_OK, r.getStatusCode());
|
||||
@@ -107,6 +108,7 @@ public class ListChildProjectsIT extends AbstractDaemonTest {
|
||||
createProject(sshSession, child1_1_1.get(), child1_1);
|
||||
Project.NameKey child1_1_1_1 = new Project.NameKey("p1.1.1.1");
|
||||
createProject(sshSession, child1_1_1_1.get(), child1_1_1);
|
||||
sshSession.close();
|
||||
|
||||
RestResponse r = GET("/projects/" + child1.get() + "/children/?recursive");
|
||||
assertEquals(HttpStatus.SC_OK, r.getStatusCode());
|
||||
|
@@ -35,6 +35,7 @@ import com.google.inject.Inject;
|
||||
|
||||
import com.jcraft.jsch.JSchException;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -83,6 +84,11 @@ public class GarbageCollectionIT extends AbstractDaemonTest {
|
||||
createProject(sshSession, project3.get());
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanup() {
|
||||
sshSession.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@UseLocalDisk
|
||||
public void testGc() throws JSchException, IOException {
|
||||
@@ -110,6 +116,7 @@ public class GarbageCollectionIT extends AbstractDaemonTest {
|
||||
SshSession s = new SshSession(server, accounts.create("user", "user@example.com", "User"));
|
||||
s.exec("gerrit gc --all");
|
||||
assertError("Capability runGC is required to access this resource", s.getError());
|
||||
s.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user