[Mifos-developer] Test Case fails while on application module

0 visningar
Hoppa till det första olästa meddelandet

Lasith Sameera

oläst,
5 apr. 2010 10:10:122010-04-05
till Mifos software development
Hi,

When i'm building the application i have come up with unit test failure on org.mifos.accounts.savings.util.helpers.SavingsHelperTest.

Error log:

-------------------------------------------------------------------------------
Test set: org.mifos.accounts.savings.util.helpers.SavingsHelperTest
-------------------------------------------------------------------------------
Tests run: 10, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.195 sec <<< FAILURE!
testCalculateDays(org.mifos.accounts.savings.util.helpers.SavingsHelperTest)  Time elapsed: 0.12 sec  <<< FAILURE!
junit.framework.ComparisonFailure: null expected:<18[2]> but was:<18[3]>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at org.mifos.accounts.savings.util.helpers.SavingsHelperTest.testCalculateDays(SavingsHelperTest.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

I have looked into Source code found issue on calculateDays(Date fromDate, Date toDate)  method in /mifos-gazelle/application/src/main/java/org/mifos/accounts/savings/util/helpers/SavingsHelper.java

I did the minor changes to method and after the changes method gives the exact result.

Before the change:
long days = (getMFITime(toDate) / oneDay) - (getMFITime(fromDate) / oneDay);

After the Change:
long days = (getMFITime(toDate) - getMFITime(fromDate)) / oneDay;

So did i make the correct changes to the Source or is there any mistake i have done during building application?

Environment:

---
Thanks & Regards,
Lasith Sameera





---------- Forwarded message ----------
From: Lasith Sameera <lasith...@gmail.com>
Date: Fri, Apr 2, 2010 at 8:09 PM
Subject: Interesting in working on Database upgrades using LiquiBase
To: mifos-d...@lists.sourceforge.net


Hi,

I'm Postgraduate student in Computer Science and willing to work on "Database upgrades using LiquiBase". 

Now i'm going through your code base and will get back if i find any issues.

---
Thanks & Regards,
Lasith Sameera



Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden