aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2020-01-21 17:27:59 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2020-01-22 18:16:14 +0100
commitc02a57f4fac277385789eb953138e77e713cb892 (patch)
treec6a7560013f128a75a85b1b8f49883af6f6ac189 /org.eclipse.jgit.test/src
parent926d392ea57831336e034475c5ab07c107a12562 (diff)
downloadjgit-c02a57f4fac277385789eb953138e77e713cb892.tar.gz
jgit-c02a57f4fac277385789eb953138e77e713cb892.zip
Update to Orbit I20200120214610 and JUnit to 4.13
Since version 4.13 JUnit has an assertThrows method. Remove the implementation in MoreAsserts and use the one from JUnit. CQ: 21439 Change-Id: I086baa94aa3069cebe87c4cbf91ed1534523c6cb Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/src')
-rw-r--r--org.eclipse.jgit.test/src/org/eclipse/jgit/lib/MoreAsserts.java46
1 files changed, 0 insertions, 46 deletions
diff --git a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/MoreAsserts.java b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/MoreAsserts.java
deleted file mode 100644
index cd0a6f1061..0000000000
--- a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/MoreAsserts.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2019, Google LLC and others
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Distribution License v. 1.0 which is available at
- * https://www.eclipse.org/org/documents/edl-v10.php.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-package org.eclipse.jgit.lib;
-
-/** Assertion methods. */
-public class MoreAsserts {
- /**
- * Simple version of assertThrows that will be introduced in JUnit 4.13.
- *
- * @param expected
- * Expected throwable class
- * @param r
- * Runnable that is expected to throw an exception.
- * @return The thrown exception.
- */
- public static <T extends Throwable> T assertThrows(Class<T> expected,
- ThrowingRunnable r) {
- try {
- r.run();
- } catch (Throwable actual) {
- if (expected.isAssignableFrom(actual.getClass())) {
- @SuppressWarnings("unchecked")
- T toReturn = (T) actual;
- return toReturn;
- }
- throw new AssertionError("Expected " + expected.getSimpleName()
- + ", but got " + actual.getClass().getSimpleName(), actual);
- }
- throw new AssertionError(
- "Expected " + expected.getSimpleName() + " to be thrown");
- }
-
- public interface ThrowingRunnable {
- void run() throws Throwable;
- }
-
- private MoreAsserts() {
- }
-}