Skip to content

Commit

Permalink
[JENKINS-13165] Added a test to reproduce the problem to no avail.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Mar 22, 2012
1 parent d1c3203 commit 2b5a24c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/src/test/java/hudson/FileSystemProvisionerTest.java
@@ -0,0 +1,25 @@
package hudson;

import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.util.StreamTaskListener;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.HudsonTestCase;

/**
* @author Kohsuke Kawaguchi
*/
public class FileSystemProvisionerTest extends HudsonTestCase {
@Bug(13165)
public void test13165() throws Exception {
FreeStyleProject p = createFreeStyleProject();
FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0));
b.getWorkspace().child(".dot").touch(0);
StreamTaskListener listener = StreamTaskListener.fromStdout();

WorkspaceSnapshot s = jenkins.getFileSystemProvisioner().snapshot(b, b.getWorkspace(), "**/*", listener);
FilePath tmp = new FilePath(createTmpDir());
s.restoreTo(b, tmp,listener);
assertTrue(tmp.child(".dot").exists());
}
}

0 comments on commit 2b5a24c

Please sign in to comment.