santhoshjoy, JUnit does not have a built-in mocking framework. You can use Mockito with JUnit, so you don't need to give up your Mockito code. David Saff ... ...
Steve, I think we over-aggressively deprecated withBefores. It is unlikely to be truly removed any time soon. Thanks, David Saff ... [Non-text portions of...
David, thanks for the answer. In that case, I'll stick to the current solution. Best Regards =========== Steve Hostettler ... [Non-text portions of this...
All, there's now a beta snapshot available on https://github.com/KentBeck/junit/downloads Direct link:...
23837
Dawid Weiss
dawid.weiss@...
Apr 18, 2012 8:20 am
Hi everyone, So, AllDefaultPossibilitiesBuilder has ignoredBuilder() before annotated builder as shown here: @Override public Runner runnerForClass(Class<?>...
Dawid, Which of these situations are you targeting? Situation 1: @RunWith(MyCustomSuite.class) @SuiteClasses({A.class, B.class, ...}) public class Suite { ......
23839
Dawid Weiss
dawid.weiss@...
Apr 18, 2012 10:55 pm
This would be Situation 2. I have a custom runner (not descending from JUnit) specifically to target things like reporting (that is -- I would like to know...
Dawid, If there was a way to attach a listener implementation to a suite, would that give you what you're looking for? Runner is a fairly heavy-weight ...
k.l, These are important and common questions, so often a Google search reveals some helpful resources. For example, you might want to start with ...
23842
Dawid Weiss
dawid.weiss@...
Apr 20, 2012 10:49 pm
Hi David, Yeah, well... I already wrote my Runner implementation -- http://labs.carrotsearch.com/randomizedtesting.html There are benefits of having a custom,...
Not a perfect solution, but you could add your own custom annotation for this purpose. Your custom runner would check if the target class has this annotation,...
23844
Dawid Weiss
dawid.weiss@...
Apr 21, 2012 7:32 am
Thanks. Yes, I could do this, like I did with other things (for example I support meta-annotation @TestGroup which allows one to define custom annotations like...
23845
Andres Olarte
olarte.andres@...
Apr 22, 2012 6:15 pm
Hello all, I'm looking for a good way to keep scenarios stored outside of the unit tests. Basically I'm thinking of some way to do black box testing based on...
Hello Andres. Maybe an XML file could be the simplest and easy way. <data> <value> <input1>1</input1> <input2>2</input2> <output1>3</output1> </value> <value> ...
This problem has been solved many times already. For example, take a look at JBehave. It uses JUnit to run tests that are specified in Given/When/Then format....
23849
Dawid Weiss
dawid.weiss@...
Apr 23, 2012 5:37 am
Parameterized test runner is probably what you're after. The default one in JUnit does not support naming parameters (several folks provided patches, they're...
Dawid, Imagine a developer being dropped into a new project. There are JUnit tests using custom runners she's never seen, and some of those are failing. She'd...
23852
Dawid Weiss
dawid.weiss@...
Apr 23, 2012 7:44 pm
... Like I mentioned I can understand this rationale but I still differ in opinion. If there are custom runners that fail to comply with @Ignore contract they...
... Ah, I'd forgotten that you wanted a description of all the contents. Does your scheme allow you to use a RunnerBuilder other than the default ...
23854
Dawid Weiss
dawid.weiss@...
Apr 23, 2012 8:29 pm
... See, that's the problem -- I have no control over what the use case of invoking the suite class is. It can be invoked from Ant, Eclipse or somewhere else....
So, with an extra suite-wrapping step, you can use whatever ordering of builders you want: @RunWith(MyCustomBuiltSuite.class) ...
23856
Dawid Weiss
dawid.weiss@...
Apr 23, 2012 9:14 pm
... they get upset at every spurious keystroke (even at the @Test annotation). That's fine, thanks for trying to help, David. I'll just live with this behavior...
Hi :) I'm working on a project for university, which is about a website to teach the basics of Java programming. It'll have some programming lessons and then...
That's a very general question. JUnit does not do much more than execute a bunch of tests and give you assertions to test. (It does give you some more "fancy"...
Hi All, I am new to junit. I am confused how to run the parameterized method. Ex: @Test public void add(int a,int b){ System.out.println("Result = "+(a+b)); } ...
"Must" read this: http://www.mkyong.com/unittest/junit-4-tutorial-6-parameterized-test/ It´s a good and simple explain by example. Greetings -- M.P.7.O. ...
You need to use the ParameterizedTestRunner. Here's a blog on how to do that: https://blogs.oracle.com/jacobc/entry/parameterized_unit_tests_with_junit ... -- ...