我已经按照网站上给出的步骤配置maven插件。当我给出"mvn evosuite:generate"时,它会在控制台中显示以下细节。
[INFO]要开始工作:com.emirates.gws.service.grouprequest.GroupRequestServiceImpl.
以下是环境细节Windows 7maven-3.2.1jdk1.7.0_72
以下是控制台
中显示的详细信息 [INFO] --- evosuite-maven-plugin:0.2.0:generate (default-cli) @ gws-grouprequest-implementation ---
[WARNING] The POM for org.slf4j:slf4j-api:jar:1.7.12 is missing, no dependency information available
[WARNING] The POM for org.ow2.asm:asm-all:jar:5.0.4 is missing, no dependency information available
[WARNING] The POM for dk.brics.automaton:automaton:jar:1.11-8 is missing, no dependency information available
[WARNING] The POM for com.googlecode.gentyref:gentyref:jar:1.2.0 is missing, no dependency information available
[WARNING] The POM for net.sf.jgrapht:jgrapht:jar:0.8.3 is missing, no dependency information available
[WARNING] The POM for commons-cli:commons-cli:jar:1.3 is missing, no dependency information available
[WARNING] The POM for org.kohsuke:graphviz-api:jar:1.1 is missing, no dependency information available
[INFO] Going to generate tests with EvoSuite
[INFO] Total memory: 800mb
[INFO] Time per class: 2 minutes
[INFO] Number of used cores: 1
[INFO] Target: D:EGITProjectsGWSSourcegws-project-MICEgws-grouprequestgws-grouprequest-implementationtargetclasses
[INFO] Basedir: D:EGITProjectsGWSSourcegws-project-MICEgws-grouprequestgws-grouprequest-implementation
[INFO] SLF4J: Class path contains multiple SLF4J bindings.
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/org/evosuite/evosuite-master/0.2.0/evosuite-master-0.2.0.jar!/org/slf4j/impl/S
taticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/org/evosuite/evosuite-runtime/0.2.0/evosuite-runtime-0.2.0.jar!/org/slf4j/impl
/StaticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl
/StaticLoggerBinder.class]
[INFO] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[INFO] SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
[INFO] * EvoSuite
[INFO] [MASTER] 21:49:11.703 [main] WARN ProjectAnalyzer - Cannot handle com.emirates.gws.service.payments.PaymentServiceImpl due to: class java.lan
g.ClassNotFoundException Method code too large!
[INFO] Going to execute 32 jobs
[INFO] Going to start job for: com.emirates.gws.service.grouprequest.GroupRequestServiceImpl
从您的设置中,看起来您正在使用1个核心,每个类2分钟,并试图为32个类生成测试:这意味着它将需要长达64分钟才能完成。但是,每次完成一个新类(大约每2分钟一次)时,您应该在日志中获得一个新条目。
顺便说一句,你似乎只使用了800MB的内存。为了以防万一,最好使用更多,例如1-1.5GB
下面的内容有点令人担忧:
[INFO] [MASTER] 21:49:11.703 [main] WARN ProjectAnalyzer - Cannot handle com.emirates.gws.service.payments.PaymentServiceImpl due to: class java.lan
g.ClassNotFoundException Method code too large!
Java对方法的大小有限制。EvoSuite需要在字节码上添加一些检测才能工作,这可能会导致超出限制:(