Merge branch 'stable-2.15'
* stable-2.15:
Set version to 2.15.3
CreateBranchIT#assertCreateFails: Restructure to avoid ErrorProne internal error
DeleteDraftPatchSetIT: Only 1 statement should come after ExpectedException#expect
RevisionIT: Only 1 statement should come after ExpectedException#expect
NotPredicateTest: Fix misuse of ExpectedException
Change-Id: I80a5dd8613bbe99e2c36fe080d8cf73248b5c29b
diff --git a/javatests/com/google/gerrit/acceptance/rest/project/CreateBranchIT.java b/javatests/com/google/gerrit/acceptance/rest/project/CreateBranchIT.java
index 0b7758e..0017e08 100644
--- a/javatests/com/google/gerrit/acceptance/rest/project/CreateBranchIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/project/CreateBranchIT.java
@@ -156,12 +156,12 @@
Class<? extends RestApiException> errType,
String errMsg)
throws Exception {
- exception.expect(errType);
+ BranchInput in = new BranchInput();
+ in.revision = revision;
if (errMsg != null) {
exception.expectMessage(errMsg);
}
- BranchInput in = new BranchInput();
- in.revision = revision;
+ exception.expect(errType);
branch(branch).create(in);
}
diff --git a/javatests/com/google/gerrit/index/query/NotPredicateTest.java b/javatests/com/google/gerrit/index/query/NotPredicateTest.java
index 88d8349..74eac61 100644
--- a/javatests/com/google/gerrit/index/query/NotPredicateTest.java
+++ b/javatests/com/google/gerrit/index/query/NotPredicateTest.java
@@ -50,17 +50,26 @@
final TestPredicate p = f("author", "bob");
final Predicate<String> n = not(p);
- exception.expect(UnsupportedOperationException.class);
- n.getChildren().clear();
- assertOnlyChild("clear", p, n);
+ try {
+ n.getChildren().clear();
+ fail("Expected UnsupportedOperationException");
+ } catch (UnsupportedOperationException e) {
+ assertOnlyChild("clear", p, n);
+ }
- exception.expect(UnsupportedOperationException.class);
- n.getChildren().remove(0);
- assertOnlyChild("remove(0)", p, n);
+ try {
+ n.getChildren().remove(0);
+ fail("Expected UnsupportedOperationException");
+ } catch (UnsupportedOperationException e) {
+ assertOnlyChild("remove(0)", p, n);
+ }
- exception.expect(UnsupportedOperationException.class);
- n.getChildren().iterator().remove();
- assertOnlyChild("remove(0)", p, n);
+ try {
+ n.getChildren().iterator().remove();
+ fail("Expected UnsupportedOperationException");
+ } catch (UnsupportedOperationException e) {
+ assertOnlyChild("remove()", p, n);
+ }
}
private static void assertOnlyChild(String o, Predicate<String> c, Predicate<String> p) {