dhamini-poornachandra / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

Could this helpful code please be added to your API? #363

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I added the code and example on your page here:
http://code.google.com/p/mockito/wiki/HowToContribute

I find it really useful and use it in all my projects and hope you will agree, 
and maybe will use it in your API?

I am a huge fan of BDD and TDD and it would be great to contribute to your 
source if possible. My gmail account is timprentice@gmail.com if you would like 
to contact me.

Original issue reported on code.google.com by timprentice on 10 Aug 2012 at 9:55

GoogleCodeExporter commented 8 years ago
Added this in Rev 1985 under tag ISSUE-363 - Hope it is of use :)

Original comment by timprentice on 10 Aug 2012 at 11:36

GoogleCodeExporter commented 8 years ago
http://code.google.com/r/timprentice-extensions-api/source/checkout

Original comment by timprentice on 10 Aug 2012 at 11:37

GoogleCodeExporter commented 8 years ago
Hi,

1985 rev numbers are for local repositories, you should point to the changeset 
id :)
Also the autolinking feature of google code doesn't link to the correct 
changeset anymore with mercurial, linking to changesets id works.

Cheers,
Brice

Original comment by brice.du...@gmail.com on 20 Aug 2012 at 1:32

GoogleCodeExporter commented 8 years ago
Hi Brice,

As this is my first contribution to Mockito, I'm alittle hazy on the process 
and wondering if you can help? I've seen the 'GettingStarted' page, but not 
sure how to link to the changeset as you suggest. Could you advise? Many thanks 
in advance :)

Tim.

Original comment by timprentice on 20 Aug 2012 at 1:55

GoogleCodeExporter commented 8 years ago
I hope this has now been committed to changeset ced1ad000585 with tags 
ISSUE-363 and ISSUE363?

Original comment by timprentice on 20 Aug 2012 at 2:15

GoogleCodeExporter commented 8 years ago
:)

Well we haven't really updated this page recently. If see missing thing don't 
hesitate to submit a patch. Right now Szczepan holds the keys to the project, 
I'll talk to him about you, anyway if you feel you want to contact him directly 
:)

Also your revision ced1ad000585 does not show up on your cloned repository did 
you performed a push?

Also are you interested to work on a particular issue ?

Cheers,
Brice

Original comment by brice.du...@gmail.com on 20 Aug 2012 at 2:42

GoogleCodeExporter commented 8 years ago
Hi Brice,

I tried pushing to https://code.google.com/p/mockito/? but (as i expected) it 
returned a 403 with my google account criteria.

Also without success to 
https://timprentice@code.google.com/r/timprentice-extensions-api

Maybe I can submit my code in another way?

I'm interested in implementing a Control API like EasyMock inside Mockito.

I also enjoy development around annotations.

With Thanks,
Tim.

Original comment by timprentice on 20 Aug 2012 at 3:20

GoogleCodeExporter commented 8 years ago
yes of course you cannot push on the project's repository as you don't have the 
necessary rights.

Although you should be able to push to your clone, you should check your 
mercurial configuration. Did you use the googlecode password ?

I don't really know the Control API of easymock, but from what I gather isn't 
it already possible in Mockito with ordered verification 
(http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html#in_order_
verification) ?

Original comment by brice.du...@gmail.com on 21 Aug 2012 at 8:34

GoogleCodeExporter commented 8 years ago
With the EasyMock control API all mocks canbe controlled in one place (via the 
control) without having to keep track of them.

This makes tracking Mocks easy and means tests are automatically updated as new 
mocks are added to the control.

For example:
Test test = mockControl.createMock(Test.class);
Test2 test2 = mockControl.createMock(Test2.class);

mockControl.replayAll();
service.doSomething();
mockControl.verifyAll();

The Mockito Order API doesn't capture new Mocks as they are added to a Mock 
Test and they need to be manually kept in check.

For example, a new mock service is added to a unit test, and we want to 
automatically assert for an absence of behaviour on existing behavioural tests 
or where behaviour is exactly the same.

With good testing this is always the case, but we want to be 100% sure that 
this is the case. :)

To be honest my code changes are only a couple of classes (one unit test and 
the actual code involved) and I think they would be really useful for Mockito.

Would you like me to email them?

I can also send some 'real code' to illustrate why it's much easier to create 
tests with it?

I'd really like to see this code available as I've used it on several client 
projects and I can see it making a real difference to developers creating 
Mockito tests :)

Let me know your thoughts?

Going to recheck the mercurial configuration. I use Tortoise SVN regularly but 
have never used Tortoise HG or Mercurial before.

Cheers,
Tim.

Original comment by timprentice on 21 Aug 2012 at 9:56

GoogleCodeExporter commented 8 years ago
I have added the code to this JIRA ticket, in the interim to getting mercurial 
working and pushing my changes to the clone

Original comment by timprentice on 21 Aug 2012 at 9:57

Attachments:

GoogleCodeExporter commented 8 years ago
Success! Committed to Clone!
https://timprentice@code.google.com/r/timprentice-extensions-api/

I needed to use my googlecode 'generated' password! :)

Original comment by timprentice on 21 Aug 2012 at 10:05

GoogleCodeExporter commented 8 years ago
I wonder if this piece of code should be in some external project, like 
mockito-collections, or springockito.

https://code.google.com/p/mockito/wiki/RelatedProjects

How is the team feeling ?

Original comment by brice.du...@gmail.com on 6 Sep 2012 at 3:43

GoogleCodeExporter commented 8 years ago
Hey Tim,

It's hard to figure out what are the features you would like to implement in 
Mockito. Bear in mind that we don't want the EasyMock record-reply style and 
I'm not very keen on having control object that creates mocks. No other user 
has raised that feature for the past 4 years and I think there's a reason for 
it :)

Basically, we don't want to add features 'because some other mocking tool has 
it'. We would like to have clean and opinionated API. We would like to add 
features if we have a compelling use case to add them.

The control object you are referring to earlier is something that can be 
implemented separately from the core API, just like Brice suggested. I think 
it's best if you kick off a separate project that adds some extra functionality 
on top of Mockito. You can promote your project and get feedback from the 
community.

If you still want to Mockito to have some extra functionality it does not have 
yet, please send an email to the mailing list with a use case (e.g. present the 
real use case from real code that demonstrates the usefulness of the feature).

I'm tempted to close this specific ticket because it is not specific enough :)

Cheers!

Original comment by szcze...@gmail.com on 18 Sep 2012 at 9:13

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 18 Sep 2012 at 9:13