unit tests pick up MIFOS_CONF/applicationConfiguration.custom.properties
------------------------------------------------------------------------

                 Key: MIFOS-2865
                 URL: http://mifosforge.jira.com/browse/MIFOS-2865
             Project: mifos
          Issue Type: Bug
          Components: Build and Testing
            Reporter: Adam Monsen
            Assignee: Adam Monsen


If MIFOS_CONF/applicationConfiguration.custom.properties exists, it may affect 
unit tests like AccountingRulesTest.

STEPS TO REPRO
1. create MIFOS_CONF/applicationConfiguration.custom.properties (e.g. 
~/.mifos/applicationConfiguration.custom.properties , for Ubuntu) with just one 
setting:

  AccountingRules.DigitsAfterDecimal=0

2. Run AccountingRulesTest. e.g.:

  mvn test -Dtest=AccountingRulesTest

(from the "application" directory")

EXPECTED RESULT
Build successful

ACTUAL RESULT
Build failure: 
digitsAfterDecimalFallsBackToDefault(org.mifos.config.AccountingRulesTest)  
Time elapsed: 0.003 sec  <<< FAILURE!
java.lang.AssertionError: expected:<1> but was:<0>

ADDITIONAL INFORMATION
* See the private constructor for ConfigurationManager
* Integration tests do not have this problem because they fire off 
TestCaseInitializer.initialize(), which sets the test mode to "integration". 
Acceptance tests are also unaffected.
* One idea: unit tests that need test mode "integration" (those that will fail 
if application-wide configuration settings are overridden) can explicitly call 

  new StandardTestingService().setTestMode(TestMode.INTEGRATION);

if lots of these calls are necessary, maybe we can come up with a better 
solution.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to