Skip to content

Commit

Permalink
test case for JENKINS-24825
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof committed Sep 24, 2014
1 parent bd3abf6 commit 8975b0e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/src/test/java/hudson/model/ItemsTest.java
Expand Up @@ -24,10 +24,14 @@

package hudson.model;

import java.io.File;
import java.util.Arrays;

import hudson.Util;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Rule;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.MockFolder;

Expand Down Expand Up @@ -56,4 +60,17 @@ public class ItemsTest {
assertEquals(Arrays.<Item>asList(sub2a, sub2ap, sub2alpha, sub2b, sub2bp, sub2BRAVO, sub2c, sub2cp, sub2charlie), Items.getAllItems(sub2, Item.class));
}

@Issue("JENKINS-24825")
@Test public void moveItem() throws Exception {
File tmp = Util.createTempDir();
r.jenkins.setRawBuildsDir(tmp.getAbsolutePath()+"/${ITEM_FULL_NAME}");
MockFolder foo = r.createFolder("foo");
MockFolder bar = r.createFolder("bar");
FreeStyleProject test = foo.createProject(FreeStyleProject.class, "test");
test.scheduleBuild2(0).get();
Items.move(test, bar);
assertFalse(new File(tmp, "foo/test/1").exists());
assertTrue(new File(tmp, "bar/test/1").exists());
}

}

0 comments on commit 8975b0e

Please sign in to comment.