K
killy971
I am using JUnit and JMockit to create test cases for my Java classes.
For some reasons, I now need to create a mock class for the java built-
in Calendar class (or GregorianCalendar), in order to test classes
which use the call "Calendar.getInstance()" and produce a result
specific to the current time.
The fact is that I have tried many ways to create this mock class, and
I didn't succeed in making it work properly (well, it completely
didn't work...).
I would like to know if creating a mock class for the Calendar or
GregorianCalendar is actually possible in java, and if some people
have already created it.
If you have some help to share about this problem, I would be pleased
to hear your advices.
Guillaume
For some reasons, I now need to create a mock class for the java built-
in Calendar class (or GregorianCalendar), in order to test classes
which use the call "Calendar.getInstance()" and produce a result
specific to the current time.
The fact is that I have tried many ways to create this mock class, and
I didn't succeed in making it work properly (well, it completely
didn't work...).
I would like to know if creating a mock class for the Calendar or
GregorianCalendar is actually possible in java, and if some people
have already created it.
If you have some help to share about this problem, I would be pleased
to hear your advices.
Guillaume