use of org.junit.jupiter.api.condition.DisabledOnOs in project spring-boot by spring-projects.
the class FilePermissionsTests method umaskForPath.
@Test
@DisabledOnOs(OS.WINDOWS)
void umaskForPath() throws IOException {
FileAttribute<Set<PosixFilePermission>> fileAttribute = PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-r-----"));
Path tempFile = Files.createTempFile(this.tempDir, "umask", null, fileAttribute);
assertThat(FilePermissions.umaskForPath(tempFile)).isEqualTo(0640);
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class FileUtilTest method shouldCreateFileURIForFile.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldCreateFileURIForFile() {
assertThat(FileUtil.toFileURI(new File("/var/lib/foo/"))).isEqualTo("file:///var/lib/foo");
assertThat(FileUtil.toFileURI(new File("/var/a dir with spaces/foo"))).isEqualTo("file:///var/a%20dir%20with%20spaces/foo");
assertThat(FileUtil.toFileURI(new File("/var/司徒空在此/foo"))).isEqualTo("file:///var/%E5%8F%B8%E5%BE%92%E7%A9%BA%E5%9C%A8%E6%AD%A4/foo");
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class ArtifactsServiceTest method shouldProvideArtifactRootForAJobOnLinux.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldProvideArtifactRootForAJobOnLinux() throws Exception {
assumeArtifactsRoot(fakeRoot);
ArtifactsService artifactsService = new ArtifactsService(resolverService, stageService, artifactsDirHolder, zipUtil);
artifactsService.initialize();
JobIdentifier oldId = new JobIdentifier("cruise", 1, "1.1", "dev", "2", "linux-firefox", null);
when(resolverService.actualJobIdentifier(oldId)).thenReturn(new JobIdentifier("cruise", 2, "2.2", "functional", "3", "mac-safari"));
String artifactRoot = artifactsService.findArtifactRoot(oldId);
assertThat(artifactRoot).isEqualTo("pipelines/cruise/2/functional/3/mac-safari");
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class AgentLauncherImplTest method shouldDownload_AgentJar_IfTheCurrentJarIsStale.
@Test
@DisabledOnOs(OS.WINDOWS)
public void shouldDownload_AgentJar_IfTheCurrentJarIsStale() throws Exception {
TEST_AGENT_LAUNCHER.copyTo(AGENT_LAUNCHER_JAR);
File staleJar = randomFile(AGENT_BINARY_JAR);
long original = staleJar.length();
new AgentLauncherImpl().launch(launchDescriptor());
assertThat(staleJar.length(), not(original));
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class AgentBootstrapperFunctionalTest method shouldLoadAndBootstrapJarUsingAgentBootstrapCode_specifiedInAgentManifestFile.
@Test
@DisabledOnOs(OS.WINDOWS)
public void shouldLoadAndBootstrapJarUsingAgentBootstrapCode_specifiedInAgentManifestFile() throws Exception {
PrintStream err = System.err;
try {
ByteArrayOutputStream os = new ByteArrayOutputStream();
System.setErr(new PrintStream(os));
File agentJar = new File("agent.jar");
agentJar.delete();
new AgentBootstrapper() {
@Override
void jvmExit(int returnValue) {
}
}.go(false, new AgentBootstrapperArgs().setServerUrl(new URL("http://" + "localhost" + ":" + server.getPort() + "/go")).setRootCertFile(null).setSslVerificationMode(AgentBootstrapperArgs.SslMode.NONE));
agentJar.delete();
assertThat(os.toString(), containsString("Hello World Fellas!"));
} finally {
System.setErr(err);
}
}
Aggregations