1 package eu
.etaxonomy
.cdm
.io
.iapt
;
3 import eu
.etaxonomy
.cdm
.model
.occurrence
.Collection
;
4 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
5 import org
.junit
.Before
;
7 import org
.springframework
.util
.Assert
;
10 * Created by andreas on 9/15/16.
12 public class IAPTImportTest
{
14 IAPTExcelImport importer
= null;
18 System
.getProperties().put("TEST_MODE", "1");
19 importer
= new IAPTExcelImport();
23 public void testDateParser(){
25 String
[] dateStrings
= new String
[]{
35 "12 de Enero de 1999",
48 for (String d
: dateStrings
) {
49 Assert
.notNull(importer
.parseDate("0", d
), "Could not parse " + d
);
54 public void testSpecimentTypeParser(){
56 FieldUnit fu
= FieldUnit
.NewInstance();
57 Collection collection
= null;
59 String
[] typeStrings
= new String
[]{
60 "Coll. Lange-Bertalot, Bot. Inst., Univ. Frankfurt/Main, Germany Praep. No. Eu-PL 72",
64 "GAUF (Gansu Agricultural University) No. 1207-1222",
65 "KASSEL Coll. Krasske, Praep. DII 78",
66 "Coll. Lange-Bertalot, Botanisches Institut, Frankfurt am Main slide Eh-B 91",
67 "Coll. Østrup, Botan. Museum Copenhagen, Dänemark Praep. 3944",
71 for (String t
: typeStrings
) {
72 Assert
.notNull(importer
.parseSpecimenType(fu
, IAPTExcelImport
.TypesName
.holotype
, collection
, t
, "0"), "Could not parse: " + t
);