[opencms-dev] Unit testing

Jason Trump jason.trump at brulant.com
Wed Mar 1 17:48:58 CET 2006


I ran into a similar problem, and found that an "in-container" style of
test was the only way to work it.  If you look at the OpenCms unit test
sources, you'll notice that they actually rely on a connection to a test
database, and so on.

I agree, I think broader use of interfaces would be nice in a future
release.

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-
> bounces at opencms.org] On Behalf Of Sami Honkonen
> Sent: Wednesday, March 01, 2006 7:34 AM
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] Unit testing
> 
> I'm writing a scheduled job that processes files in a certain folder
> once an hour. The class implements I_CmsScheduledJob which has one
> method, launch(CmsObject cms, Map parameters). I would use
> CmsObject.getFilesInFolder() to get the files and then iterate.
> 
> I want to write JUnit test cases for the class. The problem is that I
> can't mock CmsObject. It isn't described in an interface and I can't
> even extend it since it's final.
> 
> Has anyone found a way to get around this somehow?
> 
> Maybe a CmsObject interface should be added to the 6.2 release?
> 
> --
> Sami Honkonen
> Reaktor Innovations Oy, http://www.ri.fi
> sami.honkonen at ri.fi
> +358 40 535 3463
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please
visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list