The Artima Developer Community
Sponsored Link

Java Buzz Forum
Why JUnit does not accept method as argument

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jon Tirsen

Posts: 33
Nickname: tirsen
Registered: Apr, 2003

Jon Tirsen is a developer at Lecando AB working a lot with open source and agile methodologies
Why JUnit does not accept method as argument Posted: Jun 26, 2003 8:50 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Jon Tirsen.
Original Post: Why JUnit does not accept method as argument
Feed Title: jutopia
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: Ramblings on Java, AOP, TDD, agile and so on. some like it jutopic!
Latest Java Buzz Posts
Latest Java Buzz Posts by Jon Tirsen
Latest Posts From jutopia

Advertisement
Cedric is frustrated over JUnit.

I think this is based on one of the most common misunderstandings of what JUnit is. JUnit is a unit-testing tool not a functional testing tool. Feeling the urge to run an individual test-method and not the whole suite or test-case is actually a testing smell. There's a high chance you're actually writing functional tests and not unit-tests. A single JUnit test-case (consisting of several methods) should test one and only one unit of code (ie class or similar) and should take a very short amount of time to execute.

When you're in development mode (test-code-compile-cycle) it's better to use the JUnit-GUI to execute you're tests (it's capable of executing individual methods). Or you IDE, the latest IDEA-builds has an excellent JUnit runner (but it's always been quite good).

There are extensions to JUnit that does exactly this but those are for functional testing and not for unit-testing. (I think the most popular one is actually called JFunc but I can't remember. Never used it.)

Cedric's guess is that "if you are going to be testing more than small applications, you will start developing your own test software". It's actually quite the opposite. I was also annoyed with the limitations of JUnit when I used it for testing smaller libraries and application. When I actually used it to write a very large system I realized that those features I wanted (similar to what Cedric outline) were all actually quite useless.

Read: Why JUnit does not accept method as argument

Topic: Debugging HTTP Made Easy Previous Topic   Next Topic Topic: Object Cache

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use