As these are unit tests, if some config is read from a file, I think we need to mock the behavior, rather than reading the configs from a actual config file in a product distribution.
Thanks, On Thu, Nov 16, 2017 at 7:20 PM, Saneth Dharmakeerthi <[email protected]> wrote: > Hi, > > IMO this should be a part of automation test. Before starting the test > method, it should set all the prerequisites. > > > Thanks and Best Regards, > > Saneth Dharmakeerthi > *Associate Technical Lead* > WSO2, Inc. > Mobile: +94772325511 <+94%2077%20232%205511> > > <http://wso2.com/signature> > > On Thu, Nov 16, 2017 at 5:46 PM, Prakhash Sivakumar <[email protected]> > wrote: > >> Hi Nadeeshani, >> >> You need to add the CARBON_CONFIG_DIR_PATH as environment variable before >> building the code >> ex : export CARBON_CONFIG_DIR_PATH="<CARBON_HOME>/repository/conf" >> >> Thanks, >> Prakhash >> >> On Thu, Nov 16, 2017 at 2:12 PM, Nadeeshani Pathirennehelage < >> [email protected]> wrote: >> >>> Hi All, >>> >>> When I am trying to build the identity-outbound-auth-passwordPolicy[1] >>> it fails due to a test failure. >>> >>> Error is given below. >>> >>> Tests run: 19, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.746 >>> sec <<< FAILURE! - in TestSuite >>> testInitiateAuthRequestSuccess(org.wso2.carbon.extension.ide >>> ntity.authenticator.passwordpolicy.test.PasswordChangeEnforcerOnExpirationTest) >>> Time elapsed: 0.09 sec <<< FAILURE! >>> java.lang.ExceptionInInitializerError: null >>> at java.util.Hashtable.put(Hashtable.java:514) >>> at java.util.Properties.setProperty(Properties.java:161) >>> at java.lang.System.setProperty(System.java:787) >>> at org.wso2.carbon.utils.CarbonUtils.getCarbonHome(CarbonUtils. >>> java:240) >>> at org.wso2.carbon.utils.CarbonUtils.getCarbonConfigDirPath(Car >>> bonUtils.java:284) >>> at org.wso2.carbon.identity.policy.password.PasswordChangeUtils >>> .loadProperties(PasswordChangeUtils.java:52) >>> at org.wso2.carbon.identity.policy.password.PasswordChangeUtils >>> .<clinit>(PasswordChangeUtils.java:41) >>> at org.wso2.carbon.identity.policy.password.PasswordChangeEnfor >>> cerOnExpiration.initiateAuthRequest(PasswordChangeEnforcerOn >>> Expiration.java:165) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce >>> ssorImpl.java:57) >>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe >>> thodAccessorImpl.java:43) >>> at java.lang.reflect.Method.invoke(Method.java:606) >>> at org.powermock.reflect.internal.WhiteboxImpl.performMethodInv >>> ocation(WhiteboxImpl.java:1899) >>> at org.powermock.reflect.internal.WhiteboxImpl.doInvokeMethod(W >>> hiteboxImpl.java:801) >>> at org.powermock.reflect.internal.WhiteboxImpl.invokeMethod(Whi >>> teboxImpl.java:666) >>> at org.powermock.reflect.Whitebox.invokeMethod(Whitebox.java:401) >>> at org.wso2.carbon.extension.identity.authenticator.passwordpol >>> icy.test.PasswordChangeEnforcerOnExpirationTest.testInitiate >>> AuthRequestSuccess(PasswordChangeEnforcerOnExpirationTest.java:265) >>> >>> >>> Results : >>> >>> Failed tests: >>> PasswordChangeEnforcerOnExpirationTest.testInitiateAuthRequestSuccess:265 >>> ยป ExceptionInInitializer >>> >>> >>> I tried to build it using both Java7 and Java8. But it gives the same >>> error. >>> >>> Any thoughts or help on this is highly appreciated. >>> >>> [1] https://github.com/wso2-extensions/identity-outbound-auth-pa >>> sswordPolicy >>> >>> Thanks, >>> Nadeeshani. >>> -- >>> Pathirennehelage Nadeeshani >>> Software Engineer | WSO2 Inc. >>> Platform Security Team >>> mobile : +94 716545223 <+94%2071%20654%205223> >>> >>> >> >> >> -- >> Prakhash Sivakumar >> Software Engineer | WSO2 Inc >> Platform Security Team >> Mobile : +94771510080 <+94%2077%20151%200080> >> Blog : https://medium.com/@PrakhashS >> > > -- Maduranga Siriwardena Senior Software Engineer WSO2 Inc; http://wso2.com/ Email: [email protected] Mobile: +94718990591 Blog: *https://madurangasiriwardena.wordpress.com/ <https://madurangasiriwardena.wordpress.com/>* <http://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
