Search in sources :

Example 16 with RunIf

use of com.googlecode.junit.ext.RunIf in project gocd by gocd.

the class CommandRepositoryDirectoryWalkerTest method shouldUpdateServerHealthServiceIfTheCommandRepositoryDirectoryDoesNotExist.

@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { DO_NOT_RUN_ON, WINDOWS })
public void shouldUpdateServerHealthServiceIfTheCommandRepositoryDirectoryDoesNotExist() throws IOException {
    File nonExistentDirectory = new File("dirDoesNotExist");
    walker.getAllCommandSnippets(nonExistentDirectory.getPath());
    verify(serverHealthService).update(serverHealthWarningMessageWhichContains("Failed to access command repository located in Go Server Directory at " + nonExistentDirectory.getPath() + ". The directory does not exist or Go does not have sufficient permissions to access it."));
}
Also used : File(java.io.File) RunIf(com.googlecode.junit.ext.RunIf)

Example 17 with RunIf

use of com.googlecode.junit.ext.RunIf in project gocd by gocd.

the class MagicalGoConfigXmlLoaderTest method shouldNotAllowAbsoluteDestFolderNamesOnLinux.

@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { DO_NOT_RUN_ON, WINDOWS })
public void shouldNotAllowAbsoluteDestFolderNamesOnLinux() throws Exception {
    String materials1 = "  <materials>\n" + "    <svn url=\"/hgrepo2\" dest=\"/tmp/foo\" />\n" + "  </materials>\n";
    MagicalGoConfigXmlLoaderFixture.assertNotValid("Dest folder '/tmp/foo' is not valid. It must be a sub-directory of the working folder.", materials1);
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) RunIf(com.googlecode.junit.ext.RunIf) Test(org.junit.Test)

Aggregations

RunIf (com.googlecode.junit.ext.RunIf)17 Test (org.junit.Test)15 File (java.io.File)7 AgentRuntimeInfo (com.thoughtworks.go.server.service.AgentRuntimeInfo)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)3 Matchers.containsString (org.hamcrest.Matchers.containsString)3 JavaSysMon (com.jezhumble.javasysmon.JavaSysMon)2 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)2 OsProcess (com.jezhumble.javasysmon.OsProcess)1 ProcessVisitor (com.jezhumble.javasysmon.ProcessVisitor)1 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)1 BuildCommand (com.thoughtworks.go.domain.BuildCommand)1 Pipeline (com.thoughtworks.go.domain.Pipeline)1 RunIfConfigs (com.thoughtworks.go.domain.RunIfConfigs)1 ServerBackup (com.thoughtworks.go.server.domain.ServerBackup)1 LogFixture (com.thoughtworks.go.util.LogFixture)1 TimeProvider (com.thoughtworks.go.util.TimeProvider)1 EnvironmentVariableContext (com.thoughtworks.go.util.command.EnvironmentVariableContext)1 IOException (java.io.IOException)1 RandomAccessFile (java.io.RandomAccessFile)1