Revision 83ec5bc6
Added by Katja Luther almost 13 years ago
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/IdentifiableDaoBaseTest.java | ||
---|---|---|
27 | 27 |
import eu.etaxonomy.cdm.model.media.Rights; |
28 | 28 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
29 | 29 |
import eu.etaxonomy.cdm.persistence.dao.hibernate.taxon.TaxonDaoHibernateImpl; |
30 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
|
30 | 31 |
import eu.etaxonomy.cdm.test.integration.CdmIntegrationTest; |
31 | 32 |
|
32 | 33 |
/** |
... | ... | |
67 | 68 |
assertEquals("findByTitle should return an entity with uuid " + uuid,uuid, results.get(0).getUuid()); |
68 | 69 |
} |
69 | 70 |
|
71 |
@Test |
|
72 |
public void testCountByTitle() { |
|
73 |
int result = identifiableDao.countByTitle("%"); |
|
74 |
assertNotNull("findByTitle should return an integer",result); |
|
75 |
assertEquals("findByTitle should return 2", 2, result); |
|
76 |
|
|
77 |
result = identifiableDao.countByTitle("%", MatchMode.LIKE, null); |
|
78 |
assertNotNull("findByTitle should return an integer",result); |
|
79 |
assertEquals("findByTitle should return 2", 2, result); |
|
80 |
|
|
81 |
result = identifiableDao.countByTitle("Lorem"); |
|
82 |
assertNotNull("findByTitle should return an integer",result); |
|
83 |
assertEquals("findByTitle should return 1", 1, result); |
|
84 |
|
|
85 |
result = identifiableDao.countByTitle("Lorem", MatchMode.LIKE, null); |
|
86 |
assertNotNull("findByTitle should return an integer",result); |
|
87 |
assertEquals("findByTitle should return 1", 1, result); |
|
88 |
} |
|
70 | 89 |
@Test |
71 | 90 |
public void testGetRights() { |
72 | 91 |
TaxonBase taxon = identifiableDao.findByUuid(uuid); |
Also available in: Unified diff
countByTitle() method for IIdentifiableService