Skip to content

Commit

Permalink
Merge pull request #2 from jtnord/build_on_windows
Browse files Browse the repository at this point in the history
Build on windows
  • Loading branch information
jtnord committed Nov 27, 2015
2 parents b8ac0aa + 03425ac commit 348eec8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
/target/
/.classpath
/.project
/.settings
15 changes: 13 additions & 2 deletions src/test/java/hudson/plugins/batch_task/BatchTaskTest.java
Expand Up @@ -24,6 +24,8 @@
package hudson.plugins.batch_task;

import com.gargoylesoftware.htmlunit.html.HtmlPage;

import hudson.Functions;
import hudson.Util;
import hudson.model.Cause.UpstreamCause;
import hudson.model.Cause.UserCause;
Expand All @@ -32,7 +34,9 @@
import hudson.model.Queue;
import hudson.model.Result;
import hudson.slaves.EnvironmentVariablesNodeProperty;

import java.util.concurrent.TimeUnit;

import org.jvnet.hudson.test.HudsonTestCase;

/**
Expand Down Expand Up @@ -65,8 +69,15 @@ public void testExecute() throws Exception {
hudson.getNodeProperties().add(new EnvironmentVariablesNodeProperty(
new EnvironmentVariablesNodeProperty.Entry("OVERRIDE_ME", "bar")));
FreeStyleProject p = createFreeStyleProject("execute");
BatchTask task = new BatchTask("test",
"echo \"$TASK_ID:$GLOBAL:$OVERRIDE_ME:$HUDSON_USER\"\n");
BatchTask task;
if (Functions.isWindows()) {
task = new BatchTask("test",
"echo \"%TASK_ID%:%GLOBAL%:%OVERRIDE_ME%:%HUDSON_USER%\"");
}
else {
task = new BatchTask("test",
"echo \"$TASK_ID:$GLOBAL:$OVERRIDE_ME:$HUDSON_USER\"\n");
}
p.addProperty(new BatchTaskProperty(task));
p.scheduleBuild2(0).get();
new WebClient().getPage(p, "batchTasks/task/test/execute");
Expand Down

0 comments on commit 348eec8

Please sign in to comment.