0

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?

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

1 Answers1

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