开发者

Using jmockit with FitNesse

开发者 https://www.devze.com 2023-03-08 13:10 出处:网络
I\'m having trouble getting FitNesse to play nice with jmockit. I\'m using version v20110104 of FitNesse and version 0.999.9 of jmockit.

I'm having trouble getting FitNesse to play nice with jmockit.

I'm using version v20110104 of FitNesse and version 0.999.9 of jmockit.

I had some ClassDefNotFound exceptions being thrown, but those were solved by adding the following to my FitNesse root:

!define COMMAND_PATTERN {java -javaagent:../l开发者_JS百科ib/jmockit.jar}

Which is the location of my jmockit jar. However, now my tests that use jmockit hang in the "running" state, never to return.

I asked around on some FitNesse boards, and tried altering the command pattern like so:

!define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar -cp %p %m}

This defines the classpath (%p represents all defined path variables and %m represents the main java method)

This prevents the test from hanging, but I get a new exception:

    java.lang.IllegalStateException: Invalid context for the recording of expectations

I can't find much information about this exception.

Has anyone gotten the latest release of jmockit to work with FitNesse?


This link may help you: http://tech.dir.groups.yahoo.com/group/fitnesse/message/17815

Are you using jmockit inside the fixtures, or how? What purpose? I'm just curious, had never needed to mock anything in my acceptance tests.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号