Search in sources :

Example 56 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.

the class SvnCommandTest method shouldRecogniseSvnAsTheSameIfURLContainsChineseCharacters.

@Test
@DisabledOnOs(OS.WINDOWS)
void shouldRecogniseSvnAsTheSameIfURLContainsChineseCharacters() throws Exception {
    File working = TempDirUtils.createTempDirectoryIn(tempDir, "shouldRecogniseSvnAsTheSameIfURLContainsSpaces").toFile();
    SvnTestRepo repo = new SvnTestRepo(tempDir, "a directory with 司徒空在此");
    SvnMaterial material = repo.material();
    assertThat(material.getUrl()).contains("%20");
    InMemoryStreamConsumer output = new InMemoryStreamConsumer();
    material.freshCheckout(output, new SubversionRevision("3"), working);
    assertThat(output.getAllOutput()).contains("Checked out revision 3");
    InMemoryStreamConsumer output2 = new InMemoryStreamConsumer();
    updateMaterial(material, new SubversionRevision("4"), working, output2);
    assertThat(output2.getAllOutput()).contains("Updated to revision 4");
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) File(java.io.File) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Example 57 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.

the class AntTaskBuilderTest method antTaskShouldNormalizeWorkingDirectory.

@Test
@DisabledOnOs(OS.WINDOWS)
void antTaskShouldNormalizeWorkingDirectory() {
    AntTask task = new AntTask();
    task.setWorkingDirectory("folder1\\folder2");
    CommandBuilder commandBuilder = (CommandBuilder) antTaskBuilder.createBuilder(builderFactory, task, ExecTaskBuilderTest.pipelineStub("label", "/var/cruise-agent/pipelines/cruise"), resolver);
    assertThat(commandBuilder.getWorkingDir().getPath()).isEqualTo("/var/cruise-agent/pipelines/cruise/folder1/folder2");
}
Also used : AntTask(com.thoughtworks.go.config.AntTask) CommandBuilder(com.thoughtworks.go.domain.builder.CommandBuilder) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Example 58 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.

the class MaterialsTest method shouldFailIfMultipleMaterialsHaveSameFolderNameSet_CaseInSensitive.

@Test
@DisabledOnOs(OS.WINDOWS)
void shouldFailIfMultipleMaterialsHaveSameFolderNameSet_CaseInSensitive() {
    HgMaterialConfig materialOne = hg("http://url1", null);
    materialOne.setConfigAttributes(Collections.singletonMap(ScmMaterialConfig.FOLDER, "folder"));
    HgMaterialConfig materialTwo = hg("http://url2", null);
    materialTwo.setConfigAttributes(Collections.singletonMap(ScmMaterialConfig.FOLDER, "foLder"));
    CruiseConfig config = GoConfigMother.configWithPipelines("one");
    PipelineConfig pipelineOne = config.pipelineConfigByName(new CaseInsensitiveString("one"));
    pipelineOne.setMaterialConfigs(new MaterialConfigs(materialOne, materialTwo));
    MaterialConfigs materials = pipelineOne.materialConfigs();
    materials.validate(ConfigSaveValidationContext.forChain(config));
    assertThat(materials.get(0).errors().isEmpty()).isFalse();
    assertThat(materials.get(1).errors().isEmpty()).isFalse();
    assertThat(materials.get(0).errors().on(ScmMaterialConfig.FOLDER)).isEqualTo("The destination directory must be unique across materials.");
    assertThat(materials.get(1).errors().on(ScmMaterialConfig.FOLDER)).isEqualTo("The destination directory must be unique across materials.");
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) HgMaterialConfig(com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig) CruiseConfig(com.thoughtworks.go.config.CruiseConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Example 59 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.

the class DefaultPluginLoggingServiceIntegrationTest method shouldGetCurrentLogDirectoryByLookingAtFileAppenderOfRootLogger.

@Test
@DisabledOnOs(OS.WINDOWS)
void shouldGetCurrentLogDirectoryByLookingAtFileAppenderOfRootLogger() {
    FileAppender fileAppender = new FileAppender();
    fileAppender.setFile("/var/log/go-server/go-server.log");
    DefaultPluginLoggingService service = Mockito.spy(new DefaultPluginLoggingService(systemEnvironment));
    doReturn(fileAppender).when(service).getGoServerLogFileAppender();
    String currentLogDirectory = service.getCurrentLogDirectory();
    assertThat(currentLogDirectory).isEqualTo("/var/log/go-server");
}
Also used : FileAppender(ch.qos.logback.core.FileAppender) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Example 60 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project cucumber-jvm by cucumber.

the class FeaturePathTest method can_parse_absolute_file_form.

@Test
@DisabledOnOs(WINDOWS)
void can_parse_absolute_file_form() {
    URI uri = FeaturePath.parse("file:/path/to/file.feature");
    assertAll(() -> assertThat(uri.getScheme(), is("file")), () -> assertThat(uri.getSchemeSpecificPart(), is("/path/to/file.feature")));
}
Also used : URI(java.net.URI) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Aggregations

DisabledOnOs (org.junit.jupiter.api.condition.DisabledOnOs)87 Test (org.junit.jupiter.api.Test)80 Path (java.nio.file.Path)39 File (java.io.File)26 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)15 PathsBaseTest (org.assertj.core.internal.PathsBaseTest)12 AssertionsUtil.expectAssertionError (org.assertj.core.util.AssertionsUtil.expectAssertionError)11 PosixFilePermission (java.nio.file.attribute.PosixFilePermission)6 PageSwapperFactory (org.neo4j.io.pagecache.PageSwapperFactory)6 PageSwapperTest (org.neo4j.io.pagecache.PageSwapperTest)6 CommandBuilder (com.thoughtworks.go.domain.builder.CommandBuilder)5 DelegatingStoreChannel (org.neo4j.io.fs.DelegatingStoreChannel)5 StoreChannel (org.neo4j.io.fs.StoreChannel)5 DisabledForRoot (org.neo4j.test.extension.DisabledForRoot)5 Closeable (java.io.Closeable)4 URI (java.net.URI)4 FileUtils.writeByteArrayToFile (org.apache.commons.io.FileUtils.writeByteArrayToFile)4 ShouldBeFile.shouldBeFile (org.assertj.core.error.ShouldBeFile.shouldBeFile)4 FilesBaseTest (org.assertj.core.internal.FilesBaseTest)4 Files.newFile (org.assertj.core.util.Files.newFile)4