Skip to content

Commit

Permalink
Merge pull request #84 from varyvol/JENKINS-42009
Browse files Browse the repository at this point in the history
[JENKINS-42009] Fix PCT for 2.32.2
  • Loading branch information
stephenc committed Feb 20, 2017
2 parents 961e516 + 1494ef1 commit e856fdf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Expand Up @@ -124,7 +124,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>2.1.0</version>
<version>2.1.11</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -143,6 +143,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>1.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>subversion</artifactId>
Expand Down
12 changes: 7 additions & 5 deletions src/test/java/integration/EventsTest.java
Expand Up @@ -66,6 +66,7 @@
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestExtension;

import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.empty;
Expand Down Expand Up @@ -794,7 +795,7 @@ public void given_multibranchWithSources_when_branchChangeEvent_then_branchFromE
FreeStyleProject master = prj.getItem("master");
assertThat("We now have the master branch", master, notNullValue());
FreeStyleProject feature = prj.getItem("feature");
assertThat("We now have the feature branch", master, notNullValue());
assertThat("We now have the feature branch", feature, notNullValue());
assertThat("We only have the master and feature branches",
prj.getItems(), containsInAnyOrder(master, feature));
r.waitUntilNoActivity();
Expand All @@ -806,7 +807,8 @@ public void given_multibranchWithSources_when_branchChangeEvent_then_branchFromE
c.addFile("foo", "master", "Adding README.md", "README.md", "This is the readme".getBytes());
c.addFile("foo", "feature", "Adding README.adoc", "README.adoc", "This is the readme".getBytes());
r.waitUntilNoActivity();
assertThat("No events means no new builds", master.getLastBuild().getNumber(), is(1));
assertThat("No events means no new builds in master branch", master.getLastBuild().getNumber(), is(1));
assertThat("No events means no new builds in feature branch", feature.getLastBuild().getNumber(), is(1));

fire(new MockSCMHeadEvent(SCMEvent.Type.UPDATED, c, "foo", "master", "junkHash"));
assertThat("The master branch was built from event", master.getLastBuild().getNumber(), is(2));
Expand Down Expand Up @@ -882,8 +884,9 @@ public void given_multibranchWithSourcesAndTwoBranches_when_indexing_then_deadBr
prj.scheduleBuild2(0).getFuture().get();
r.waitUntilNoActivity();
assertThat("Indexing applies dead branch cleanup",
prj.getItems(), containsInAnyOrder(master));

prj.getItems(), allOf(
containsInAnyOrder(master),
not(containsInAnyOrder(feature))));
}
}

Expand Down Expand Up @@ -1199,7 +1202,6 @@ public void given_orgFolder_when_someReposMatch_then_scanCreatesMatchingProjects
prj.getItems(),
Matchers.<MultiBranchProject<?, ?>>containsInAnyOrder(foo));
assertThat("The matching branch exists", foo.getItem("master"), notNullValue());

}
}

Expand Down

0 comments on commit e856fdf

Please sign in to comment.