[opencms-dev] Unit testing

Sami Honkonen sami.honkonen at ri.fi
Wed Mar 1 13:33:30 CET 2006


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 




More information about the opencms-dev mailing list