EasyHack, fdo#46808, Adapt UNO services to new style, Phase II

Stephan Bergmann sbergman at redhat.com
Thu Apr 5 01:31:54 PDT 2012

On 04/04/2012 05:00 PM, Noel Grandin wrote:
> I've converted a bunch of stuff, including graphic/GraphicProvider. I'm
> now getting failures in some of the unit tests.
> Are my changes at fault, or is there something else that needs fixing?
> Thanks, Noel Grandin
> File tested,Test Result,Execution Time (ms)
> file:///home/noel/libo/sc/qa/unit/data/xls/pass/CVE-2010-0822-1.xls,##Failure
> Location unknown## : Error
> Test name: ScFiltersTest::testCVEs
> An uncaught exception of type com.sun.star.uno.DeploymentException
> - component context fails to supply service
> com.sun.star.graphic.GraphicProvide
> r of type com.sun.star.graphic.XGraphicProvider
> [/home/noel/libo/workdir/unxlngx6.pro/CppunitTest/sc_filters_test.test]

 From a very quick glance:  Many of our "unit tests" have the problem 
that they need a rather extensive environment set up, with many UNO 
services available, but they set that up manually.  Now, due to lots of 
that pseudo-defensiveness nonsense in the code base we already 
discussed, missing pieces in those test environments often went undetected.

I assume that adding svtools/util/svt to the 
gb_CppunitTest_add_components list in sc/CppunitTest_sc_filters_test 
solves this specific problem.

If yes, the general pattern is:  If there's a DeplyomentException about 
a missing service from a test, look that service up in 
program/services/services.rdb or ure/share/misc/services.rdb, note which 
component provides it, from the component's uri attribute learn which 
dynamic library that would be, and check that the test's mk file 
gb_CppunitTest_add_components list mentions that library's .component file.


More information about the LibreOffice mailing list