@Bug(18368)
public void testDecoratedByEnvMaintainsIsUnix() throws Exception {
ByteArrayOutputStream output = new ByteArrayOutputStream();
TaskListener listener = new StreamBuildListener(output);
Launcher remoteLauncher = new Launcher.RemoteLauncher(listener, Jenkins.MasterComputer.localChannel, false);
Launcher decorated = remoteLauncher.decorateByEnv(new EnvVars());
assertEquals(false, decorated.isUnix());
remoteLauncher = new Launcher.RemoteLauncher(listener, Jenkins.MasterComputer.localChannel, true);
decorated = remoteLauncher.decorateByEnv(new EnvVars());
assertEquals(true, decorated.isUnix());
}
@Bug(18368)
public void testDecoratedByPrefixMaintainsIsUnix() throws Exception {
ByteArrayOutputStream output = new ByteArrayOutputStream();
TaskListener listener = new StreamBuildListener(output);
Launcher remoteLauncher = new Launcher.RemoteLauncher(listener, Jenkins.MasterComputer.localChannel, false);
Launcher decorated = remoteLauncher.decorateByPrefix("test");
assertEquals(false, decorated.isUnix());
remoteLauncher = new Launcher.RemoteLauncher(listener, Jenkins.MasterComputer.localChannel, true);
decorated = remoteLauncher.decorateByPrefix("test");
assertEquals(true, decorated.isUnix());
}
Similar to this issue, but specifically when the RemoteLauncher gets wrapped by a decorate* method, the isUnix value is "masked".