Revision 8e9115f6
Added by Katja Luther almost 6 years ago
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/TaxonDaoHibernateImplTest.java | ||
---|---|---|
1038 | 1038 |
} |
1039 | 1039 |
} |
1040 | 1040 |
|
1041 |
@Test |
|
1042 |
@DataSet ("TaxonDaoHibernateImplTest.testGetTaxaByNameAndArea.xml") |
|
1043 |
public final void testGetTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(){ |
|
1044 |
Classification classification = classificationDao.findByUuid(classificationUuid); |
|
1045 |
List<UuidAndTitleCache<TaxonNode>> result = taxonDao.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classification, null, null); |
|
1046 |
assertNotNull(result); |
|
1047 |
assertEquals(5, result.size()); |
|
1048 |
|
|
1049 |
//test exclude |
|
1050 |
UUID excludeUUID = UUID.fromString("a9f42927-e507-4fda-9629-62073a908aae"); |
|
1051 |
List<UUID> excludeUUids = new ArrayList<>(); |
|
1052 |
excludeUUids.add(excludeUUID); |
|
1053 |
result = taxonDao.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classification, null, null); |
|
1054 |
assertEquals(5, result.size()); |
|
1055 |
|
|
1056 |
//test limit |
|
1057 |
int limit = 2; |
|
1058 |
result = taxonDao.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classification, limit, null); |
|
1059 |
assertEquals(2, result.size()); |
|
1060 |
|
|
1061 |
//test pattern |
|
1062 |
String pattern = "*Rothschi*"; |
|
1063 |
result = taxonDao.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classification, 2, pattern); |
|
1064 |
assertNotNull(result); |
|
1065 |
assertEquals(1, result.size()); |
|
1066 |
assertEquals("0b5846e5-b8d2-4ca9-ac51-099286ea4adc", result.get(0).getUuid().toString()); |
|
1067 | 1041 |
|
1068 |
} |
|
1069 | 1042 |
|
1070 | 1043 |
|
1071 | 1044 |
@Test |
... | ... | |
1168 | 1141 |
Assert.assertSame("Returned object should be the same proxy to assure that we ran initialization on this proxy", taxonProxy, taxon); |
1169 | 1142 |
} |
1170 | 1143 |
|
1144 |
|
|
1145 |
|
|
1171 | 1146 |
/** |
1172 | 1147 |
* {@inheritDoc} |
1173 | 1148 |
*/ |
Also available in: Unified diff
add the possibility to search for classifications in getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification