qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Harvey <p...@philharveyonline.com>
Subject JUnit 4 upgrade
Date Fri, 02 Nov 2012 09:29:51 GMT
Hi,

I would like us to upgrade Qpid's Java test to use JUnit 4 rather than
Junit 3.  I believe this idea was floated a long time ago but never
progressed.

My motivations are:

- It opens the door to us replacing our bespoke test exclusion framework
with JUnit 4's Categories.  This would allow each test to state which
category it's in (eg SlowTest or Amqp010Only), so that you can run the full
test suite specifying which Category(s) to include or exclude.  Note that
it's hard to INclude a set of tests using our existing framework.

- JUnit 4 bundles Hamcrest, which allows you to make more succinct and
readable assertions.

- More succinct way of asserting that a specific exception was thrown
(@Test(expected=FooException.class)

- assertEquals now supports arrays

I have tried to do the upgrade and managed to get everything working.  Note
that this requires a change to almost all of our test classes because the
JUnit 4 way of specifying a test is to use @Test rather than extending
TestCase.

I propose that we do this upgrade in Qpid v0.22.  Initially we would leave
our test exclusion framework as-is, migrating to use JUnit 4 Categories in
a separate piece of work.

Would there be any objections to this?

Phil

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message