This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes AssertTrue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "AssertTrue" Watch "AssertTrue" New topic
Author

AssertTrue

Alan Jackson
Greenhorn

Joined: Oct 26, 2004
Posts: 26
How does the AssertTrue function work?

I have AssertTrue("error",variableboolean1); which to the best of my knowledge should work. Do I need to import something or do something to make it work?
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
There aren't "functions" in Java. There are methods on classes. Of which class is "AssertTrue()" a method?

JUnit has a method assertTrue() on its Assert class. Actually, there are a couple of different signatures. If that's the one you want, you need to import junit.framework.Assert .


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
 
 
subject: AssertTrue
 
Similar Threads
how to test drive this problem?
Boolean Logic
Junit inn Action: JUnit clash in Eclipse?
Assertion for Date
how to achieve the "like" effect of SQL in java