导入org.junit无法解析

时间:2014-06-06 21:12:55

标签: eclipse junit

我在Eclipse中有一个以下开头的类文件:

package org.jsoup.parser;

import org.junit.Assert.*;
import org.junit.Test;
import org.jsoup.nodes.Document;
import org.jsoup.parser.HtmlTreeBuilder;

但是,Eclipse表示无法解析org.junit的错误。我已经修改了项目属性以在类路径中包含jUnit 3,因此不知道该怎么做。

想法?

编辑:我已按照建议添加了jUnit 4,但无济于事......

enter image description here

1 个答案:

答案 0 :(得分:4)

如果你想使用org.junit.Assert,你应该包括JUnit 4.JUnit 3使用junit.framework.*包。

相关问题