Re: [Mifos-developer] Patch for moratorium module....

6 views
Skip to first unread message

Saurabh Kumar

unread,
Dec 17, 2007, 5:48:53 AM12/17/07
to mifos-d...@lists.sourceforge.net

 

 

Hi,

 

Can someone please provide inputs on the below mentioned points ??

 

Thanks & Regards,

Saurabh Kumar • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511www.sungard.com

-----Original Message-----
From: Saurabh Kumar
Sent
:
Wednesday, December 05, 2007 5:49 PM
To: 'Developer'
Subject: RE: [Mifos-developer] Patch for moratorium module....

 

 

Hi Tom,

 

We have tried all the possible options for the problem but we are unable to find the solution.

 

We tried following options >>

1)       place the directory that contains struts-config in CLASSPATH

2)       used setConfigFile() to set the location of struts-config file

3)       provided absolute path for the struts-config file

 

Infact we are exhausted with all the options we had.

 

Can you give us some possible direction through which we can approach this problem or else I think someone else on community can take up this issue.

 

Thanks & Regards,

Saurabh Kumar • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511www.sungard.com

-----Original Message-----
From: mifos-devel...@lists.sourceforge.net [mailto:mifos-devel...@lists.sourceforge.net] On Behalf Of Tom Bostelmann
Sent:
Wednesday, December 05, 2007 12:56 AM
To: Developer
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

what Van said :)

On Dec 4, 2007 9:11 AM, Van Mittal-Henkle <va...@grameenfoundation.org> wrote:

Hi Saurabh,

 

At this point, it would be good to first look for a solution within the existing test framework being used for Mifos before looking at other options like Cacuts.

 

Thanks,

--Van

 


Sent: Tuesday, December 04, 2007 5:07 AM


To: Developer
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

 

 

Hi Tom,

 

Thanks for your comments.

 

I got your point regarding one struts-config file.

 

In my previous mail, I had mentioned about Cactus for testing deployed code, do you want me to dig more on that???

 

Thanks & Regards,

Saurabh Kumar • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511www.sungard.com

-----Original Message-----
From: mifos-devel...@lists.sourceforge.net [mailto:mifos-devel...@lists.sourceforge.net] On Behalf Of Tom Bostelmann
Sent:
Monday, December 03, 2007 6:03 AM
To: Developer
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

Apologies for not getting back to you earlier Saurabh.  I included responses to your questions inline...

Even if we use same struts-config(validation.xml,etc), that won't serve purpose of testing deployed code, coz "MockStrutsTestCase" uses a set of HttpServlet mock objects to simulate the container environment without requiring a running servlet engine.

I understand that it doesn't start up a servlet engine - it emulates one.  but i'm assuming that you created a struts-config/validation.xml because the emulator will also simulate the use of configuration files like struts-config and the validation configuration. 

If the testing framework that we're using uses a struts-config, it should use the one that's being deployed.

I'm trying to avoid having duplicate code.  A developer can come in and make changes to the struts-config in the main 'src' directory without updating the one in 'test'.  If that occurs we're no longer testing the correct configuration.
 

 

Moreover if we try to point to struts-config in src directory it will give following error, which clearly states that we need to have struts-config file in the directory from which we are trying to run testcases.

  

Yes, I know.  I need you to figure out how to fix this.


-Tom
 

 

Hi Tom,

 

Are you referring to "CactusStrutsTestCase ", coz for testing deployed code we need to use "CactusStrutsTestCase " as base class for our testcases.

 

Even if we use same struts-config(validation.xml,etc), that won't serve purpose of testing deployed code, coz "MockStrutsTestCase" uses a set of HttpServlet mock objects to simulate the container environment without requiring a running servlet engine.

 

"CactusStrutsTestCase" uses the "Cactus testing framework" to test Struts classes in the actual server container, allowing for a testing environment more in line with the actual deployment environment.

 

Tell me if I m wrong or if I m thinking in wrong direction.

 

Moreover if we try to point to struts-config in src directory it will give following error, which clearly states that we need to have struts-config file in the directory from which we are trying to run testcases.

 

servletunit.struts.ExceptionDuringTestError : A NullPointerException was thrown.  This may indicate an error in your ActionForm, or it may indicate that the Struts ActionServlet was unable to find struts config file.  TestCase is running from D:\latest code\mifos directory.  Context directory has not been set.  Try calling setContextDirectory() with a relative or absolute path.  struts config file must be found under the context directory, the directory the test case is running from, or in the classpath.

        at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:303)

        at org.mifos.application.moratorium.struts.action.TestMoratoriumAction.testCreateForClient(TestMoratoriumAction.java:83)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        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.OldTestClassRunner.run(OldTestClassRunner.java:76)

        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)

        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)

------------

Root Cause:

------------

java.lang.NullPointerException

        at servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.java:231)

        at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:290)

        at org.mifos.application.moratorium.struts.action.TestMoratoriumAction.testCreateForClient(TestMoratoriumAction.java:83)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        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.OldTestClassRunner.run(OldTestClassRunner.java:76)

        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)

        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)

 

 

Thanks & Regards,

Saurabh Kumar • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511www.sungard.com

-----Original Message-----
From: mifos-devel...@lists.sourceforge.net [mailto: mifos-devel...@lists.sourceforge.net ] On Behalf Of Tom Bostelmann

Sent: Wednesday, November 21, 2007 3:02 PM
To: Developer
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

okay, i can see your point.  the problem, however, is that the existing design is defective.  you aren't actually testing the code that is deployed, which isn't a legitimate test.

i entered a defect for the rest of the code (see issue 1521).

i'd like you to at least fix the issue in the code that you submitted.

On Nov 19, 2007 12:53 AM, Saurabh Kumar <Saurab...@sos.sungard.com > wrote:

 

Hi Tom,

 

Thanks for reviewing the patch.

 

As far as duplicate files are concerned, I m following the existing design of mifos.

 

In existing design we are using separate struts-config (and other files) for testing purpose.

 

I have referred existing modules for that (for example holiday or other module).

 

 

Thanks & Regards,

Saurabh Kumar  • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511 • www.sungard.com

-----Original Message-----
From: mifos-devel...@lists.sourceforge.net [mailto: mifos-devel...@lists.sourceforge.net] On Behalf Of Tom Bostelmann

Sent: Saturday, November 17, 2007 5:05 AM
To: Developer
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

Saurabh,
Things look good so far.  You have good test coverage and all the tests are passing. 

However, there are couple things I need you to change:

1.) struts-config.xml - Please remove all instances of struts-config.xml from the 'test' source directory.  Your mock struts tests should run using the struts-config.xml from the 'src' dir.  Duplicating this code means you aren't actually testing the deployed code.

2.) validation.xml - for the same reason, we should remove this file from the 'test' directory.  it actually appears to not have any content in it?  why does this exist?

3.) validator-rules.xml - same as above.

4.) MoratoriumUIResources.properties - same as above - please use the equivalent from the 'src' directory.

Let me know if you have any questions on this.  Thanks a lot for your patience while we're short-staffed :P
-Tom

On Nov 15, 2007 6:09 AM, Saurabh Kumar <Saurab...@sos.sungard.com > wrote:

 

Hi Tom,

 

Please find the patch for moratorium module.

 

I have merged our code with latest revision from svn, i.e.  revision 12192.

 

There were no build errors and the test suite passed successfully.

 

Do let me know if there are any issues.

 

Please ignore my previous patch because after I had sent my previous patch, revision 12192 was checked in; so I had to merge with the new revision.

Thanks & Regards,

Saurabh Kumar  • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511 • www.sungard.com

-----Original Message-----
From: mifos-devel...@lists.sourceforge.net [mailto: mifos-devel...@lists.sourceforge.net] On Behalf Of Tom Bostelmann
Sent:
Friday, November 09, 2007 4:30 AM

To: Developer
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

Saurabh,
I'm having some trouble applying your patch.  There is a merge conflict in:

sql/latest-schema.sql


There are also several files that already exist, so I'm not sure why your patch is trying to add them:

