import java.util.Set;\r
import java.util.UUID;\r
\r
-import junit.framework.Assert;\r
-\r
import org.apache.log4j.Logger;\r
+import org.junit.Assert;\r
import org.junit.Before;\r
-import org.junit.Ignore;\r
import org.junit.Test;\r
import org.unitils.dbunit.annotation.DataSet;\r
import org.unitils.spring.annotation.SpringBeanByName;\r
import eu.etaxonomy.cdm.model.description.TextData;\r
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;\r
import eu.etaxonomy.cdm.model.name.NonViralName;\r
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
import eu.etaxonomy.cdm.model.reference.Reference;\r
import eu.etaxonomy.cdm.model.taxon.Classification;\r
import eu.etaxonomy.cdm.model.taxon.Synonym;\r
private static final Logger logger = Logger.getLogger(NormalExplicitImportTest.class);\r
\r
@SpringBeanByName\r
- CdmApplicationAwareDefaultImport defaultImport;\r
+ CdmApplicationAwareDefaultImport<?> defaultImport;\r
\r
@SpringBeanByType\r
INameService nameService;\r
\r
@Test\r
@DataSet\r
- @Ignore //does run standalone, but not in suite (maven)\r
public void testDoInvoke() {\r
//printDataSet(System.out);\r
boolean result = defaultImport.invoke(configurator);\r
Set<Synonym> synonyms = noctuaPronubaTaxon.getSynonyms();\r
assertEquals("Number of synonyms should be 1", 1, synonyms.size());\r
Synonym synonym = synonyms.iterator().next();\r
- assertEquals("Synonym name should be ", "Noctua atlantica", ((NonViralName)synonym.getName()).getNameCache());\r
+ assertEquals("Synonym name should be ", "Noctua atlantica", ((NonViralName<?>)synonym.getName()).getNameCache());\r
Set<TaxonDescription> descriptions = noctuaPronubaTaxon.getDescriptions();\r
Assert.assertEquals("Number of descriptions should be 1", 1, descriptions.size());\r
TaxonDescription taxonDescription = descriptions.iterator().next();\r
\r
@Test\r
@DataSet(value="NormalExplicitImportTest.testUuid.xml")\r
- @Ignore //does run standalone, but not in suite (maven)\r
public void testUUID() throws URISyntaxException{\r
UUID taxonUuid = UUID.fromString("aafce7fe-0c5f-42ed-814b-4c7c2c715660");\r
UUID synonymUuid = UUID.fromString("fc4a995b-37a9-4984-afe6-e352c6c04d92");\r
assertEquals("Unexpected description text", expectedText, text);\r
assertEquals("Number of source elements should be 1", 1, textData.getSources().size());\r
DescriptionElementSource source = textData.getSources().iterator().next();\r
- Reference ref = source.getCitation();\r
+ Reference<?> ref = source.getCitation();\r
assertNotNull("Citation should not be null", ref);\r
assertNotNull("AuthorTeam should not be null", ref.getAuthorTeam());\r
assertEquals("Source author should be 'Meyer et. al.'", "Meyer et. al.",ref.getAuthorTeam().getTitleCache());\r
assertEquals("Publication title should be 'My first book'", "My first book", ref.getTitle());\r
assertEquals("Publication year should be '1987'", "1987", ref.getYear());\r
-\r
+ TaxonNameBase<?,?> nameUsedInSource = source.getNameUsedInSource();\r
+ assertNotNull("Name used in source should not be null", nameUsedInSource);\r
+ assertEquals("Name used in source title should be ", "Abies", nameUsedInSource.getTitleCache());\r
+ \r
+ \r
//synonym\r
expectedText = "A synonym description";\r
textData = getTextElement(description, expectedText);\r
assertEquals("Unexpected feature", Feature.DESCRIPTION(), feature);\r
assertEquals("There should be exactly 1 language", 1,textData.getMultilanguageText().size());\r
language = textData.getMultilanguageText().keySet().iterator().next();\r
- assertEquals("Language should be Spanish", Language.SPANISH_CATALAN(), language);\r
+ assertEquals("Language should be Spanish", Language.SPANISH_CASTILIAN(), language);\r
text = textData.getText(language);\r
assertEquals("Unexpected description text", expectedText, text);\r
assertEquals("Number of source elements should be 1", 1, textData.getSources().size());\r
assertEquals("Source author should be 'Theys, A.'", "Theys, A.",ref.getAuthorTeam().getTitleCache());\r
assertEquals("Publication title should be 'The ultimate book'", "The ultimate book", ref.getTitle());\r
assertEquals("Publication year should be '2011'", "2011", ref.getYear());\r
+ nameUsedInSource = source.getNameUsedInSource();\r
+ assertNotNull("Name used in source should not be null", nameUsedInSource);\r
+ assertEquals("Name used in source title should be Pinus", "Pinus", nameUsedInSource.getTitleCache());\r
\r
}\r
\r