Questions tagged [easymock]

Easymock is a mocking framework for Java.

Easymock is an open source mocking framework for Java. It is used for creating mock objects and stubs for unit tests.

999 questions
-1
votes
1 answer

Inject the mock object where an actual implementation

I want to know what does this code mean: mathApplication.setCalculatorService(calcService); Why should I use an interface and make object from it? And what does this injection means? Here is my Tester Code: import org.easymock.EasyMock; import…
Wooopsa
  • 320
  • 1
  • 6
  • 22
-1
votes
2 answers

How to expect on method calls that has inline new instance creations in easymock

We have following code structure in our code namedParamJdbcTemplate.query(buildMyQuery(request),new MapSqlParameterSource(),myresultSetExtractor); and namedParamJdbcTemplate.query(buildMyQuery(request),new…
Arun Rahul
  • 565
  • 1
  • 7
  • 24
-1
votes
2 answers

Testing for void methods dependency using EasyMock

I have a Mainclass that I need to test which is dependent on other class. Now I am creating a mock for that class How to test void methods using easymock MainClass{ mainClassMethod(){ dependencyClass.returnVoidMethod(); //other code …
CSK
  • 83
  • 1
  • 10
-1
votes
1 answer

PowerMock and EasyMock

Is there a good reference material or links where one can find good resource for jUnit, PowerMock and EasyMock. Though good amount of information is available on the net , but is there a single point of access to all that information.
-1
votes
1 answer

testing void method with EasyMock

I need to test sorting class which takes a array of certain interface type. The interface only has one function which only compare an object and return some int value. I am trying to use easymock to test it with jUnit. I am stuck with two problems.…
Ramy
  • 305
  • 1
  • 5
  • 10
-2
votes
1 answer

How can I mock SOAPConnection and SOAPConnectionFactory

Here is my code: URL url = new URL(getURL()); SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance(); SOAPConnection soapConnection = soapConnFactory.createConnection();` response=soapConnection.call(soapMsg, url); I'm trying…
-2
votes
1 answer

ComparisonFailure in EasMock

I have below method which i want to test using EasyMock. public String createNode(Session session, String name) throws RepositoryException { Node root = session.getRootNode(); Node testNode = root.getNode( "content" ); if(…
Vivek Dhiman
  • 1,967
  • 6
  • 46
  • 82
-3
votes
2 answers

Mocked method still calls the real method

I have mocked the request and the response using the easymock, but its still going through each line in the request method and getting exception. Eg: public class helper{ public String getCB(){ Response response =…
-3
votes
1 answer

Write Test Cases For Protected Method

i am new in unit testing. please help me how to write a test cases for protected method using Junit and easy mock .
ErSyyedS
  • 230
  • 5
  • 9
1 2 3
66
67