• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in JUnit while Running

 
Sanketh Kumar
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33691
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic