Exemplo n.º 1
0
  @Test
  public void shouldFindModificationForEachMaterial() throws Exception {
    SvnMaterial material1 = repo.createMaterial("multiple-materials/trunk/part1", "part1");
    SvnMaterial material2 = repo.createMaterial("multiple-materials/trunk/part2", "part2");

    Materials materials = new Materials(material1, material2);

    repo.checkInOneFile("filename.txt", material1);
    repo.checkInOneFile("filename2.txt", material2);

    MaterialRevisions materialRevisions =
        materials.latestModification(pipelineDir, new TestSubprocessExecutionContext());

    assertThat(materialRevisions.getRevisions().size(), is(2));
    assertThat(materialRevisions, containsModifiedFile("/trunk/part1/filename.txt"));
    assertThat(materialRevisions, containsModifiedFile("/trunk/part2/filename2.txt"));
  }
Exemplo n.º 2
0
 private void updateMaterials(Materials materials, Revision revision) {
   ProcessOutputStreamConsumer outputStreamConsumer = inMemoryConsumer();
   TestSubprocessExecutionContext execCtx = new TestSubprocessExecutionContext();
   materials.cleanUp(pipelineDir, outputStreamConsumer);
   for (Material material : materials) {
     material.updateTo(outputStreamConsumer, pipelineDir, new RevisionContext(revision), execCtx);
   }
 }
Exemplo n.º 3
0
  @Test
  public void shouldDetectLatestModifications() throws Exception {

    SvnMaterial svnMaterial1 = repo.createMaterial("multiple-materials/trunk/part1", "part1");
    SvnMaterial svnMaterial2 = repo.createMaterial("multiple-materials/trunk/part2", "part2");
    Materials materials = new Materials(svnMaterial1, svnMaterial2);

    MaterialRevisions materialRevisions =
        materials.latestModification(pipelineDir, new TestSubprocessExecutionContext());

    MaterialRevision revision1 = materialRevisions.getMaterialRevision(0);
    assertThat(
        revision1.getRevision(),
        is(latestRevision(svnMaterial1, pipelineDir, new TestSubprocessExecutionContext())));

    MaterialRevision revision2 = materialRevisions.getMaterialRevision(1);
    assertThat(
        revision2.getRevision(),
        is(latestRevision(svnMaterial2, pipelineDir, new TestSubprocessExecutionContext())));
  }