Failed to apply patch for file src/org/mifos/application/moratorium/business/MoratoriumBO.hbm.xml: File MoratoriumBO.hbm.xml already exists
Failed to apply patch for file src/org/mifos/application/moratorium/business/MoratoriumBO.java: File MoratoriumBO.java already exists
Failed to apply patch for file src/org/mifos/application/moratorium/business/service/MoratoriumBusinessService.java: File MoratoriumBusinessService.java already exists
Failed to apply patch for file src/org/mifos/application/moratorium/exceptions/MoratoriumException.java: File MoratoriumException.java already exists
Failed to apply patch for file src/org/mifos/application/moratorium/persistence/MoratoriumPersistence.java: File MoratoriumPersistence.java already exists
Failed to apply patch for file src/org/mifos/application/moratorium/struts/action/MoratoriumAction.java: File MoratoriumAction.java already exists
Failed to apply patch for file src/org/mifos/application/moratorium/struts/actionforms/MoratoriumActionForm.java: File MoratoriumActionForm.java already exists
Failed to apply patch for file src/org/mifos/application/moratorium/util/resources/MoratoriumConstants.java: File MoratoriumConstants.java already exists
Failed to apply patch for file src/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties: File MoratoriumUIResources.properties already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp: File applyBranchMoratoriumConfirm.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/applyMoratorium.jsp: File applyMoratorium.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumConfirm.jsp: File applyMoratoriumConfirm.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumForBranch.jsp: File applyMoratoriumForBranch.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/configureBranchMoratorium.jsp: File configureBranchMoratorium.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/configureClientMoratorium.jsp: File configureClientMoratorium.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/configureMoratorium.jsp: File configureMoratorium.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriums.jsp: File editMoratoriums.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriumsPreview.jsp: File editMoratoriumsPreview.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/moratoriumSearchResults.jsp: File moratoriumSearchResults.jsp already exists
Failed to apply patch for file src/org/mifos/doc-root/application/moratorium/jsp/viewMoratoriums.jsp: File viewMoratoriums.jsp already exists
Failed to apply patch for file test/org/mifos/application/moratorium/business/service/TestMoratoriumBusinessService.java: File TestMoratoriumBusinessService.java already exists
Failed to apply patch for file test/org/mifos/application/moratorium/business/TestMoratoriumBO.java: File TestMoratoriumBO.java already exists
Failed to apply patch for file test/org/mifos/application/moratorium/persistence/TestMoratoriumPersistence.java: File TestMoratoriumPersistence.java already exists
Failed to apply patch for file test/org/mifos/application/moratorium/struts- config.xml: File struts-config.xml already exists
Failed to apply patch for file test/org/mifos/application/moratorium/struts/action/TestMoratoriumAction.java: File TestMoratoriumAction.java already exists
Failed to apply patch for file test/org/mifos/application/moratorium/struts/actionforms/TestMoratoriumActionForm.java: File TestMoratoriumActionForm.java already exists
Failed to apply patch for file test/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties: File MoratoriumUIResources.properties already exists
Failed to apply patch for file test/org/mifos/application/moratorium/validation.xml: File validation.xml already exists
Failed to apply patch for file test/org/mifos/application/moratorium/validator-rules.xml: File validator-rules.xml already exists


Please make these corrections and re-submit the patch.  Thanks!
-Tom

On Nov 5, 2007 4:46 AM, Saurabh Kumar < Saurab...@sos.sungard.com > wrote:

 

Hi Van,

 

I have integrated the code with revision 12171.

 

The test suite is running fine, and there are no build errors.

 

Please find the patch attached with the mail.

 

Do let me know if there are any issues.

 

Thanks & Regards,

Saurabh Kumar  • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511 • www.sungard.com

-----Original Message-----
From: mifos-devel...@lists.sourceforge.net [mailto: mifos-devel...@lists.sourceforge.net] On Behalf Of Van Mittal-Henkle
Sent:
Monday, November 05, 2007 1:01 PM
To: Developer
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

Hi Saurabh,

 

Could you please update to revision 12171 (or later) and confirm whether this probem has been resolved.  If the you no longer see the issue, then please resubmit your patch.

 

thanks,

--Van

 


From: mifos-devel...@lists.sourceforge.net [mailto: mifos-devel...@lists.sourceforge.net] On Behalf Of Saurabh Kumar
Sent:
Thursday, October 25, 2007 6:32 AM
To: mifos-d...@lists.sourceforge.net
Subject: [Mifos-developer] Patch for moratorium module....

 

Hi All,

 

We are done with the coding of moratorium module. However there are still some open issues, which are not implemented.

Once we get clarification on the open issues, we will send the updated patch. I m attaching a document with the mail, which describes the approach we have followed as well as open issues.

 

