... (...) 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...
7102
manuel_laflamme <m...
manuel_laflamme
Mar 3, 2003 3:02 pm
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...
7103
nthali <nilesh.tha...
nthali
Mar 3, 2003 11:15 pm
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...
7104
J. B. Rainsberger
nails762
Mar 3, 2003 11:55 pm
<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...
7105
TungWaiYip <tungwa...
TungWaiYip
Mar 4, 2003 4:35 am
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...
7106
J. B. Rainsberger
nails762
Mar 4, 2003 4:43 am
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...
7107
Dave Astels <dave@...
astelsd
Mar 4, 2003 12:43 pm
... 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...
7108
wolleontour <wolfg...
wolleontour
Mar 4, 2003 4:21 pm
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...
7109
Erik Mattsson
erikmattsson73
Mar 4, 2003 4:21 pm
Hi When Im doing exception testing it may look like this: public void testBadData() { try { object.generateBadData(); fail( "BadDataException should have been...
7110
Patil, Ghanshyam
sachin4u1977
Mar 4, 2003 4:22 pm
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...
7111
dnyanesh mankulwar
dnyan123@...
Mar 4, 2003 4:23 pm
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...
7112
Curt Sampson
cjstokyo
Mar 4, 2003 4:23 pm
... 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...
7113
J. B. Rainsberger <...
nails762
Mar 4, 2003 4:28 pm
... should be ... interfaces that ... wrong - either ... something ... don't ... need ... good ... modifiable, ... Also on point is the fact that, as an...
7114
Erik Hanson
hanson_erik
Mar 4, 2003 5:41 pm
... 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...
7115
Shailesh Mangal
sxm20
Mar 4, 2003 7:48 pm
Hi Ghanshyam , In Database accessor methods, dont test JDBC API. Hence use mockObject http://.mockobjects.com <http://www.mockobjects.com> . I have been using...
7116
Dave Astels <dave@...
astelsd
Mar 4, 2003 9:58 pm
... 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...
7117
J. B. Rainsberger
nails762
Mar 4, 2003 10:57 pm
Can you show us the source of your test? Thanks. So said wolleontour <wolfgang.weber@...> on 3/3/2003 -------------------- ... J. B. Rainsberger, ...
7118
Joerg Schmuecker
java-junit@...
Mar 5, 2003 8:30 am
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...
7119
Kumar Aravamudhan
aravam
Mar 5, 2003 3:08 pm
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...
7120
Tung Wai Yip
TungWaiYip
Mar 5, 2003 3:08 pm
Let me give a more concrete example. try { // execute my sql query ResultSet rs = sql.executeQuery(); while (rs.next()) { String name = rs.getString("name"); ...
7121
Kevin Klinemeier
zipwow
Mar 5, 2003 3:08 pm
... 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...
7122
Lauren Bish
gs_nomad
Mar 5, 2003 3:08 pm
... From: "Curt Sampson" <yahoo_sucks@...> ... Refactoring does not necesarily equate to changing interfaces. ... If change is necessary then it is...
7123
Erik Hanson
hanson_erik
Mar 5, 2003 3:30 pm
... 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 =...
7124
Aditya Yadav
adityayadav76
Mar 5, 2003 4:37 pm
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...
7125
Kathy Van Stone
KathyVS
Mar 5, 2003 4:48 pm
... 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...
7126
Kathy Van Stone
KathyVS
Mar 5, 2003 4:48 pm
... 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...
7127
Dave Astels
astelsd
Mar 5, 2003 5:33 pm
... 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...
7128
Mike Clark
clarkware
Mar 5, 2003 5:35 pm
... 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...
7129
Jason Rogers
jacaetev
Mar 5, 2003 5:43 pm
"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......
7130
David D. Lucas
ddlucas
Mar 5, 2003 9:44 pm
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...