/** * Uses Nested Search Criteria for search Verifies that the results are returned Verifies size of * the result set Verifies that none of the attribute is null * * @throws ApplicationException */ public void testEntireObjectNestedSearch1() throws ApplicationException { PrivateTeacher searchObject = new PrivateTeacher(); Collection results = getApplicationService() .search( "gov.nih.nci.cacoresdk.domain.inheritance.abstrakt.PrivateTeacher", searchObject); assertNotNull(results); assertEquals(3, results.size()); for (Iterator i = results.iterator(); i.hasNext(); ) { PrivateTeacher result = (PrivateTeacher) i.next(); assertNotNull(result); assertNotNull(result.getId()); assertNotNull(result.getName()); assertNotNull(result.getYearsExperience()); } }
/** * Uses CQL Criteria for search Verifies that the results are returned Verifies size of the result * set Verifies that none of the attribute is null * * @throws ApplicationException */ public void testEntireObjectCQL1() throws ApplicationException { CQLQuery cqlQuery = new CQLQuery(); CQLObject target = new CQLObject(); target.setName("gov.nih.nci.cacoresdk.domain.inheritance.abstrakt.PrivateTeacher"); cqlQuery.setTarget(target); Collection results = getApplicationService().query(cqlQuery); assertNotNull(results); assertEquals(3, results.size()); for (Iterator i = results.iterator(); i.hasNext(); ) { PrivateTeacher result = (PrivateTeacher) i.next(); assertNotNull(result); assertNotNull(result.getId()); assertNotNull(result.getName()); assertNotNull(result.getYearsExperience()); } }