Revision 8051fca9
Added by Andreas Müller about 13 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/DescriptionServiceImplTest.java | ||
---|---|---|
24 | 24 |
import org.unitils.spring.annotation.SpringBeanByType; |
25 | 25 |
|
26 | 26 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
27 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
|
27 | 28 |
import eu.etaxonomy.cdm.model.common.Language; |
28 | 29 |
import eu.etaxonomy.cdm.model.common.LanguageString; |
29 | 30 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
30 | 31 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
32 |
import eu.etaxonomy.cdm.model.description.Feature; |
|
31 | 33 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
32 | 34 |
import eu.etaxonomy.cdm.model.description.TextData; |
33 | 35 |
import eu.etaxonomy.cdm.test.integration.CdmIntegrationTest; |
... | ... | |
43 | 45 |
|
44 | 46 |
@SpringBeanByType |
45 | 47 |
private IDescriptionService service; |
46 |
|
|
48 |
|
|
49 |
@SpringBeanByType |
|
50 |
private ITermService termService; |
|
51 |
|
|
47 | 52 |
|
48 | 53 |
|
49 | 54 |
@Test |
... | ... | |
67 | 72 |
while (entryIterator.hasNext()){ |
68 | 73 |
Entry <Language, LanguageString> entry = (Entry<Language, LanguageString>) entryIterator.next(); |
69 | 74 |
LanguageString langString = entry.getValue(); |
70 |
System.out.println(langString); |
|
75 |
// System.out.println(langString);
|
|
71 | 76 |
langString.setText("blablubber"); |
72 | 77 |
} |
73 | 78 |
} |
... | ... | |
84 | 89 |
while (entryIterator.hasNext()){ |
85 | 90 |
Entry <Language, LanguageString> entry = (Entry<Language, LanguageString>) entryIterator.next(); |
86 | 91 |
LanguageString langString = entry.getValue(); |
87 |
System.out.println(langString); |
|
92 |
// System.out.println(langString);
|
|
88 | 93 |
} |
89 | 94 |
} |
90 | 95 |
} |
91 | 96 |
|
92 | 97 |
@Test |
93 | 98 |
public void testMoveDescriptionElementsToTaxon(){ |
99 |
UUID commonNameFeatureUuid = Feature.COMMON_NAME().getUuid(); |
|
100 |
|
|
101 |
Feature commonNameFeature = (Feature)termService.find(commonNameFeatureUuid); |
|
94 | 102 |
|
95 | 103 |
TaxonDescription sourceDescription = TaxonDescription.NewInstance(); |
96 | 104 |
|
97 | 105 |
TextData element = TextData.NewInstance(); |
106 |
element.setFeature(commonNameFeature); |
|
98 | 107 |
sourceDescription.addElement(element); |
99 | 108 |
TextData element2 = TextData.NewInstance(); |
109 |
element2.setFeature(commonNameFeature); |
|
100 | 110 |
sourceDescription.addElement(element2); |
101 | 111 |
Collection<DescriptionElementBase> sourceCollection = new HashSet<DescriptionElementBase>(); |
102 | 112 |
sourceCollection.addAll(sourceDescription.getElements()); |
103 | 113 |
TextData element3 = TextData.NewInstance(); |
114 |
element3.setFeature(commonNameFeature); |
|
115 |
|
|
104 | 116 |
sourceDescription.addElement(element3); |
105 | 117 |
|
106 | 118 |
Assert.assertEquals(3, sourceDescription.getElements().size()); |
Also available in: Unified diff
tests for image galleries in derived unit facade and bugfix for test in DescriptionServiceImplTest which didn't run in maven.