We checked out latest code from SVN but the build is getting failed because of test suite failure.

After applying the patch send by Dion, the test suite executes successfully but some other functional issues are coming, like, we are unable to create center, when we try to create meeting details for center we get following error -

javax.servlet.ServletException: Unable to find a value for "id" in object of class "org.mifos.application.meeting.util.helpers.WeekDay" using operator "."

 

Can anyone throw some light on this problem?

 

We checked out Revision >> 12167

Thanks & Regards,

Saurabh Kumar • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511 • www.sungard.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

 


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

 

Amy Bensinger (Contractor)

unread,
Dec 17, 2007, 6:23:39 AM12/17/07
to Developer

Hi, Saurabh.

I know some of the team have been intending on answering your questions.  Unfortunately, the Seattle office had a bit of a flu epidemic last week, so responses may be slower than normal while people catch up.  Thanks to you and everyone else who have been patient!  --aB

Van Mittal-Henkle

unread,
Dec 18, 2007, 3:00:07 PM12/18/07
to Developer
Hi Saurabh,
 
Tom has been looking into the issues related to the struts-config file and can address that. But there is a more pressing issue that needs to be dealt with.  The patch you sent does not follow the database upgrade standards as laid out on the wiki:
 
 
Please review the standards (in particular the use of upgrade and downgrade scripts) and then resubmit your patch.  If you have any questions about how the database upgrade process should work, please don't hesitate to ask.
 
Thanks,
--Van

 

Sent: Monday, December 17, 2007 2:49 AM
To: mifos-d...@lists.sourceforge.net

Saurabh Kumar

unread,
Dec 19, 2007, 9:15:57 AM12/19/07
to Developer

 

Hi Tom,

 

Please find the patch attached with the mail.

 

I have taken care of database upgrade standards.

 

Do let me know if there are any issues.

 

Thanks & Regards,

Saurabh Kumar • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501 • Mobile +91-9886945575 • Fax +91-80-2222-0511
www.sungard.com

-----Original Message-----
From:
mifos-devel...@lists.sourceforge.net [mailto:mifos-devel...@lists.sourceforge.net] On Behalf Of Van Mittal-Henkle
Sent: Wednesday, December 19, 2007 1:30 AM
To: Developer
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

Hi Saurabh,

 

Tom has been looking into the issues related to the struts-config file and can address that. But there is a more pressing issue that needs to be dealt with.  The patch you sent does not follow the database upgrade standards as laid out on the wiki:

 

http://www.mifos.org/developers/technical-orientation/mifos-database-development

 

Please review the standards (in particular the use of upgrade and downgrade scripts) and then resubmit your patch.  If you have any questions about how the database upgrade process should work, please don't hesitate to ask.

 

Thanks,

--Van


 


From: mifos-devel...@lists.sourceforge.net [mailto:mifos-devel...@lists.sourceforge.net] On Behalf Of Saurabh Kumar
Sent: Monday, December 17, 2007 2:49 AM
To: mifos-d...@lists.sourceforge.net
Subject: Re: [Mifos-developer] Patch for moratorium module....

 

 

Hi,

 

Can someone please provide inputs on the below mentioned points ??

 

Thanks & Regards,

Saurabh Kumar • Developer • SunGard • Offshore Services • Divyasree Chambers, Langford Road, Bangalore 560025 India
Tel +91-80-2222-0501
Mobile +91-9886945575 • Fax +91-80-2222-0511www.sungard.com

-----Original Message-----
From: Saurabh Kumar
Sent:
Wednesday, December 05, 2007 5:49 PM
To: 'Developer'
Subject: RE: [Mifos-developer] Patch for moratorium module....

 

 

Hi Tom,

 

We have tried all the possible options for the problem but we are unable to find the solution.

 

We tried following options >>

1.      place the directory that contains struts-config in CLASSPATH

2.       used setConfigFile() to set the location of struts-config file

3.       provided absolute path for the struts-config file

moratorium_patch.patch

Van Mittal-Henkle

unread,
Dec 21, 2007, 1:45:00 PM12/21/07
to Developer
Hi Saurabh,
 
Thanks for the patch!  We've added it to the patch queue for review.
 
Cheers,
--Van


Sent: Wednesday, December 19, 2007 6:16 AM
Reply all
Reply to author
Forward
0 new messages