The org.junit
package defines the Assert
class for JUnit testing. How can I retrieve this static class as a JClass
in the CodeModel
framework?
Asked
Active
Viewed 238 times
0

Jérôme Verstrynge
- 57,710
- 92
- 283
- 453
1 Answers
2
I think I found it:
import com.sun.codemodel.JCodeModel;
import org.junit.Assert;
...
JCodeModel jcm = new JCodeModel();
assertClass = jcm.ref(Assert.class);

Jérôme Verstrynge
- 57,710
- 92
- 283
- 453