Search in sources :

Example 96 with SvnMaterial

use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.

the class SvnMaterialTest method shouldReturnNotEqualsWhenUserNameIsChanged.

@Test
public void shouldReturnNotEqualsWhenUserNameIsChanged() throws Exception {
    SvnMaterial material = MaterialsMother.svnMaterial("url", "svnDir", "userName", null, false, "*.txt");
    SvnMaterial other = MaterialsMother.svnMaterial("url", "svnDir", "userName1", null, false, "*.txt");
    assertThat(material, is(not(other)));
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Test(org.junit.Test)

Example 97 with SvnMaterial

use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.

the class SvnMaterialTest method shouldReturnEqualsWhenEverythingIsSame.

@Test
public void shouldReturnEqualsWhenEverythingIsSame() throws Exception {
    SvnMaterial material = MaterialsMother.svnMaterial("URL", "dummy-folder", "userName", "password", true, "*.doc");
    SvnMaterial other = MaterialsMother.svnMaterial("URL", "dummy-folder", "userName", "password", true, "*.doc");
    assertThat(other, is(material));
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Test(org.junit.Test)

Example 98 with SvnMaterial

use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.

the class SvnMaterialTest method shouldAddTheForwardSlashAndApplyThePattern.

@Test
public void shouldAddTheForwardSlashAndApplyThePattern() throws Exception {
    SvnMaterial material = MaterialsMother.svnMaterial();
    assertThat(material.matches("/a.doc", "a.doc"), is(true));
    assertThat(material.matches("a.doc", "a.doc"), is(false));
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Test(org.junit.Test)

Example 99 with SvnMaterial

use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.

the class SvnMaterialTest method shouldReturnNotEqualsWhenUrlIsChanged.

@Test
public void shouldReturnNotEqualsWhenUrlIsChanged() throws Exception {
    SvnMaterial material = MaterialsMother.svnMaterial("A");
    SvnMaterial other = MaterialsMother.svnMaterial("B");
    assertThat(material, is(not(other)));
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Test(org.junit.Test)

Example 100 with SvnMaterial

use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.

the class SvnMaterialTest method shouldGenerateSqlCriteriaMapInSpecificOrder.

@Test
public void shouldGenerateSqlCriteriaMapInSpecificOrder() throws Exception {
    SvnMaterial material = new SvnMaterial("url", "username", "password", true);
    Map<String, Object> map = material.getSqlCriteria();
    assertThat(map.size(), is(4));
    Iterator<Map.Entry<String, Object>> iter = map.entrySet().iterator();
    assertThat(iter.next().getKey(), is("type"));
    assertThat(iter.next().getKey(), is("url"));
    assertThat(iter.next().getKey(), is("username"));
    assertThat(iter.next().getKey(), is("checkExternals"));
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Test(org.junit.Test)

Aggregations

SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)140 Test (org.junit.Test)111 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)44 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)39 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)22 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)21 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)20 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)20 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)18 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)17 Material (com.thoughtworks.go.domain.materials.Material)16 Modification (com.thoughtworks.go.domain.materials.Modification)16 Materials (com.thoughtworks.go.config.materials.Materials)13 Date (java.util.Date)11 Username (com.thoughtworks.go.server.domain.Username)10 P4Material (com.thoughtworks.go.config.materials.perforce.P4Material)9 File (java.io.File)8 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)8 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)7 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)7