Search in sources :

Example 56 with StringRevision

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

the class P4MaterialTestBase method shouldMapDirectoryInRepoToDirectoryUnderClientRoot.

@Test
public void shouldMapDirectoryInRepoToDirectoryUnderClientRoot() throws Exception {
    P4Material p4Material = p4Fixture.material("//depot/lib/... //cws/release1/...");
    updateMaterial(p4Material, new StringRevision("2"));
    assertThat(getContainedFileNames(new File(clientFolder, "release1")), hasItem("junit.jar"));
}
Also used : StringRevision(com.thoughtworks.go.domain.materials.mercurial.StringRevision) File(java.io.File) Test(org.junit.Test)

Example 57 with StringRevision

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

the class TfsSDKCommandTest method shouldReturnChangeSetsFromAPreviouslyKnownRevisionUptilTheLatest.

@Test
public void shouldReturnChangeSetsFromAPreviouslyKnownRevisionUptilTheLatest() throws Exception {
    Changeset[] changeSets = getChangeSets(42);
    when(client.queryHistory(eq(TFS_PROJECT), any(ChangesetVersionSpec.class), anyInt())).thenReturn(changeSets);
    TfsSDKCommand spy = spy(tfsCommand);
    doReturn(null).when(spy).getModifiedFiles(changeSets[0]);
    List<Modification> modifications = spy.modificationsSince(null, new StringRevision("2"));
    assertThat(modifications.isEmpty(), is(false));
    verify(client, times(2)).queryHistory(eq(TFS_PROJECT), any(ChangesetVersionSpec.class), anyInt());
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) ChangesetVersionSpec(com.microsoft.tfs.core.clients.versioncontrol.specs.version.ChangesetVersionSpec) StringRevision(com.thoughtworks.go.domain.materials.mercurial.StringRevision) Changeset(com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset) Test(org.junit.Test)

Aggregations

StringRevision (com.thoughtworks.go.domain.materials.mercurial.StringRevision)57 Test (org.junit.Test)47 File (java.io.File)29 Modification (com.thoughtworks.go.domain.materials.Modification)15 RevisionContext (com.thoughtworks.go.domain.materials.RevisionContext)13 GitSubmoduleRepos (com.thoughtworks.go.helper.GitSubmoduleRepos)11 GitTestRepo (com.thoughtworks.go.domain.materials.git.GitTestRepo)7 StringContains.containsString (org.hamcrest.core.StringContains.containsString)7 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)5 TestSubprocessExecutionContext (com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext)4 RegexMatcher (com.thoughtworks.go.matchers.RegexMatcher)4 ModifiedFile (com.thoughtworks.go.domain.materials.ModifiedFile)3 ArrayList (java.util.ArrayList)3 Changeset (com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset)2 ChangesetVersionSpec (com.microsoft.tfs.core.clients.versioncontrol.specs.version.ChangesetVersionSpec)2 DependencyMaterialRevision (com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision)2 SysOutStreamConsumer (com.thoughtworks.go.mail.SysOutStreamConsumer)2 JsonValue (com.thoughtworks.go.util.JsonValue)2 InMemoryStreamConsumer (com.thoughtworks.go.util.command.InMemoryStreamConsumer)2 IOException (java.io.IOException)2