• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

se-edu / addressbook-level4 / 4597
94%

Build:
DEFAULT BRANCH: master
Ran 07 Aug 2018 11:01AM UTC
Jobs 1
Files 91
Run time 13s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
4597

push

travis-ci

pyokagan
<a href="https://github.com/se-edu/addressbook-level4/commit/<a class=hub.com/se-edu/addressbook-level4/commit/e186102b646d2307b53928142dd22932a6f4c86d">e186102b6<a href="https://github.com/se-edu/addressbook-level4/commit/e186102b646d2307b53928142dd22932a6f4c86d">&quot;&gt;Replace uses of `org.junit.Assert.fail` with `throw new AssertionError(...)`

The source code of `org.junit.Assert.fail(String)` is[1]:

    public static void fail(String message) {
        if (message == null) {
            throw new AssertionError();
        }
        throw new AssertionError(message);
    }

where `AssertionError` is our favorite `java.lang.AssertionError`.

In other words, calling `fail(String)` is no different from writing
`throw new AssertionError(...)`.

The latter has a further benefit, though -- it informs the Java compiler
that the code path terminates at that point. This is useful when we are
inside a function that has a non-void return type -- if we used
`fail(String)`, we will still need to `return` a dummy value at the end
to satisfy the compiler, whereas if we used
`throw new AssertionError(...)` we do not need to do that.

So, let&amp;#39;s use `throw new AssertionError(...)` consistently throughout
the code base.

[1] https://github.com/junit-team/junit4/blob/</a><a class="double-link" href="https://github.com/se-edu/addressbook-level4/commit/<a class="double-link" href="https://github.com/se-edu/addressbook-level4/commit/02c328028b4d32c15bbf0becc9838e54ecbafcbf">02c328028</a>">02c328028</a><a href="https://github.com/se-edu/addressbook-level4/commit/e186102b646d2307b53928142dd22932a6f4c86d">/src/main/java/org/junit/Assert.java#L85-L90

1428 of 1549 relevant lines covered (92.19%)

0.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 4597.1 07 Aug 2018 11:01AM UTC 0
92.19
Travis Job 4597.1
Source Files on build 4597
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #4597
  • e186102b on github
  • Prev Build on master (#4596)
  • Next Build on master (#4609)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc