【问题标题】:Error in generating test cases when using EvoSuite Eclipse Plugin使用 EvoSuite Eclipse 插件时生成测试用例时出错
【发布时间】:2016-07-19 02:27:38
【问题描述】:

当使用 EvoSuite Eclipse 插件为动态 Web 项目中扩展 HttpServlet 的类生成测试用例时,我收到以下错误。

那些汉字的意思是“Windows找不到这个文件F:\Java\J2EEWorkspace\EvoSuiteTest\evosuite-tests\com\s...\TestServlet_ESTest.java。请重新检查文件名。”

EvoSuite Eclipse Plugin 将生成的代码是

package com.servlet;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TestServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public void service( HttpServletRequest request, HttpServletResponse     response ){
        System.out.println("I am a test...");
    }

}

【问题讨论】:

    标签: java eclipse servlets evosuite


    【解决方案1】:

    尽管已经添加了Server Runtime Library,但如果我们再次将Servlet Container jars(例如tomcat/lib 中的jars)添加到项目中,问题将得到解决。我不知道是什么原因。这可能是 Evosuite 的错误。

    【讨论】:

      【解决方案2】:

      这个问题也可以在命令行操作中找到。在命令行操作中,我们发现jre缺少jdk的tools.jar。如果把jdk1.8/lib/tools.jar放到jre8/lib/下,问题就解决了。

      using EvoSuite plugin for eclipse on Windows 7 OS

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-08-22
        • 1970-01-01
        • 2016-02-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多