mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 20:42:21 +00:00
fixed a test regression
This commit is contained in:
1 parent
8a530bb14b
commit
1f55b80f18
1 file changed
+14
-12
@@ -23,12 +23,16 @@
|
||||
*/
|
||||
package hudson;
|
||||
|
||||
import static org.mockito.Mockito.*;
|
||||
import hudson.FilePath.TarCompression;
|
||||
import hudson.model.TaskListener;
|
||||
import hudson.remoting.LocalChannel;
|
||||
import hudson.remoting.VirtualChannel;
|
||||
import hudson.util.NullStream;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.output.NullOutputStream;
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.taskdefs.Chmod;
|
||||
import org.jvnet.hudson.test.Bug;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -53,11 +57,7 @@ import java.util.concurrent.Future;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.output.NullOutputStream;
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.taskdefs.Chmod;
|
||||
import org.jvnet.hudson.test.Bug;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* @author Kohsuke Kawaguchi
|
||||
@@ -385,18 +385,19 @@ public class FilePathTest extends ChannelTestCase {
|
||||
|
||||
@Bug(11073)
|
||||
public void testIsUnix() {
|
||||
FilePath winPath = new FilePath(new LocalChannel(null),
|
||||
VirtualChannel dummy = Mockito.mock(VirtualChannel.class);
|
||||
FilePath winPath = new FilePath(dummy,
|
||||
" c:\\app\\hudson\\workspace\\3.8-jelly-db\\jdk/jdk1.6.0_21/label/sqlserver/profile/sqlserver\\acceptance-tests\\distribution.zip");
|
||||
assertFalse(winPath.isUnix());
|
||||
|
||||
FilePath base = new FilePath(new LocalChannel(null),
|
||||
FilePath base = new FilePath(dummy,
|
||||
"c:\\app\\hudson\\workspace\\3.8-jelly-db");
|
||||
FilePath middle = new FilePath(base, "jdk/jdk1.6.0_21/label/sqlserver/profile/sqlserver");
|
||||
FilePath full = new FilePath(middle, "acceptance-tests\\distribution.zip");
|
||||
assertFalse(full.isUnix());
|
||||
|
||||
|
||||
FilePath unixPath = new FilePath(new LocalChannel(null),
|
||||
FilePath unixPath = new FilePath(dummy,
|
||||
"/home/test");
|
||||
assertTrue(unixPath.isUnix());
|
||||
}
|
||||
@@ -463,8 +464,9 @@ public class FilePathTest extends ChannelTestCase {
|
||||
|
||||
@Bug(13649)
|
||||
public void testMultiSegmentRelativePaths() throws Exception {
|
||||
FilePath winPath = new FilePath(new LocalChannel(null), "c:\\app\\jenkins\\workspace");
|
||||
FilePath nixPath = new FilePath(new LocalChannel(null), "/opt/jenkins/workspace");
|
||||
VirtualChannel d = Mockito.mock(VirtualChannel.class);
|
||||
FilePath winPath = new FilePath(d, "c:\\app\\jenkins\\workspace");
|
||||
FilePath nixPath = new FilePath(d, "/opt/jenkins/workspace");
|
||||
|
||||
assertEquals("c:\\app\\jenkins\\workspace\\foo\\bar\\manchu", new FilePath(winPath, "foo/bar/manchu").getRemote());
|
||||
assertEquals("c:\\app\\jenkins\\workspace\\foo\\bar\\manchu", new FilePath(winPath, "foo\\bar/manchu").getRemote());
|
||||
|
||||
Reference in new issue
Block a user