首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行EvoSuite(java的自动单元测试生成)时的ExceptionInInitializerError

运行EvoSuite(java的自动单元测试生成)时的ExceptionInInitializerError
EN

Stack Overflow用户
提问于 2012-07-26 07:05:02
回答 1查看 268关注 0票数 0

我有以下非常简单的,有目的的错误的java类:

代码语言:javascript
复制
import java.io.InputStream;
import java.util.*;
public class ArrayListError{

public ArrayListError(){
}
public static void makeArray(int i){
ArrayList list = new ArrayList(i);
}
public static void main(String[] args)
{
System.out.println("Enter a number to create arrayList:");
Scanner scanner =new Scanner(System.in);
int i= scanner.nextInt();
makeArray(i);
}

}

当在evosuite cygwin( java -jar evosuite-20120511.jar -setup c:/Users/Eliezer\ Shindler/Desktop/myclasses)上运行时,我得到:

在de.unisb.cs.st.evosuite.setup.ScanProject.main(ScanProject.java:578)处的线程"main“中出现异常,原因是: com.thoughtworks.xstream.converters.ConversionException:无法构造de.unisb.cs.st.evosuite.callgraph.DistanceTransformer$ClassEntry,因为它没有无参数的构造函数:无法构造de.unisb.cs.st.evosuite.callg raph.DistanceTransformer$ClassEntry,因为它没有无参数的构造函数--调试信息-消息:无法构造de.unisb.cs.st.evosuite.callgraph.Distanc eTransformer$ClassEntry,因为它没有无参数的构造函数。原因-异常: com.thoughtworks.xstream.converters.reflection.ObjectAcces sException原因-消息:无法构造de.unisb.cs.st.evosuite.callgraph.Distanc eTransformer$ClassEntry,因为它没有无参数的构造函数类: java。是否需要util.HashSet -类型: de.unisb.cs.st.evosuite.callgraph.DistanceTransformer$Clas sEntry路径: /set/de.unisb.cs.st.evosuite.callgraph.DistanceTransformer $ClassEntry

行号:2

代码语言:javascript
复制
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall           er.java:89)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A           bstractReferenceUnmarshaller.java:63)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm           arshaller.java:76)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm           arshaller.java:60)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionCon           verter.readItem(AbstractCollectionConverter.java:71)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.p           opulateCollection(CollectionConverter.java:68)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.u           nmarshal(CollectionConverter.java:61)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall           er.java:82)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A           bstractReferenceUnmarshaller.java:63)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm           arshaller.java:76)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm           arshaller.java:60)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller           .java:137)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarsh           al(AbstractTreeMarshallingStrategy.java:33)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
    at de.unisb.cs.st.evosuite.utils.Utils.readXML(Utils.java:301)
    at de.unisb.cs.st.evosuite.callgraph.Hierarchy.readFromDefaultLocation(H           ierarchy.java:113)
    at de.unisb.cs.st.evosuite.setup.TestTaskGenerator.<clinit>(TestTaskGene           rator.java:57)
    ... 1 more

原因: com.thoughtworks.xstream.converters.reflection.ObjectAccessException:无法构造de.unisb.cs.st.evosuite.callgraph.DistanceTransformer$ClassEnt ry,因为它在com的com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProv ider.newInstance(PureJavaReflectionProvider.java:71) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv erter.instantiateNewInstance(AbstractReflectionConverter.java:308)没有无参数构造函数.thoughtworks.xstream.converters.reflection.AbstractReflectionConv erter.unmarshal(AbstractReflectionConverter.java:161) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall er.java:82) ...还有19个

我不明白这一点--有没有人能帮帮我--我已经为此挣扎了很久了。有关evosuite文档,请访问www.evosuite.org/documentation

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-07-27 06:50:40

我认为这是一个内部evosuite错误,由于某种原因,在cygwin中运行它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11659963

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档