15 |
15 |
import java.io.FileNotFoundException;
|
16 |
16 |
import java.util.ArrayList;
|
17 |
17 |
import java.util.HashMap;
|
|
18 |
import java.util.HashSet;
|
18 |
19 |
import java.util.List;
|
19 |
20 |
import java.util.Map;
|
20 |
21 |
import java.util.Set;
|
... | ... | |
29 |
30 |
import org.unitils.spring.annotation.SpringBeanByType;
|
30 |
31 |
|
31 |
32 |
import eu.etaxonomy.cdm.model.common.Language;
|
|
33 |
import eu.etaxonomy.cdm.model.location.NamedArea;
|
32 |
34 |
import eu.etaxonomy.cdm.model.term.Representation;
|
33 |
35 |
import eu.etaxonomy.cdm.model.term.TermType;
|
34 |
36 |
import eu.etaxonomy.cdm.model.term.TermVocabulary;
|
35 |
37 |
import eu.etaxonomy.cdm.persistence.dao.term.ITermVocabularyDao;
|
|
38 |
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
|
36 |
39 |
import eu.etaxonomy.cdm.test.integration.CdmIntegrationTest;
|
37 |
40 |
import eu.etaxonomy.cdm.test.unitils.CleanSweepInsertLoadStrategy;
|
38 |
41 |
|
... | ... | |
166 |
169 |
|
167 |
170 |
}
|
168 |
171 |
|
|
172 |
@Test
|
|
173 |
public void testFindVocabularyDtoByTermTypes(){
|
|
174 |
Set<TermType> termTypes = new HashSet<>();
|
|
175 |
termTypes.add(TermType.NamedArea);
|
|
176 |
List<TermVocabularyDto> vocDto = dao.findVocabularyDtoByTermTypes(termTypes, true);
|
|
177 |
Assert.assertEquals(4, vocDto.size());
|
|
178 |
|
|
179 |
//#9825 test deduplication
|
|
180 |
@SuppressWarnings("unchecked")
|
|
181 |
TermVocabulary<NamedArea> continentVoc = dao.findByUuid(NamedArea.uuidContinentVocabulary);
|
|
182 |
continentVoc.addRepresentation(Representation.NewInstance("Kontinente", "Kontinente", "Kont.", Language.GERMAN()));
|
|
183 |
dao.flush();
|
|
184 |
vocDto = dao.findVocabularyDtoByTermTypes(termTypes, true);
|
|
185 |
Assert.assertEquals("Deduplication for representations does not work", 4, vocDto.size());
|
|
186 |
}
|
|
187 |
|
169 |
188 |
@Override
|
170 |
189 |
public void createTestDataSet() throws FileNotFoundException {}
|
171 |
190 |
}
|
ref #9825 revert "failing" deduplication and add test showing that deduplication works on dao level