use of com.thoughtworks.go.domain.materials.Modification in project gocd by gocd.
the class P4OutputParserTest method shouldParseChangesWithLotsOfFilesWithoutError.
/*
* This test reproduces a problem we saw at a customer's installation, where the changelist was really really large
* It caused a frequent StackOverflow in the java regex library.
*/
@Test
public void shouldParseChangesWithLotsOfFilesWithoutError() throws Exception {
final StringWriter writer = new StringWriter();
IOUtils.copy(new ClassPathResource("/BIG_P4_OUTPUT.txt").getInputStream(), writer, Charset.defaultCharset());
String output = writer.toString();
Modification modification = parser.modificationFromDescription(output, new ConsoleResult(0, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>()));
assertThat(modification.getModifiedFiles().size(), is(1304));
assertThat(modification.getModifiedFiles().get(0).getFileName(), is("Internal Projects/ABC/Customers3/ABC/RIP/SomeProject/data/main/config/lib/java/AdvJDBCColumnHandler.jar"));
}
use of com.thoughtworks.go.domain.materials.Modification in project gocd by gocd.
the class ModificationsMother method createP4MaterialRevisions.
public static MaterialRevisions createP4MaterialRevisions(Modification modification) {
List<Modification> modifications = new ArrayList<>();
modifications.add(modification);
Material svnMaterial = MaterialsMother.p4Material();
MaterialRevisions revisions = new MaterialRevisions();
revisions.addRevision(svnMaterial, modifications);
return revisions;
}
use of com.thoughtworks.go.domain.materials.Modification in project gocd by gocd.
the class ModificationsMother method modifyNoFiles.
public static BuildCause modifyNoFiles(PipelineConfig config) {
MaterialRevisions materialRevisions = new MaterialRevisions();
for (Material material : new MaterialConfigConverter().toMaterials(config.materialConfigs())) {
ArrayList<Modification> list = new ArrayList<>();
list.add(new Modification("no-user", "comment", "dummy-email", new Date(), "Dummy Modification" + UUID.randomUUID().toString()));
materialRevisions.addRevision(material, list);
}
return BuildCause.createWithModifications(materialRevisions, "");
}
use of com.thoughtworks.go.domain.materials.Modification in project gocd by gocd.
the class ModificationsMother method multipleModificationsInHg.
public static List<Modification> multipleModificationsInHg() {
final ArrayList<Modification> modifications = new ArrayList<>();
modifications.add(new Modification("user2", "comment2", "email2", TODAY_CHECKIN, "9fdcf27f16eadc362733328dd481d8a2c29915e1"));
modifications.add(new Modification("user1", "comment1", "email1", TWO_DAYS_AGO_CHECKIN, "eef77acd79809fc14ed82b79a312648d4a2801c6"));
return modifications;
}
use of com.thoughtworks.go.domain.materials.Modification in project gocd by gocd.
the class ModificationsMother method withModifiedFileWhoseNameLengthIsOneK.
public static Modification withModifiedFileWhoseNameLengthIsOneK() {
Modification modification = new Modification(MOD_USER, MOD_COMMENT, EMAIL_ADDRESS, TWO_DAYS_AGO_CHECKIN, "rev_1");
modification.createModifiedFile(generateString(1024), "\\build", MOD_MODIFIED_ACTION);
return modification;
}
Aggregations