【发布时间】:2011-08-08 21:58:15
【问题描述】:
org.junit 包定义了用于 JUnit 测试的 Assert 类。如何在CodeModel 框架中将这个静态类作为JClass 检索?
【问题讨论】:
标签: java junit assert sun-codemodel
org.junit 包定义了用于 JUnit 测试的 Assert 类。如何在CodeModel 框架中将这个静态类作为JClass 检索?
【问题讨论】:
标签: java junit assert sun-codemodel
我想我找到了:
import com.sun.codemodel.JCodeModel;
import org.junit.Assert;
...
JCodeModel jcm = new JCodeModel();
assertClass = jcm.ref(Assert.class);
【讨论】: