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",
68 "Coll. L.P.B.V. No. 0736",
69 "Coll. Ruhr University-Bochum, Inst. of Geology No. 11532",
70 "Coll. Paläontol. Inst. Univ. Bucuresti. Nr. 2515",
71 "Coll. Dr.h.c. R. Mundlos (Bad Friedrichshall, später Stuttgart) Inv. Nr. P 1396",
72 "Inst. Geological Sciences, Acad. Sci. Belarus, Minsk N 212 A",
73 "Coll. Lange-Bertalot, Bot. Inst., Univ. Frankfurt/Main, Germany",
74 "in coll. H. F. Paulus (Wien)",
78 for (String t
: typeStrings
) {
79 Assert
.notNull(importer
.parseSpecimenType(fu
, IAPTExcelImport
.TypesName
.holotype
, collection
, t
, "0"), "Could not parse: " + t
);