... (...) I had the same problem previously. So i created a method boolean compareString(s1, s2); That's exactly what I did do, Amit. Great idea! Thanks all...
DbUnit is a JUnit extension (also usable from Ant) targeted for database-driven projects that, among other things, puts your database into a known state...
Hi, I was trying to look at the junit code after having read the cook's tour, and had a question (or two): What is the significance of the Protectable...
<snip /> ... Check out junit.extensions.TestSetup. That will show you the motivation for refactoring to Protectable. Perhaps it is not the best name, but I...
Hello, Is there any tips to test out error handlers? I have a number of exception handling code, let say they are SQLException. In general those code get poor...
Check out the JUnit FAQ. If you want to test the exception handling code, then the general approach is this: 1. Simulate throwing the SQLException so that the...
... Mock as be used for this. If you can mock the object that can throw the exception, you can configurate to just throw it when called. Then you can test...
Hi folks! While using Visual Age I developped code to test software using JUnit. I used the command Testrunner.run(Testtreiber.class) to start JUnit inside my...
Hi When Im doing exception testing it may look like this: public void testBadData() { try { object.generateBadData(); fail( "BadDataException should have been...
Hi all, Pleased guide me in writing the JUnit test cases for the methods that does Insert Update and Delete to Databases. There are the methods that brings the...
first of all hello all of frinds of this group. friends, i just joined the company , and working as a soft.testing engg. i m totaly fresh. here is project on...
dnyanesh mankulwar
dnyan123@...
Mar 4, 2003 4:23 pm
7112
... This seems to me tantmount to saying that something is wrong with agressive refactoring promoted by the XP process. I change interfaces all the time, but I...
... should be ... interfaces that ... wrong - either ... something ... don't ... need ... good ... modifiable, ... Also on point is the fact that, as an...
... The first step is to read this: http://www.owlriver.com/tips/smart/ If you have a specific question and follow the advice of the above web page, I'm sure...
Hi Ghanshyam , In Database accessor methods, dont test JDBC API. Hence use mockObject http://.mockobjects.com <http://www.mockobjects.com> . I have been using...
... Yup. That's how I do it, too. That tests that an exception is thrown when it should be. I think the question was how to test that exceptions are handled...
Steve, I am using Emacs to debug my tests. The key is that you can't use the SwingRunner. Just use the normal non-GUI runner and you can debug your TestCase...
Joerg Schmuecker
java-junit@...
Mar 5, 2003 8:30 am
7119
Wolfgang: I use JUnit with Ant. I had encountered a similar error message earlier. I had to add the right classpath. I guess you may have the same problem. You...
Let me give a more concrete example. try { // execute my sql query ResultSet rs = sql.executeQuery(); while (rs.next()) { String name = rs.getString("name"); ...
... be ... I think we need to define terms a little. Interface in this context is a little overloaded. I took it to mean the conceptual boundary between any...
... How about extracting your error handling code and testing it by itself: public class Foo { public void bar() { try { // execute my sql query ResultSet rs =...
hi! I'm serialising a class and sending it over a socket to another machine which does not have the classes of the agent. So I'm making two trips, first I'm...
... While this is not a bad idea in general (especially to avoid duplicate code, or to test more complex handlers), one may still want to make certain that the...
... What you want to mock is probably the statement and connection, not the result set (since you never need the result set to throw an exception). This...
... Yes, there are some pre-made mocks for JDBC stuff, including the ability to throw exceptions. If you do need to test handling of exceptions thown by...
... I would write a test from the receiving machine's perspective. That is, the classpath used for the test would not include the JAR file. Instead, the test...
"Could not invoke suite method" could happen for several reasons. As Kumar said, it could be a classpath issue which boils down to a NoClassDefFoundError......
Also, there may be some cross dependancy causing the class to not load properly. Check and make sure that any dependant libraries (jars/classes) are the same...