This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Testing and the fly likes Error in JUnit while Running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Error in JUnit while Running" Watch "Error in JUnit while Running" New topic
Author

Error in JUnit while Running

Sanketh Kumar
Greenhorn

Joined: May 28, 2008
Posts: 2
junit.framework.AssertionFailedError:
Unexpected method call getCAEvent com.citco.banking.nxg.ca.MatchFieldsVO@2f208441):
getCAEvent(com.citco.banking.nxg.ca.MatchFieldsVO@2f208441): expected: 0, actual: 1
getCAEvent(com.citco.banking.nxg.ca.MatchFieldsVO@54adfb0c): expected: 1, actual: 0
at org.easymock.MockControl$4.invoke(MockControl.java:148)
at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:44)
at $Proxy0.getCAEvent(Unknown Source)
at com.citco.banking.nxg.ca.CANotificationProcessingService.matchKeyFields(CANotificationProcessingService.java:163)
at com.citco.banking.nxg.ca.CANotificationProcessingServiceTest.testMatchKeyFields(CANotificationProcessingServiceTest.java:226)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


http:\\www.lover.java.com
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Sanketh,
Welcome to JavaRanch!

That's an exception trace rather than a question. I'll assume your question is that you don't understand why you are getting the assertion failure.

This is the relevant line of the stack trace:
MatchFieldsVO@2f208441): expected: 0, actual: 1
getCAEvent(com.citco.banking.nxg.ca.MatchFieldsVO@54adfb0c


It tells you that you have to MatchFieldsVO that are not equal. Have you implemented an equal method? Have you debugged to check that the two are equal?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
wood burning stoves
 
subject: Error in JUnit while Running