Preconditions:
-- Java/Code Style/variable conventions/local variables prefix and/or suffix is non-empty
-- Java/Code Style/variable conventions/field prefix and/or suffix is non-empty and different to local variables prefix/suffix
-- MoreUnit/Mock Generation/Mock Style is set to "jMock" (as per proposed template (attached)
To reproduce:
-- open context menu in editor of a class with no test class that has some setter methods.
-- select moreunit/generate tests
-- click next to get to mock dependencies page
-- click select all,
-- click finish.
Expected:
-- the name chosen for the "mockery" field matches the prefix/suffix preferences for FIELD
-- references for the mockery field match the declaration.
Actual:
-- the name chosen for the "mockery" field matches the prefix/suffix preferences for LOCAL VARIABLE
-- references for the mockery field use the bare template id (because the variable mapping context is not maintained between template invocations)
Hi Joseph,
Tanks for the report (and for the other ones as well). Actually I don't think that field names match the prefix/suffix preferences for LOCAL VARIABLE. I would say that no prefix/suffix is applied at all (I try to reproduce your problem with your JMock template, without success).
Anyway, we had a hard time understanding how to use Eclipse templates to implement the features related to mocking frameworks, and we clearly let user settings on the road :-)