Search in sources :

Example 11 with ArtifactPropertiesGenerator

use of com.thoughtworks.go.config.ArtifactPropertiesGenerator in project gocd by gocd.

the class ArtifactPropertiesGeneratorRepository method saveCopyOf.

public ArtifactPropertiesGenerator saveCopyOf(long jobId, ArtifactPropertiesGenerator generator) {
    ArtifactPropertiesGenerator copyOfGenerator = new ArtifactPropertiesGenerator(generator);
    copyOfGenerator.setJobId(jobId);
    save(copyOfGenerator);
    return copyOfGenerator;
}
Also used : ArtifactPropertiesGenerator(com.thoughtworks.go.config.ArtifactPropertiesGenerator)

Example 12 with ArtifactPropertiesGenerator

use of com.thoughtworks.go.config.ArtifactPropertiesGenerator in project gocd by gocd.

the class ArtifactPropertiesGeneratorRepositoryIntegrationTest method shouldSaveArtifactPropertiesGenerator.

@Test
public void shouldSaveArtifactPropertiesGenerator() {
    // Arrange
    JobInstance jobInstance = jobInstanceDao.save(stageId, new JobInstance(JOB_NAME));
    ArtifactPropertiesGenerator artifactPropertiesGenerator = new ArtifactPropertiesGenerator("test", "src", "//xpath");
    artifactPropertiesGenerator.setJobId(jobInstance.getId());
    // Act
    artifactPropertiesGeneratorRepository.save(artifactPropertiesGenerator);
    // Assert
    assertThat(artifactPropertiesGenerator.getId(), is(not(nullValue())));
}
Also used : JobInstance(com.thoughtworks.go.domain.JobInstance) ArtifactPropertiesGenerator(com.thoughtworks.go.config.ArtifactPropertiesGenerator) Test(org.junit.Test)

Example 13 with ArtifactPropertiesGenerator

use of com.thoughtworks.go.config.ArtifactPropertiesGenerator in project gocd by gocd.

the class ArtifactPropertiesGeneratorRepositoryIntegrationTest method shouldLoadSavedArtifactPropertiesGenerator.

@Test
public void shouldLoadSavedArtifactPropertiesGenerator() {
    // Arrange
    JobInstance jobInstance = jobInstanceDao.save(stageId, new JobInstance(JOB_NAME));
    ArtifactPropertiesGenerator savedArtifactPropertiesGenerator = new ArtifactPropertiesGenerator("test", "src", "//xpath");
    savedArtifactPropertiesGenerator.setJobId(jobInstance.getId());
    artifactPropertiesGeneratorRepository.save(savedArtifactPropertiesGenerator);
    // Act
    List<ArtifactPropertiesGenerator> artifactPropertiesGeneratorList = artifactPropertiesGeneratorRepository.findByBuildId(jobInstance.getId());
    // Assert
    assertThat(artifactPropertiesGeneratorList.size(), is(1));
    assertThat(artifactPropertiesGeneratorList.get(0), is(savedArtifactPropertiesGenerator));
}
Also used : JobInstance(com.thoughtworks.go.domain.JobInstance) ArtifactPropertiesGenerator(com.thoughtworks.go.config.ArtifactPropertiesGenerator) Test(org.junit.Test)

Aggregations

ArtifactPropertiesGenerator (com.thoughtworks.go.config.ArtifactPropertiesGenerator)13 Test (org.junit.Test)11 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)5 JobInstance (com.thoughtworks.go.domain.JobInstance)3 File (java.io.File)2 Cloner (com.rits.cloning.Cloner)1 BuildCommand (com.thoughtworks.go.domain.BuildCommand)1 ArrayList (java.util.ArrayList)1