Menu

#63 Generated mocked dependencies should examine superclass

Version 2.4.2
wont-fix
mocksupport (2)
5
2015-01-22
2012-02-21
Anonymous
No

When generating a test class, MoreUnit allows the generation of mocked dependencies based on fields in the class under test. However, if the class under test extends a superclass, dependencies for the superclass's fields are not generated.

The wizard offers to create dependencies based on the superclass's setX(...) methods, but no dependencies are generated.

To reproduce:

1. Create a class SuperClass with a private String foo, and getFoo(), setFoo(String) methods
2. Create a subclass SubClass extends Superclass
3. Generate a test class for SubClass
4. Confirm the 'Dependencies To Mock' step offers to create a mock based on the setFoo(String) method
5. Select Finish

No mocked dependencies will be created in the test class.

Discussion

  • Nicolas Demengel

    Hi Sam,

    Thanks for your report! However I could not reproduce your problems (and I tried hard) so maybe I miss some information. Would it be possible for you to post the code that caused the problem (once anonymized of course), together with your MoreUnit settings?

    By the way: we released a new version this night, you may want to give it a try.

    Regards,
    Nicolas

     
  • Nicolas Demengel

    • milestone: --> Version 2.4.2
     
  • Nicolas Demengel

    • status: open --> wont-fix
     
  • Nicolas Demengel

    I tried and could not reproduce it. Closing it.

     

Log in to post a comment.