use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class AgentBootstrapperFunctionalTest method shouldDownloadJarIfItDoesNotExist.
@Test
@DisabledOnOs(OS.WINDOWS)
public void shouldDownloadJarIfItDoesNotExist() throws Exception {
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));
assertTrue(agentJar.exists(), "No agent downloaded");
agentJar.delete();
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class PackageLevelClassWithPublicInnerClass method shouldRegisterANestedClassImplementingGoPluginAsAnOSGiService.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldRegisterANestedClassImplementingGoPluginAsAnOSGiService() throws Exception {
File bundleWithActivator = createBundleWithActivator(BUNDLE_DIR_WHICH_HAS_PROPER_ACTIVATOR, TestPluginOuterClass.class, TestPluginOuterClass.NestedClass.class, TestPluginOuterClass.InnerClass.class, TestPluginOuterClass.InnerClass.SecondLevelInnerClass.class, TestPluginOuterClass.InnerClass.SecondLevelInnerClass.TestPluginThirdLevelInnerClass.class, TestPluginOuterClass.InnerClass.SecondLevelSiblingInnerClassNoDefaultConstructor.class);
BundleContext installedBundledContext = bundleContext(installBundleFoundInDirectory(bundleWithActivator));
ServiceReference<?>[] references = installedBundledContext.getServiceReferences(GoPlugin.class.getName(), null);
String[] services = toSortedServiceClassNames(installedBundledContext, references);
assertThat(services.length).as(Arrays.toString(services)).isEqualTo(4);
assertThat(services[0]).isEqualTo(TestPluginOuterClass.class.getName());
assertThat(services[1]).isEqualTo(TestPluginOuterClass.InnerClass.class.getName());
assertThat(services[2]).isEqualTo(TestPluginOuterClass.InnerClass.SecondLevelInnerClass.TestPluginThirdLevelInnerClass.class.getName());
assertThat(services[3]).isEqualTo(TestPluginOuterClass.NestedClass.class.getName());
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class NantTaskBuilderTest method shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnLinux.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnLinux() {
NantTask nantTask = new NantTask();
nantTask.setNantPath("/usr/bin");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, pipeline, resolver);
assertThat(new File(builder.getCommand())).isEqualTo(new File("/usr/bin/nant"));
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class NantTaskBuilderTest method nantTaskShouldNormalizeWorkingDirectory.
@Test
@DisabledOnOs(OS.WINDOWS)
void nantTaskShouldNormalizeWorkingDirectory() {
NantTask nantTask = new NantTask();
nantTask.setWorkingDirectory("folder1\\folder2");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, ExecTaskBuilderTest.pipelineStub("label", "/var/cruise-agent/pipelines/cruise"), resolver);
assertThat(builder.getWorkingDir()).isEqualTo(new File("/var/cruise-agent/pipelines/cruise/folder1/folder2"));
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class RakeTaskBuilderTest method rakeTaskShouldNormalizeWorkingDirectory.
@Test
@DisabledOnOs(OS.WINDOWS)
void rakeTaskShouldNormalizeWorkingDirectory() {
RakeTask task = new RakeTask();
task.setWorkingDirectory("folder1\\folder2");
CommandBuilder commandBuilder = (CommandBuilder) rakeTaskBuilder.createBuilder(builderFactory, task, ExecTaskBuilderTest.pipelineStub("label", "/var/cruise-agent/pipelines/cruise"), resolver);
assertThat(commandBuilder.getWorkingDir().getPath()).isEqualTo("/var/cruise-agent/pipelines/cruise/folder1/folder2");
}
Aggregations