While working on some Java code and working with Java 5.0 and Junit4.4 I started by writing some examples and tests.
I would say it was a very pleasant experience working on the new JUnit with Java 5. Parts of code became a lot clearer and easy to read. Lot of clutter was hidden behind more aptly named annotations(For the critics of everything annotated - "Right now we are just talking about good things").
I ran across a lot of issues when using Junit4(most of it was my ignorance.) Some of the following links helped me understand how Junit4 was different.
Junit FAQ
Junit 4 Basics
What's new in Junit 4.4
NoClassDefFoundError with Junit 4.4 (This was the first error I had to deal with when running tests using the command line or ant)
Converting tests from Junit 3.8 to JUnit 4.4
When using Junit4 on command line the following JUnit3 command
java -classpath lib\junit.jar;build\prod\com\MyProject\;build\test\com\MyProject junit.textui.TestRunner com.MyProject.MyTest
becomes
java -classpath lib/junit-4.4.jar;build org.junit.runner.JUnitCore com.MyProject.MyTest
Note the change of runner class in Junit4. Happy Testing with Junit4.
Subscribe to:
Post Comments (Atom)
Welcome
- Agile (1)
- ant (1)
- automation (2)
- batch files (1)
- commandline (1)
- continuous integration (1)
- cruisecontrol (1)
- cruisecontrol java monitor Big visible charts agile ramaze ruby (1)
- env (1)
- errors (1)
- github pages blog jekyll accordion.js accordion prototype1.6 javascript opensource (1)
- java (1)
- java5 (1)
- jruby Mac OSX install Windows CLASSPATH (1)
- Junit (1)
- junit4 (1)
- launchy (1)
- maven build tools (1)
- mocking (1)
- PATH (1)
- process (1)
- procexp (1)
- rails (1)
- ruby (1)
- save (1)
- selenium (2)
- sysinternals (1)
- testing (1)
- testing "random numbers" ruby (1)
- thoughtworks (1)
- top (1)
- UCD (1)
- User Centered Design (1)
- webrick (1)
0 comments:
Post a Comment