| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I looked for a main before posting. Apparently not carefully enough.
You certainly aren't alone if you think the example that I posted was a bit longer than absolutely necessary; I simply grabbed one of the last testcases that I pulled out of a bug report and transformed into a JUnit test. More than one person has asked for a simpler example showing the flavor of a JUnit test. So...
Try the following:
1) Download JUnit, grab "junit.jar" and put it in your classpath.
(See www.junit.org or junit.sourceforge.net)
(I just stick junit.jar in /Library/Java/Extensions/ because I use it so much)
2) Cut and paste the file below into someplace convenient like /tmp/TrivialTest.java
3) cd /tmp/
4) javac TrivialTest.java
5) java TrivialTest
To see what a failure looks like, change the sense of one of the asserts so that it says myPi > 4.
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.