Search in sources :

Example 36 with Modification

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"));
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) ConsoleResult(com.thoughtworks.go.util.command.ConsoleResult) StringWriter(java.io.StringWriter) ArrayList(java.util.ArrayList) StringContains.containsString(org.hamcrest.core.StringContains.containsString) ClassPathResource(org.springframework.core.io.ClassPathResource) Test(org.junit.Test)

Example 37 with Modification

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;
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) MaterialRevisions(com.thoughtworks.go.domain.MaterialRevisions) Material(com.thoughtworks.go.domain.materials.Material) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial)

Example 38 with Modification

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, "");
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) MaterialRevisions(com.thoughtworks.go.domain.MaterialRevisions) Material(com.thoughtworks.go.domain.materials.Material) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) MaterialConfigConverter(com.thoughtworks.go.server.service.MaterialConfigConverter)

Example 39 with Modification

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;
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification)

Example 40 with Modification

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;
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification)

Aggregations

Modification (com.thoughtworks.go.domain.materials.Modification)246 Test (org.junit.Test)176 Date (java.util.Date)76 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)65 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)54 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)40 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)38 ArrayList (java.util.ArrayList)35 File (java.io.File)25 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)21 Modifications (com.thoughtworks.go.domain.materials.Modifications)21 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)20 Material (com.thoughtworks.go.domain.materials.Material)20 Username (com.thoughtworks.go.server.domain.Username)17 StringRevision (com.thoughtworks.go.domain.materials.mercurial.StringRevision)16 HashMap (java.util.HashMap)16 StringContains.containsString (org.hamcrest.core.StringContains.containsString)15 DependencyMaterialRevision (com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision)14 Stage (com.thoughtworks.go.domain.Stage)13 ModifiedFile (com.thoughtworks.go.domain.materials.ModifiedFile)13