Menu

#113 Strange series of dialogs while creating test

Version 2.2.1
closed-out-of-date
5
2015-01-22
2013-05-22
No

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

Related

Bugs: #113

Discussion

  • Vera Henneberger

    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.

     
  • Vera Henneberger

    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.

     
  • David M. Karr

    David M. Karr - 2013-06-01

    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;

    public void doit() {
    
    }
    
    public int dosomething() {
        return 0;
    }
    

    }

    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.

     
  • Vera Henneberger

    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?

     
  • Vera Henneberger

    Can you attach your properties?
    {PROJECT}/.settings/org.moreunit.prefs

     
  • David M. Karr

    David M. Karr - 2013-06-02

    Here's .metadata/.plugins/org.eclipse.core.runtime/.settings/org.moreunit.core.prefs .

     
  • David M. Karr

    David M. Karr - 2013-06-02

    Here's .metadata/.plugins/org.eclipse.core.runtime/.settings/org.moreunit.prefs .

     
  • Vera Henneberger

    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.

     
  • Vera Henneberger

    • assigned_to: Vera Henneberger
    • Group: --> Version 2.2.1
     
  • David M. Karr

    David M. Karr - 2013-06-13

    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:

    assigned_to: Vera Henneberger
    Group: --> Version 2.2.1


    [bugs:#113] Strange series of dialogs while creating test

    Status: open
    Labels: generatetest
    Created: Wed May 22, 2013 07:32 PM UTC by David M. Karr
    Last Updated: Sun Jun 02, 2013 09:15 AM UTC
    Owner: Vera Henneberger

    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


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/moreunit/bugs/113/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #113

  • Vera Henneberger

    I 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.

     
  • David M. Karr

    David M. Karr - 2013-07-09

    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:

    I 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.


    Status: open
    Labels: generatetest
    Created: Wed May 22, 2013 07:32 PM UTC by David M. Karr
    Last Updated: Mon Jun 03, 2013 08:35 AM UTC
    Owner: Vera Henneberger

    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


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/moreunit/bugs/113/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #113

  • Vera Henneberger

    Hi David,

    until now we were not able to reproduce this problem.
    Did you have this symptom again?

    Vera

     
  • David M. Karr

    David M. Karr - 2013-11-25

    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:

    Hi David,

    until now we were not able to reproduce this problem.
    Did you have this symptom again?

    Vera

    Status: open
    Labels: generatetest
    Created: Wed May 22, 2013 07:32 PM UTC by David M. Karr
    Last Updated: Tue Jul 09, 2013 09:50 AM UTC
    Owner: Vera Henneberger

    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


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/moreunit/bugs/113/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Robocode: Bugs: #113

  • Nicolas Demengel

    I 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.

     
  • Nicolas Demengel

    • status: open --> closed-out-of-date
     

Log in to post a comment.