Merge "Document AbstractDaemonTest#projectInput"

This commit is contained in:
David Pursehouse 2018-04-18 15:18:58 +00:00 committed by Gerrit Code Review
commit 79ed9a7504

View File

@ -472,6 +472,7 @@ public abstract class AbstractDaemonTest {
return accountCreator.get(ann != null ? ann.cloneAs() : "admin");
}
/** Generate default project properties based on test description */
private ProjectInput projectInput(Description description) {
ProjectInput in = new ProjectInput();
TestProjectInput ann = description.getAnnotation(TestProjectInput.class);
@ -493,6 +494,15 @@ public abstract class AbstractDaemonTest {
return in;
}
/**
* Modify a project input before creating the initial test project.
*
* @param in input; may be modified in place.
*/
protected void updateProjectInput(ProjectInput in) {
// Default implementation does nothing.
}
private static final Pattern UNSAFE_PROJECT_NAME = Pattern.compile("[^a-zA-Z0-9._/-]+");
protected Git git() {
@ -545,15 +555,6 @@ public abstract class AbstractDaemonTest {
return new Project.NameKey(in.name);
}
/**
* Modify a project input before creating the initial test project.
*
* @param in input; may be modified in place.
*/
protected void updateProjectInput(ProjectInput in) {
// Default implementation does nothing.
}
protected TestRepository<InMemoryRepository> cloneProject(Project.NameKey p) throws Exception {
return cloneProject(p, admin);
}