问题
I use jmockit and junit to write unit test for a module and run it in a STB. I use jmockit-1.7 because the STB only have java 5.
I got this error when run unit test: java.lang.IllegalStateException: Jmockit has not been initialized. Check that your Java 5 VM has been started with -javaagent:jmockit.jar command line option
but my STB use siege java VM, so it doesn't have -javaagent command line option
I have google, and found a solution from Running tests with JMockit
@BeforeClass
public static void Initialize()
{
Mockit.setUpMocks();
}
But it's not work. And i have to uses jmockit-0.999.19 to have Mockit.setUpMocks();
Could any one help me initialize jmockit without -javaagent and run in java 1.5?
回答1:
3 years ago... Update: In the latest version JMockit v1.40 support for JDK6 will be dropped... so use JDK7+ ;-)
来源:https://stackoverflow.com/questions/29114036/initialize-jmockit-without-javaagent