G
Gira
I'm getting in trouble while trying to test a Singleton class X with
Junit4 in order to be able to test private (!!!) methods...
( X is also a thread and all its methods are private because it works
by itself, therefore there is no need for making them public )
It is quite simple to explain my problem:
Junit4 requests a default public constructor, but since X is a
singleton there is no public constructor...
There is a possibility to avoid the following error
"java.lang.Exception: Test class should have public zero-argument
constructor" ????????
(even with Parameterized will not work, since I do not need to call a
non-default constructor but the method "public static X getX()
{ ... }" in order to instantiate X )
Thank you all for any suggestion,
Andrea
Junit4 in order to be able to test private (!!!) methods...
( X is also a thread and all its methods are private because it works
by itself, therefore there is no need for making them public )
It is quite simple to explain my problem:
Junit4 requests a default public constructor, but since X is a
singleton there is no public constructor...
There is a possibility to avoid the following error
"java.lang.Exception: Test class should have public zero-argument
constructor" ????????
(even with Parameterized will not work, since I do not need to call a
non-default constructor but the method "public static X getX()
{ ... }" in order to instantiate X )
Thank you all for any suggestion,
Andrea