1
|
/**
|
2
|
* Copyright (C) 2009 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.dataportal.selenium.tests.reference;
|
10
|
|
11
|
import java.net.MalformedURLException;
|
12
|
import java.util.List;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import org.junit.Before;
|
16
|
import org.junit.Test;
|
17
|
import org.openqa.selenium.WebElement;
|
18
|
|
19
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
20
|
import eu.etaxonomy.dataportal.ElementUtils;
|
21
|
import eu.etaxonomy.dataportal.StringConstants;
|
22
|
import eu.etaxonomy.dataportal.elements.BaseElement;
|
23
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
24
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
25
|
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
|
26
|
|
27
|
/**
|
28
|
* Issues to be covered by this TestClass:
|
29
|
*
|
30
|
* #5676
|
31
|
* #5647 - OK
|
32
|
* #5492 - OK
|
33
|
*
|
34
|
* @author a.kohlbecker
|
35
|
*
|
36
|
*/
|
37
|
|
38
|
@DataPortalContexts( { DataPortalSite.reference })
|
39
|
public class MisappliedNamesTest extends CdmDataPortalTestBase{
|
40
|
|
41
|
static final UUID miconia_cubacinerea_Uuid = UUID.fromString("c6716cee-2039-4ba8-a239-4b1b353f9c84");
|
42
|
|
43
|
|
44
|
static final UUID trichocentrum_undulatum_Uuid = UUID.fromString("7e86b2a4-ba71-4494-b544-ae5656e02ed2");
|
45
|
|
46
|
@Before
|
47
|
public void setUp() throws Exception {
|
48
|
driver.get(getContext().getBaseUri().toString());
|
49
|
}
|
50
|
|
51
|
/**
|
52
|
* Test for correct sensu representation of misapplied names, see #5676 and #5647
|
53
|
*
|
54
|
* https://dev.e-taxonomy.eu/redmine/issues/5647
|
55
|
*
|
56
|
* NOTE: Species solaris has no authorship!!
|
57
|
*/
|
58
|
@Test
|
59
|
public void tesIssue5647() throws MalformedURLException {
|
60
|
|
61
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), miconia_cubacinerea_Uuid);
|
62
|
|
63
|
WebElement misappliedName = p.getMisappliedName(1);
|
64
|
assertNotNull(misappliedName);
|
65
|
assertEquals("–\n\"Ossaea glomerata\" sensu Species solaris; sensu A&S; sensu Lem1", misappliedName.getText());
|
66
|
List<BaseElement> footnotes = ElementUtils.findFootNotes(p.getTaxonRelationships());
|
67
|
assertEquals(1, footnotes.size());
|
68
|
assertEquals("1. Lem, New Species in the solar system", footnotes.get(0).getText());
|
69
|
|
70
|
}
|
71
|
|
72
|
|
73
|
/**
|
74
|
* https://dev.e-taxonomy.eu/redmine/issues/5492
|
75
|
*/
|
76
|
@Test
|
77
|
public void testIssue5492() throws MalformedURLException {
|
78
|
|
79
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), trichocentrum_undulatum_Uuid);
|
80
|
|
81
|
WebElement misappliedName1 = p.getMisappliedName(1);
|
82
|
assertNotNull(misappliedName1);
|
83
|
assertEquals("–\n\"Oncidium guttatum\" auct. sensu Greuter, W. & Rankin Rodríguez, R1", misappliedName1.getText());
|
84
|
|
85
|
WebElement misappliedName2 = p.getMisappliedName(2);
|
86
|
assertNotNull(misappliedName2);
|
87
|
assertEquals("–\n" + StringConstants.DOUBTFULMARKER_SPACE +"\"Oncidium carthaginense\" auct. sensu Greuter, W. & Rankin Rodríguez, R1", misappliedName2.getText());
|
88
|
|
89
|
|
90
|
List<BaseElement> footnotes = ElementUtils.findFootNotes(p.getTaxonRelationships());
|
91
|
assertEquals(1, footnotes.size());
|
92
|
assertEquals("1. Greuter, W. & Rankin Rodríguez, R, Plantas vasculares de Cuba: inventario preliminar. Tercera edición, actualizada. Vascular plants of Cuba: a preliminary checklist. Third updated edition.", footnotes.get(0).getText());
|
93
|
|
94
|
}
|
95
|
|
96
|
|
97
|
|
98
|
}
|