Generate the test Java class declaration.
(atj-gen-test-class tests$ deep$ guards$ no-aij-types$ java-class$ verbose$ pkg-class-names fn-method-names wrld) → class
This is generated only if the
This is a public class that contains all the generated methods. [JLS14:7.6] says that a Java implementation may require public classes to be in files with the same names (plus extension). The code that we generate satisfies this requirement.
Function:
(defun atj-gen-test-class (tests$ deep$ guards$ no-aij-types$ java-class$ verbose$ pkg-class-names fn-method-names wrld) (declare (xargs :guard (and (atj-test-listp tests$) (booleanp deep$) (booleanp guards$) (booleanp no-aij-types$) (stringp java-class$) (booleanp verbose$) (string-string-alistp pkg-class-names) (symbol-string-alistp fn-method-names) (plist-worldp wrld)))) (let ((__function__ 'atj-gen-test-class)) (declare (ignorable __function__)) (b* (((run-when verbose$) (cw "~%Generate the Java methods to run the tests:~%")) (test-methods (atj-gen-test-methods tests$ deep$ guards$ no-aij-types$ java-class$ verbose$ pkg-class-names fn-method-names wrld)) ((run-when verbose$) (cw "~%Generate the test Java class.~%")) (failures-field (atj-gen-test-failures-field)) (main-method (atj-gen-test-main-method tests$ java-class$ no-aij-types$)) (body-class (append (list (jcbody-element-member (jcmember-field failures-field))) (jmethods-to-jcbody-elements test-methods) (list (jcbody-element-member (jcmember-method main-method)))))) (make-jclass :access (jaccess-public) :abstract? nil :static? nil :final? nil :strictfp? nil :name (str::cat java-class$ "Tests") :superclass? nil :superinterfaces nil :body body-class))))
Theorem:
(defthm jclassp-of-atj-gen-test-class (b* ((class (atj-gen-test-class tests$ deep$ guards$ no-aij-types$ java-class$ verbose$ pkg-class-names fn-method-names wrld))) (jclassp class)) :rule-classes :rewrite)