... Ilja, I think the original OP is thinking about all possible combination of input (positive/negative values). I am also thinking that he has left aside the...
Hi Ilja, Thanks for your kind response... Here I am providing the sample test script that we are using, please suggest me the best way to test this kind of...
Hi Raghava, You might be interested in looking at some articles on pair-wise testing. Here is a link I found after a quick search on google that explains the ...
First, you probably should get rid of a lot of the boiler plate code in your test. The catch block is not needed - just let the exception propagate, JUnit will...
Hi Raghava, It seems that your test case is just checking whether or not an exception is thrown. Typically when testing, you want to check the behavior of the ...
Hi Ilja, Thanks for your kind response. Shall I have to write same method once agian for different set of data(for negative cases) Please answer this query ...
I just uploaded an update to the Dependent Object Framework (DOF) http://sourceforge.net/projects/dof/ Description: http://www.junit.org/node/308 In a...
Hi there. I know this is not the really correct place for this, but what I actually need is an advice from people who are in the unit testing business in JAVA...
... This will result in very brittle tests because it will overly constrain the number and order of calls and exact parameter values, many of which will be...
Hi... is it possible to mark a testmethod A to depend on (or to be executed after) a testmethod B? Probably by a specific annotation or something else? I'd...
... In my not so humble opinion, a complex method is a serious design smell - let alone a complex constructor. So I'd rather change the design so that it's not...
AFAIK this feature is replacement to TestSuite in JUnit 3.8. But it is less flexible then TestSuite. In JUnit 3.8 you have an option to add some methods from...
I have some ideas of little improvements of JUnit. See, topics "Filter improvement", "TextListener improvement", "FailedBefore exception", "Parameterized and...
I was very exciting to know that JUnit 4 has Parameterized feature. I have used almost exact the same mechanism in JUnit 3.8 for making the parametrized test....
I want to correct my last e-mail in this Thread. Test method of calculator should be public void testNegative() throws Exception { try { calc.sqrt(-1); ...
Currently TextListener on every event simply writes to standard output (or to PrintWriter). If junits or application aslo writes its logs to standard output...
In JUnit 3.8 there was difference between assertion error (assertTrue(flag) fails, for example) and exception (unexpected exception thrown). It was indicated...
Request class has method public static Request method(Class<?> clazz, String methodName); which suppose to run only methodName from the class. I think it would...
In the @Test annotation there is expected() parameters that is used to indicate expected exception. It should be considered to enable check also the cause of...
There is 2 runners that did the same work. More precisely, all work that can be done by Parameterized runner can be done by Theories runner. I think it should...
Hello Ilja! First of all I want to answer on your direct question - yes you should write different method for negative case because its code is completely...
... For unit tests, yes. For integration/functional tests, it's pretty common. Stefan, for what it's worth, TestNG lets you specify such dependencies, e.g. ...
However in JavaDoc of Sortable class is clearly stated that "Test sorting should not be used to cope with order dependencies between tests." So one can...
... smell ... pretty common. ... In JUnit 3.8 there is workaround. You should specify method you want to run as first, and dependent method as second in the...