try {
resolver.open(null, name).close();
} catch (ServiceNotEnabledException e) {
- fail("did not honor export-all flag");
+ throw new AssertionError("did not honor export-all flag", e);
}
FileUtils.createNewFile(export);
try {
resolver.open(null, name).close();
} catch (ServiceNotEnabledException e) {
- fail("did not honor git-daemon-export-ok");
+ throw new AssertionError("did not honor git-daemon-export-ok", e);
}
}
assertEquals("1111111", firstLine.getCommit().name());
assertEquals("pick", firstLine.getAction().toToken());
} catch (Exception e) {
- fail("Valid parsable RebaseTodoLine that has been commented out should allow to change the action, but failed");
+ throw new AssertionError(
+ "Valid parsable RebaseTodoLine that has been commented out should allow to change the action, but failed",
+ e);
}
assertEquals("2222222", steps.get(1).getCommit().name());
try {
b.commit();
} catch (ReceivedEventMarkerException e) {
- fail("unexpected IndexChangedEvent");
+ throw new AssertionError("unexpected IndexChangedEvent", e);
}
}
lock.unlock();
lock.unlock();
} catch (Throwable e) {
- fail("unlock should be noop if not locked at all.");
+ throw new AssertionError(
+ "unlock should be noop if not locked at all.", e);
}
}
}
try {
assertTrue("latch released", cdl.await(1000, TimeUnit.MILLISECONDS));
} catch (InterruptedException ie) {
- fail("Did not expect to be interrupted");
+ throw new AssertionError("Did not expect to be interrupted", ie);
}
}
*/
package org.eclipse.jgit.transport;
-import static org.junit.Assert.fail;
import static org.eclipse.jgit.lib.Constants.HEAD;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.Collection;
pack.getPackFile().create(packExt).delete();
} catch (Exception e) {
- fail("GC or pack file removal failed");
+ throw new AssertionError(
+ "GC or pack file removal failed", e);
}
return up;
try {
FileUtils.delete(f, FileUtils.SKIP_MISSING);
} catch (IOException e) {
- fail("deletion of non-existing file must not fail with option SKIP_MISSING");
+ throw new AssertionError(
+ "deletion of non-existing file must not fail with option SKIP_MISSING",
+ e);
}
}
try {
FileUtils.delete(d, FileUtils.RECURSIVE | FileUtils.SKIP_MISSING);
} catch (IOException e) {
- fail("recursive deletion of non-existing directory must not fail with option SKIP_MISSING");
+ throw new AssertionError(
+ "recursive deletion of non-existing directory must not fail with option SKIP_MISSING",
+ e);
}
}
git.commit().setMessage("commit")
.setHookOutputStream(new PrintStream(out)).call();
} catch (AbortedByHookException e) {
- fail("unexpected hook failure");
+ throw new AssertionError("unexpected hook failure", e);
}
assertEquals("unexpected hook output",
"test pre-commit\ntest commit-msg .git/COMMIT_EDITMSG\ntest post-commit\n",
"-Xep:CannotMockFinalClass:ERROR",
"-Xep:CanonicalDuration:ERROR",
"-Xep:CatchAndPrintStackTrace:WARN",
- "-Xep:CatchFail:WARN",
+ "-Xep:CatchFail:ERROR",
"-Xep:ChainedAssertionLosesContext:ERROR",
"-Xep:ChainingConstructorIgnoresParameter:ERROR",
"-Xep:CharacterGetNumericValue:ERROR",