<div dir="ltr">Hello,<br><div dir="ltr"><div>I was trying to figure out the best way how to test my OpenCMS modules for a while. One of the most problematic things that I have encountered is the fact that </div><div>the CmsObject class is final and has no interface(but you need for almost everything), therefore standard mocking tools such as EasyMock or Mockito cannot be used. </div>
<div>The only one mocking framework that is capable of this is PowerMock, but it is not optimal. Therefore I would like to ask if anybody tried to solve this problem, whether you </div><div>have some custom mocking framework customized for OpenCMS or if there are plans in OpenCms development to make some architectural changes, that would allow </div>
<div>better testability.</div><div><br></div><div>Another question I have is about dependency injection. Do you use some library, or do you recommend some DI framework for integration wht OpenCms? I am used to separating my layers, for example I have DAO object that just </div>
<div>accesses the db and on top of that I have service layer where some business code lives(in these days sort of standard layout). </div><div>One problem that I have is the fact that by default OpenCms is not shipped with any DI framework. </div>
<div>This would greatly improve development experience when working on bigger modules, also testability of code would be improved. </div><div>So I ask if anybody has experience with integration of some DI framework with OpenCms or if there are plans to include one in the future releases. </div>
<div>For example CDI reference implementation JBOSS Weld can be easily integrated with servlet containers such as Apache Tomcat. Apache also has its own implementation </div><div>called OpenWebBeans and set of CDI extensions called DeltaSpike.</div>
<div><br></div><div>Best regards,</div><div>Jakub Jeèmínek<br>------------------------------------------------<br>NELASOFT Technologies, s.r.o.<br>Mob: +420 604 575 772<br>E-mail: <a href="mailto:jakub.jecminek@nelasoft.cz" target="_blank">jakub.jecminek@nelasoft.cz</a><br>
Web: <a href="http://www.nelasoft.cz/" target="_blank">www.nelasoft.cz</a><br></div></div></div>