JUnit 4 feels like NUnit with attribute-like syntax

My blog has moved. You can view this post at the following address: http://www.osherove.com/blog/2007/3/7/junit-4-feels-like-nunit-with-attribute-like-syntax.html
Published Wednesday, March 07, 2007 6:07 PM by RoyOsherove
Filed under: ,

Comments

Thursday, March 08, 2007 4:40 AM by Bill Michell

# re: JUnit 4 feels like NUnit with attribute-like syntax

Check out TestNG too (http://testng.org/)

It has had annotations and lack of inheritance and many other cool features for ages now, and dealing with suites is definitely better than the example you give above.

Thursday, March 08, 2007 12:56 PM by andrewstopford

# re: JUnit 4 feels like NUnit with attribute-like syntax

For my Java testing needs I am a fan of TestNG as well, its supported paramterized tests for a while.

In terms of MbUnit data driving a test like JUnit 4.0 you should look at the combintional\factory test.

http://www.mertner.com/confluence/display/MbUnit/CombinatorialTestAttribute

Adapting a factory to act as a datasource would'nt be too tricky. If your after a data driven test like VSTS then take a look at MbUnit's data fixture.

http://www.mertner.com/confluence/display/MbUnit/DataFixture

Andy

Thursday, March 08, 2007 1:01 PM by matt

# @Before is better

what you didn't mention, and perhaps hadn't seen, is that JUnit 4 will find and execute ALL @Before methods in your test case inheritance tree, super classes' first.

Tuesday, May 15, 2007 10:00 AM by Thanuja

# re: JUnit 4 feels like NUnit with attribute-like syntax

I am having one doubt plz clearify,I am getting line separators error when i am passing xml data as string and result is also in xml string.Can u tell what I have to do.