JavaPins - Stories tagged with mockito
2
Pins

Mockito-like automocking and optional autowiring in JMock « Dan Haywood

published 540 days, 20 hours, 47 minutes ago posted by anishaanisha 576 days, 20 hours, 8 minutes ago
Thursday, October 25, 2012 5:42:37 PM GMT Wednesday, September 19, 2012 6:21:42 PM GMT
I’m running my little TDD course again, and (as usual) it’s given rise to another small idea to make unit testing easier: provide Mockito-like automocking (using a @Mock annotation), and in addition perform autowiring of all mocks into the class under test. Now, to be honest, the difficult bit, automocking, is already in the JMock codebase, but as of this writing it’s still not been re... (more)
category: Java EE | clicked: 6 | comment | | source: danhaywood.com
tags: automocking, JMock, mockito
1
Pins

Agile Engineering Techniques: Mocks And Stubs - Understanding Test Doubles With Mockito

posted by anishaanisha 590 days, 18 hours, 58 minutes ago
Wednesday, September 05, 2012 7:31:33 PM GMT
A common thing I come across is that teams using a mocking framework assume they are mocking. They are not aware that Mocks are just one of a number of 'Test Doubles' which Gerard Meszaros has categorised at xunitpatterns.com. (more)
category: Java EE | clicked: 0 | comment | | source: johndobie.blogspot.in
tags: mockito, mocks, stubs
1
Pins

caught Somewhere In Time = true;: mockito tutorial video

published 683 days, 23 hours ago posted by vinaykumarvinaykumar 684 days, 45 minutes ago
Monday, June 04, 2012 3:29:40 PM GMT Monday, June 04, 2012 1:45:06 PM GMT
I recently find a very good screencast about mockito, a great mocking framework. There it is in three parts: (more)
category: Java EE | clicked: 1 | comment | | source: scaramoche.blogspot.in
tags: mockito, Tutorial, Video Tutorial
1
Pins

helloopensource / Mockito

published 825 days, 3 hours, 5 minutes ago posted by vasantvasant 826 days, 1 hour, 8 minutes ago
Sunday, January 15, 2012 11:24:41 AM GMT Saturday, January 14, 2012 1:21:40 PM GMT
This Tutorial will show you how to write a simple Mockito based Unit Test Main Learning's After following this tutorial you will learn how to: Download and install Mockito Use Mockito in Eclipse Create a Mockito based Unit Test Compile and run the ~Mockito based Unit Test Versions used: Eclipse SDK 3.3.1 JDKversion 1.5.0_12 Mockito (more)
category: JAVA | clicked: 1 | comment | | source: helloopensource.pbworks.com
tags: mockito
1
Pins

Mockito Tutorial

published 823 days, 23 hours, 48 minutes ago posted by vasantvasant 826 days, 1 hour, 15 minutes ago
Monday, January 16, 2012 2:42:12 PM GMT Saturday, January 14, 2012 1:15:17 PM GMT
In this tutorial you will show how to write a simple Mockito based Unit Test by following this steps: Download a stable version of Mocki http://code.google.com/p/mockito/ Extract mockito-1.1.2.zip to a folder Open Eclipse for Java IDE Create a new project (name it helloMockito) Create a ITranslator interface i.Make sure ITranslator interface has the following code ii.package org.helloopensource.greetings; public interface ITranslator { public abstract Strin... (more)
category: Java EE | clicked: 6 | comment | | source: www.ajaxprojects.com
tags: mockito, Tutorials
1
Pins

5 minute Mockito | Javalobby

published 823 days, 23 hours, 48 minutes ago posted by vasantvasant 826 days, 1 hour, 16 minutes ago
Monday, January 16, 2012 2:42:12 PM GMT Saturday, January 14, 2012 1:13:39 PM GMT
Some might find EasyMock a little frustrating and perhaps even too convoluted - here's a look at Mockito, a similar framework but with less complex use leading to quicker and simpler mock testing. What is Mockito? Apart from having a catchy name, Mockito attempts to think about mocking in a different way. Stated as an easy and lightweight alternative to EasyMock, Mockito is what you might call a Test Spy, and it seems to live up to all three of those ideologies. From its feature list, yo... (more)
category: Java EE | clicked: 3 | comment | | source: java.dzone.com
tags: example, mockito
1
Pins

schuchert - Mockito.LoginServiceExample

published 825 days, 3 hours, 5 minutes ago posted by vasantvasant 826 days, 1 hour, 18 minutes ago
Sunday, January 15, 2012 11:24:41 AM GMT Saturday, January 14, 2012 1:11:53 PM GMT
I'm assuming you can download Mockito and get it in your classpath. So I'll start with tests that implement some of the requirements from here. However, in a nutshell: Download mockito-all-1.7.jar from here. Create a new Java project in your favorite IDE Add that jar to your project's classpath Add JUnit 4 to your project's classpath Writing The Tests What follows is a series of tests to get enough production code written to suggest a better implementation. The first purpose of this tutorial is to de... (more)
category: JAVA | clicked: 0 | comment | | source: schuchert.wikispaces.com
tags: example, LoginService, mockito
1
Pins

Mockito – some programming examples « Ralf Wehner's Blog

published 823 days, 23 hours, 48 minutes ago posted by vasantvasant 826 days, 1 hour, 22 minutes ago
Monday, January 16, 2012 2:42:12 PM GMT Saturday, January 14, 2012 1:07:39 PM GMT
My favorite mocking library in JAVA is Mockito. It is absolutely great! So, in this post i want to show some programming examples how to use Mockito in your JUnit test code. I don’t want to write a tutorial or a howto, this is just a summary of programming examples for JAVA programmers who are familiar with Mockito. Capturing method arguments from Mocks for further assertions: If you are using the version 1.8 and above you can use the ArgumentCaptor. The ArgumentCapture gives you a way to get one or ... (more)
category: JAVA | clicked: 3 | comment | | source: rwehner.wordpress.com
tags: mockito
1
Pins

Mockito Example (Java Mocking Framework)

published 823 days, 23 hours, 48 minutes ago posted by vasantvasant 826 days, 1 hour, 24 minutes ago
Monday, January 16, 2012 2:42:12 PM GMT Saturday, January 14, 2012 1:06:18 PM GMT
Recently I was lamenting how much I liked Moq for C# and its API. I like that is uses lambdas and generics and I think both the interface and general approach are great. Someone I follow on twitter, @tieTYT, suggested that I should give Mockito a try. It is a mocking library for Java, written by Szczepan Faber and friends. Well I gave it a try and I found it to be an excellent Mocking framework similar in spirit to Moq and it worked well while not requiring lambdas. I was in a mood, so I went ahead a... (more)
category: JAVA | clicked: 8 | comment | | source: blog.objectmentor.com
tags: example, mockito
1
Pins

Mockito Example

published 823 days, 23 hours, 48 minutes ago posted by vasantvasant 826 days, 1 hour, 24 minutes ago
Monday, January 16, 2012 2:42:12 PM GMT Saturday, January 14, 2012 1:05:32 PM GMT
Mockito compared to EasyMock seems to be more easily and has more flexibility. First it's able to mock up interfaces as well as classes. You doesn't need additional Jar libraries. Furthermore there isn't any replay mode. First you have to stub and afterwards you have to verificate your mocked classes or interfaces. Further examples and advantages could be read here. Have a look at the following example: Add the Mockito dependency to your pom.xml: org.mockitomockito-alltest ... (more)
category: Java EE | clicked: 5 | comment | | source: developers-blog.org
tags: example, mockito
1
Pins

Mockito in six easy examples

published 821 days, 18 hours, 2 minutes ago posted by vasantvasant 826 days, 1 hour, 26 minutes ago
Wednesday, January 18, 2012 8:27:48 PM GMT Saturday, January 14, 2012 1:04:15 PM GMT
PrevNextWin big with Specification by Example: 3 Feb 2012 “So much challenging and interesting information on eliminating waste in software development. Everyone should join.” Morgan Johnston, Agile Lead/Developer, DigiterreGet discounts on books, conferences and workshops I speak at a lot of conferences and I often get promo codes from the organisers for people to buy cheaper tickets. I kind of ignored this so far, but several people asked about this at a recent workshop, so I decided to set up a mail... (more)
category: Java EE | clicked: 10 | comment | | source: gojko.net
tags: J2ee, mockito