... You can Google for "Parameterized Test Case" or search the archives for it. You will find lots of information. * -- Jason Rogers "I am crucified with...
13244
J. B. Rainsberger
nails762
Apr 7, 2005 7:35 pm
... _JUnit Recipes_, recipe 4.8. -- J. B. (Joe) Rainsberger Diaspar Software Services http://www.diasparsoftware.com Author, JUnit Recipes: Practical Methods...
13245
J. B. Rainsberger
nails762
Apr 7, 2005 7:35 pm
... Yes: collect the tests yourself with suite(). ... You could use GSBase's OrderedTestSuite. A bigger question: if you don't want to inherit the tests, then...
13246
J. B. Rainsberger
nails762
Apr 7, 2005 7:44 pm
... If you want to test the action, then I recommend coding it in a way that the important behavior doesn't know that data is in the session. Example: MyAction...
13247
Arun J
jayarunkumar
Apr 8, 2005 5:44 am
Thanks folks for your inputs. Lots of discomfort using jUnit, is it only me..:-( Though this is not my usecase. Do not get carried away by this example..I am...
13248
Ilja Preuss
ipreussde
Apr 8, 2005 6:52 am
... With all due respect, this hierarchy looks a little big to me. I would think about using composition in some of those places. (Or aren't you actually ...
13249
Arun J
jayarunkumar
Apr 8, 2005 9:03 am
Thanks for taking time..find my response inline. ... JAK: as I have mentioned this heirarchy is just a sample...in reality it could be even deeper. Let us not...
13250
Ilja Preuss
ipreussde
Apr 8, 2005 11:14 am
... Don't know what "JAK" means, and acronymfinder doesn't either... :o Anyway, in my opinion it already is too deep for a sound OO design. ... Why not? I find...
13251
Ilja Preuss
ipreussde
Apr 8, 2005 1:22 pm
Redirected to Junit list... ... OK... :) ... I still don't understand why you'd have more than one test class be dependent on those lookups at all. Sounds like...
13252
Klaus-Peter Berg
klausbergpro...
Apr 9, 2005 3:53 pm
Hi, I have used JTestCase for a while (http://jtestcase.sourceforge.net/) but then we decided to hard code the parameters because there was no need for a lot...
13253
rubbinio
Apr 9, 2005 3:53 pm
I need to test a class in which all the methods read via System.in. How can I fake the input so that I can automate my tests ? Any answer will be helpfull...
13254
J. B. Rainsberger
nails762
Apr 9, 2005 6:30 pm
... If you only want to share common setup (common objects), then put that behavior in the setUp() method of an abstract TestCase class, then have all related...
13255
J. B. Rainsberger
nails762
Apr 9, 2005 6:31 pm
... The design /is/ the point of the discussion. If you're not interested in discussing that, then please stop. If the hierarchy were even deeper, that would...
13256
J. B. Rainsberger
nails762
Apr 9, 2005 6:37 pm
... Right now you're using a BufferedReader that talks to System.in. If you had a BufferedReader that talks to a StringReader, then you could fake all the...
13257
Harald M. Muller
harald_m_mue...
Apr 9, 2005 7:21 pm
... Since JDK1.1, there is a method System.setIn(InputStream in) Just call this in setUp() to get Input from somewhere else (a FileInputStream or a...
13258
rubbinio
Apr 10, 2005 3:29 am
Thx Harald for your answer but I managed to find a solution myself after a loot of seraching on the net and a lot of reading I came up with my own solution....
13259
rubbinio
Apr 10, 2005 3:31 am
Unfortunatelly I can not change the code as this was an Assignemnt in a Quality Assurance course and the trick was to find a way to test it as it is. ... ...
13260
noam_eitan
Apr 10, 2005 7:57 am
hi. thanks for your reply. let me tell u what I mean by the word "scenario". the user is doing the following steps, and I want to check the whole process : 1....
13261
Harald M. Müller
harald_m_mue...
Apr 10, 2005 8:25 am
Well - you did use the System.setIn() as I explained. For the rest, using the pipe mechanism is of course also possible and ok, it is only more work than...
13262
Paul King
paulk@...
Apr 10, 2005 10:59 am
You have two basic approaches: perform an "integration test" or a "unit test with stubs/mocks". With an integration test you walk your application through all...
13263
Arun J
jayarunkumar
Apr 10, 2005 7:44 pm
IIja/Joe, Thanks folks..Now I have a (kind of) flat structure for tests..with one abstract parent without any testXXX under which all tests would be. My...
13264
Ilja Preuss
ipreussde
Apr 11, 2005 10:04 am
... Doesn't sound ideal, but like it's probably the best you can do if you don't want to touch the app's design. ... No rudeness implied. Still, please notice...
13265
Andrew McDonagh
andy_ipaccess
Apr 11, 2005 10:13 am
... Indeed. Its always tricky adding unit tests to existing code - made even harder when that existing code is sub optimally designed. It would be worth Arun...
13266
Arun J
jayarunkumar
Apr 11, 2005 10:31 am
well.. the app code is neither legacy nor a 'untouchable39; piece. If there is a design flaw, we can change it but that is not the case here. Becoz jUnit does...
13267
Andrew McDonagh
andy_ipaccess
Apr 11, 2005 12:33 pm
... Sorry, I should have explained a bit more... By 'legacy39; we simply mean code that is not covered by unit tests, not code that is old. I've been reading...
13268
Amir Kolsky
kolsky
Apr 11, 2005 7:25 pm
System.in is a stream. Refactor the classes to accept an input stream and then pass in a memory stream. Amir Kolsky XP& Software...
13269
Alain Ravet
alain_ravet
Apr 11, 2005 7:25 pm
Rubbinio, You can redirect System.in: public class SystemInRedirecting extends TestCase{ public void test_allFeaturesInOneTestMethod() throws IOException { ...
13270
Daniel Or
daniel_or_else
Apr 11, 2005 7:25 pm
Hi. When I run my tests using class reloading I get into a java.lang.OutOfMemoryError. My questions are: 1. What is the connection between using class...
13271
davidnovogrodsky
davidnovogro...
Apr 11, 2005 7:25 pm
Hello, I am on a project that is using jUnit to test j2ee components. I am using a mock HttpServletRequest to test a class that extends the ...
13272
umciggy2000
Apr 11, 2005 7:26 pm
Hi! One way to test if two objects have tha same data in a test is to use the assertEquals(Object a, Object b) method and then implement equals() and...