Linked Questions

31 votes
3 answers
36k views

I am very new to mocking framework, and my work needs mocking framework to finish unit testing. In the current code base i could see above 3 frameworks are being used in different places for unit ...
keya's user avatar
  • 2,158
130 votes
5 answers
75k views

I'm investigating which mocking framework to use for my project and have narrowed it down to JMockit and Mockito. I notice that Mockito was voted "the best mock framework for Java" on Stackoverflow. ...
user avatar
28 votes
5 answers
17k views

I would like to know what's the best approach to test the method "pushEvent()" in the following class with a jUnit test. My problem is, that the private method "callWebsite()" always requires a ...
flash's user avatar
  • 6,840
19 votes
7 answers
7k views

Can you explain in a few sentences: Why we need it / why they make our life easier ? How to unit-test [simple example in Java] ? When do not we need them / types of projects we can leave unit-testing ...
EugeneP's user avatar
  • 12.1k
22 votes
4 answers
10k views

Recently I made the switch to Mockito framework and am very happy with it (see also blog-post). The switch from EasyMock to Mockito was very straightforward and I managed to make the tests down ...
manuel aldana's user avatar
11 votes
7 answers
10k views

for me I will answer this question based on my experience. so if I'm gonna start new project I will use the following technologies: AndroMDA as MDA framework. Spring (DI, Interceptors, Quartz, ACEGI, ...
Ali Abdel-Aziz's user avatar
8 votes
6 answers
11k views

Is there a way to mock object construction using JMock in Java? For example, if I have a method as such: public Object createObject(String objectType) { if(objectType.equals("Integer") { ...
Grundlefleck's user avatar
9 votes
5 answers
3k views

I am aware RabbitMQ is written in Erlang and thus can't be embedded in a JVM like we would do with the ActiveMQ JMS broker for exemple. But actually there are some projects that are done in another ...
Sebastien Lorber's user avatar
4 votes
4 answers
9k views

I am updating a few tests. The Before gets the sftp session. For this, the username and password have been hardcoded in the properties file. Due to security reasons, the password cannot be checked in ...
Mary's user avatar
  • 1,625
4 votes
4 answers
5k views

Would anyone suggest a Mock library and provide the reasoning behind the pick? I am looking to introduce one to the existing code base. Thanks.
Candy Chiu's user avatar
  • 6,709
2 votes
3 answers
6k views

Which mocking framework is preferred for testing EJB's (specifically Message Driven Beans), I'm looking at MockObjects, easyMock, MockEJB and mockito but open all. I've not used mocking framework ...
scottyab's user avatar
  • 24.1k
4 votes
2 answers
5k views

The more I read mock example, the more I get confused... I have classA method eat() that calls FatDude class eatThemAll() public class classA { FatDude dude = new FatDude(); public String ...
Meow's user avatar
  • 19.3k
1 vote
6 answers
5k views

Our application has server/client side. The client supports both offline and online work mode. So I need to test the client when server down, regain connective. Question comes. How to simulate server ...
Joseph's user avatar
  • 826
2 votes
3 answers
890 views

IMO one of the main characteristics of a good TDD is: testing your class (or actually unit) in isolation. When you do so, you are able to actually test single behavior in each test -- only one test ...
ekeren's user avatar
  • 3,478
3 votes
3 answers
4k views

I have a class A which instantiates an object from class B internally. That second class has lots of external side-effects, e.g. it uses a network connection. public class A { private B b; ...
oneself's user avatar
  • 40.8k

15 30 50 per page