I'm in a class called "BandwidthManager" that I want to create a test for, so I execute "jump-to-test/source". It first gives me the initial "JUnit Test Case" dialog, where it specified the default src/test/java folder location, default package and class name. I checked to create the "setUp()" method. I clicked "Next".
On the "Dependencies to Mock" dialog, I selected "setCatalogHelper(CatalogHelper)", which is a dependency of the class. I didn't select any of the dependencies for the base class. I clicked "Next" again.
On the "Test Methods" dialog, of the 10 public methods of the class, I selected 8 of them and clicked "Finish". After this is where it starts to get strange.
The next dialog that appears looks like the original "Junit Test Case" dialog. It appears to have all the original settings, but the only operation button that is sensitive is "Cancel". I clicked "Cancel".
That dialog went away and was immediately replaced with the same dialog again.
I ended up clicking "Cancel" on this dialog 8 times (same as number of methods to test?) before the creation process seemed to actually proceed, resulting in the creation of the test class
Comment from David per mail (as this form had some hickups):
I neglected to mention some important points.
On those 8 unexpected dialogs, there were no warnings or error
messages that might have indicated why only the "Cancel" button was
available. This is perhaps moot, because even the first of these
shouldn't have appeared, as far as I can see.
And finally, when it finished creating the test class, it didn't
create any test methods, just the skeleton and the "setUp()" method
and the mock declarations.
Hi David, can you reproduce that problem? I have tried to reproduce the problem but the dialog does not appear.
It would be nice if you can provide some more information (which Mocking-framework did you choose) or a sample class.
I'm going to try again to edit this. I haven't had much luck with SourceForge.
Yes, it's very reproducible. I just tried it again with a smaller
class, and it behaves exactly the same. It gives me N useless
dialogs, where N appears to be the number of methods I want to
implement tests for.
I used Mockito for the mocking framework. I'll see if I can construct
a dummy class that still demonstrates this.
I just created the following class:
package com.somepackage;
public class Dummy {
private int stuff;
}
I jumped to test, which prompted for the test class creation. I
selected both "doit" and "dosomething" to test, and it gave me two
useless dialogs, exactly as the other test cases are doing.
I still can't reproduce the problem.
This is what I have done.
- created a new java project with maven style (src/main/java and src/test/java)
- created the sample class from your last comment
- configured project specific preferences for MoreUnit (JUnit 4, Mockito...)
- jumped to test
- in the dialog I chose setUp, nothing to Mock, both methods to create
when I click Finish everthing works as expected
What preferences/properties do you use?
Can you attach your properties?
{PROJECT}/.settings/org.moreunit.prefs
Here's .metadata/.plugins/org.eclipse.core.runtime/.settings/org.moreunit.core.prefs .
Here's .metadata/.plugins/org.eclipse.core.runtime/.settings/org.moreunit.prefs .
Hi David, I still can't reproduce the problem with the same settings.
I have tried with a fresh install and the sample above. You wrote "where it specified the default src/test/java folder location", but with the prefs you attached (and no project specific properties) it will not choose that folder (it will choose src/main/java).
Can you please check if you have any project specific settings because I do suspect that it is caused by some preferences/properties combination.
This morning I've seen the variation in behavior generating the same
test class. Earlier this morning I generated a test class and saw
this symptom again, and then later in the morning, while giving a demo
showing the process, I tried it again, and it didn't display the
symptom.
(Earlier I tried to write a comment about this on the Sourceforge
page, but it did what it did before, taking my submission but not
actually posting it.)
On Mon, Jun 3, 2013 at 1:35 AM, Vera Henneberger
gianasista@users.sf.net wrote:
Related
Bugs:
#113I have played around with it for a while but had no chance to reproduce the problem. You have written that you made a demo which showed this wired behaviour at least once. Can you upload that sample project so this might increase my chance to see the buggy behaviour too.
I had been able to repeat it with a simple class, but that was only
temporary. I've since seen it happen a few times, but not in a repeatable
pattern. I just tried creating a simple project to test this, and it
doesn't display the symptom.
On Tue, Jul 9, 2013 at 2:50 AM, Vera Henneberger gianasista@users.sf.netwrote:
Related
Bugs:
#113Hi David,
until now we were not able to reproduce this problem.
Did you have this symptom again?
Vera
I haven't had to use this for a while, so I don't know if it's still
happening.
On Sat, Nov 23, 2013 at 6:38 AM, Vera Henneberger
gianasista@users.sf.netwrote:
Related
Robocode: Bugs:
#113I tried again and could not reproduce this problem. I'm closing it as "out of date", but don't hesitate to open a new ticket if the problem reappears.