Skip to content

Commit

Permalink
[JENKINS-41842] Include some tests for computed folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evaristo Gutiérrez committed Feb 8, 2017
1 parent 7defd7e commit c932224
Showing 1 changed file with 24 additions and 1 deletion.
Expand Up @@ -62,7 +62,6 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.*;
import org.junit.Rule;
import org.jvnet.hudson.test.Issue;
Expand Down Expand Up @@ -155,6 +154,30 @@ public void runningBuild() throws Exception {
d.assertItemNames(5);
}

@Test
public void notAddChildren() throws Exception {
JenkinsRule.WebClient client = r.createWebClient();
SampleComputedFolder s = r.jenkins.createProject(SampleComputedFolder.class, "s");

assertThat(client.getPage(s).getByXPath("//a[contains(text(), \"New Item\")]").size(), is(0));

s.kids.add("A");
s.recompute(Result.SUCCESS);

assertThat(client.getPage(s).getByXPath("//a[contains(text(), \"New Item\")]").size(), is(0));
}

@Test
public void runByTrigger() throws Exception {
SampleComputedFolder s = r.jenkins.createProject(SampleComputedFolder.class, "s");
s.assertItemNames(0);

s.addTrigger(new PeriodicFolderTrigger("1m"));

Thread.sleep(65000);
s.assertItemNames(1);
}

/** Verify that running branch projects are not deleted even after an organization folder reindex. */
@Issue("JENKINS-25240")
@Test
Expand Down

0 comments on commit c932224

Please sign in to comment.