package visor_ece.pruebas; // Generated ${date} by Hibernate Tools ${version} <#assign importz> ${pojo.importType("package.NotaDAO")} ${pojo.importType("package.PacienteDAO")} ${pojo.importType("junit.framework.Test")} ${pojo.importType("junit.framework.TestCase")} ${pojo.importType("junit.framework.TestSuite")} ${pojo.importType("java.util.List")} <#assign classbody> <#assign declarationName = pojo.importType(pojo.getDeclarationName())+'Test'>/** * JUnit object for domain model class ${pojo.declarationName}. * @see ${pojo.getQualifiedDeclarationName()} * @author Hibernate-Tools */ public class ${declarationName} extends TestCase{ /** * Create the test case * * @param testName * name of the test case */ public ${declarationName}(String testName) { super(testName); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite(${declarationName}.class); } <#if declarationName?starts_with("Nota")> @SuppressWarnings("unchecked") public void testApp(){ NotaDAO dao = new NotaDAO(); PacienteDAO pd = new PacienteDAO(); Paciente paciente = pd.buscaPorCURP("${pojo.getMetaAsString("CURP_PRUEBA")}"); assertNotNull(paciente); List<${pojo.declarationName}> notas = dao.notas(paciente,"${pojo.declarationName}"); for (Object object : notas) { ${pojo.declarationName} nota = (${pojo.declarationName})object; System.out.println(nota); <#foreach field in pojo.getAllPropertiesIterator()> <#if !pojo.getMetaAttribAsBool(field, "optional", false)> assertNotNull(nota.${pojo.getGetterSignature(field)}()); <#assign javaType=pojo.getJavaTypeName(field,true) /> System.out.println("------------------------------"); System.out.println("${pojo.getPropertyName(field)}"); <#if javaType?starts_with("List")||javaType?starts_with("Set")> assertTrue(nota.${pojo.getGetterSignature(field)}().size()>0); for(Object elemento : nota.${pojo.getGetterSignature(field)}()){ System.out.print("\t\t"); System.out.println(elemento); } <#else> System.out.println(nota.${pojo.getGetterSignature(field)}()); } } } import mx.gob.imss.didt.ctsm.dsece.pojo.Paciente; import ${pojo.getQualifiedDeclarationName()}; ${pojo.generateImports()} ${classbody}