Yes I have a special reason for mocking GUI code.
I use Cobertura as Java code coverage analysis tool and to improve my
results, I would like to do some JUnits tests for the GUI code.
In my test, I just want to initialize the main controller of my
application which initializes all views of my code.
With this test, the coverage percent will be improved.
Note that my JUnit tests are running on a server on which the X11
display is not activated. That why I would like to mock the
isHeadless() method.
Concerning the exception, do you have any idea?
I am going to check fest library...
On Dec 1, 1:01 pm, Johan Haleby <
johan.hal...@gmail.com> wrote:
> I think generally you should avoid testing the GUI in this way. There are
> good tools for Swing UI testing such as
> fest-swing<
http://code.google.com/p/fest/> that
> you can have a look at. Or do you have a special reason for why you want to
> mock the GUI code?
>
> /Johan
>
> On Wed, Dec 1, 2010 at 12:49 PM, Jean-Christophe DEROUET <
>
>
jc.dero...@gmail.com> wrote:
> > Not sure from what you posted, but maybe you have to prepare for test, mock
> > and stub the other class UIManager as well?
>
> > 2010/12/1 Fabien <
fabien.duca...@gmail.com>
> >>
powermock+...@googlegroups.com<
powermock%2Bunsu...@googlegroups.com>
> >> .
> >
powermock+...@googlegroups.com<
powermock%2Bunsu...@googlegroups.com>
> > .