Jacoco代码覆盖率Java代理错误

时间:2018-07-02 14:35:25

标签: tomcat code-coverage jacoco integration-testing

我正在使用jacoco代理为我的简单rest api生成代码覆盖率报告

@RestController
public class TestController {
    @RequestMapping(value ="/test/{id}",method=RequestMethod.GET)
    public ResponseEntity<?> getResponse(@PathVariable("id")int value){

        if(value>10){
            System.out.println("Value is greater than 10");
        }
        else{
            System.out.println("Value is no longer greater than 10");
        }
        return ResponseEntity.ok(new ServiceResponse("Service executed"));
    }
}  

现在我在

之类的setenv.bat文件中向Tomcat提供JVM参数。
SET JAVA_OPTS="%JAVA_OPTS% -javaagent:E:/Office/CodeCoverage/jacocoagent.jar=destfile=E:/Office/CodeCoverage/jacoco.exec,append=false" 

但是当我将tomcat作为服务安装时,尽管服务已成功安装,却出现此错误

Filename ,directory name or volume label syntax is incorrect 

请引导我

0 个答案:

没有答案