On Sat, Feb 19, 2011 at 07:51PM, Greg Trasuk wrote:
> 
> On Sat, 2011-02-19 at 13:11, Patricia Shanahan wrote:
> > I'm converting my own informal tests of my FastList implementation into 
> > a JUnit test that can be checked in for regression testing. Can I use 
> > JUnit 4, or are we limited to JUnit 3?
> > 
> > Patricia
> 
> I don't see any problem with JUnit 4, since we're using JDK1.5
> officially.  I'm pretty sure the JUnit 4 test runner will still run
> JUnit 3 tests.  You might have to alter the Ant build to get the right
> test library into the runtime.

Actually, JUnit4 _includes_ old junit.framework packages, so technically
you're getting a mix of v3 and v4 in the same container. v4 is a way more
advanced (e.g. includes Parametrization and such). But still lacks certain
useful things that say TestNG delivers.

The latter is truly great framework with only issue (which might be considered
a big advantage by many): TestNG runs all tests in the same VM whether JUnit
allows you to fork new VM if needed and have a pristine environment for each
test. This might be useful if tests are crappy and leave lotta garbage after
themselves, etc.

Support wise both are well represented by development environments such as
IDEA, etc.

Answering OP's question: conversion to JUnit4 is very simple. I have written
this a while ago
  http://wiki.apache.org/hadoop/HowToDevelopUnitTests
you might find it useful too ;)

Hope it helps,
  Cos

> Cheers,
> 
> Greg.
> 
> 

Reply via email to