标签: java junit assert sun-codemodel
org.junit包定义了JUnit测试的Assert类。如何在JClass框架中将此静态类检索为CodeModel?
org.junit
Assert
JClass
CodeModel
答案 0 :(得分:2)
我想我找到了它:
import com.sun.codemodel.JCodeModel; import org.junit.Assert; ... JCodeModel jcm = new JCodeModel(); assertClass = jcm.ref(Assert.class);