On Jun 29, 2009, at 11:35 AM, Asiri Rathnayake wrote:

> Hi,
>
>
>> -        return new File("./chart.png");
>>> +        return new File("./target/chart.png");
>>
>> This is very bad. You should never hardcode maven directories  
>> location.
>
>
> Shall I leave it the way it was? The problem with that was a chart  
> image
> gets left behind after the tests, and since it is not inside the  
> target/
> directory it is not cleaned by maven.
>
> May be override the tearDown() method and cleanup the file? But I'm  
> not sure
> if this is possible with the way rendering tests are done.

No, no.

There are 2 options:
- Best: Do not create an image. Just verify that jfreechart is called  
and verify where it would create the image . To be done with some mocks.
- Not as good: pass the location from the pom.xml. Actually it's  
already passed by surefire so you just need to retrieve it as a system  
property.

-Vincent
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to