Search in sources :

Example 31 with TestSubprocessExecutionContext

use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.

the class GitTestRepo method addFileAndAmend.

public List<Modification> addFileAndAmend(String fileName, String message) throws IOException {
    File newFile = new File(gitRepo, fileName);
    newFile.createNewFile();
    new GitCommand(null, gitRepo, GitMaterialConfig.DEFAULT_BRANCH, false, null).add(newFile);
    new GitCommandWithAmend(null, gitRepo, GitMaterialConfig.DEFAULT_BRANCH, false, new HashMap<>()).commitWithAmend(message, gitRepo);
    return createMaterial().latestModification(createRandomTempDirectory().toFile(), new TestSubprocessExecutionContext());
}
Also used : HashMap(java.util.HashMap) TestSubprocessExecutionContext(com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext) File(java.io.File)

Aggregations

TestSubprocessExecutionContext (com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext)31 Test (org.junit.jupiter.api.Test)21 File (java.io.File)13 Modification (com.thoughtworks.go.domain.materials.Modification)10 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)8 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)6 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)5 StringRevision (com.thoughtworks.go.domain.materials.mercurial.StringRevision)5 Test (org.junit.Test)5 MaterialRevisionsMatchers.containsModifiedFile (com.thoughtworks.go.config.MaterialRevisionsMatchers.containsModifiedFile)4 Materials (com.thoughtworks.go.config.materials.Materials)4 TfsCommand (com.thoughtworks.go.domain.materials.tfs.TfsCommand)3 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)2 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)2 Material (com.thoughtworks.go.domain.materials.Material)2 RevisionContext (com.thoughtworks.go.domain.materials.RevisionContext)2 ValidationBean (com.thoughtworks.go.domain.materials.ValidationBean)2 MaterialRepository (com.thoughtworks.go.server.persistence.MaterialRepository)2 MaterialService (com.thoughtworks.go.server.service.MaterialService)2 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)2