Project

General

Profile

Download (5.33 KB) Statistics
| Branch: | Tag: | Revision:
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
32
 * #5492
33
 * #7658 + #6682
34
 *
35
 * @author a.kohlbecker
36
 *
37
 */
38

    
39
@DataPortalContexts( { DataPortalSite.reference })
40
public class MisappliedNamesTest extends CdmDataPortalTestBase{
41

    
42
    static final UUID miconia_cubacinerea_Uuid = UUID.fromString("c6716cee-2039-4ba8-a239-4b1b353f9c84");
43

    
44
    static final UUID trichocentrum_undulatum_Uuid = UUID.fromString("7e86b2a4-ba71-4494-b544-ae5656e02ed2");
45

    
46
    static final UUID nepenthes_abalata_Uuid = UUID.fromString("9b588d8a-c4fa-430a-b9c7-026bf715ecf6");
47

    
48

    
49

    
50
    @Before
51
    public void setUp() throws Exception {
52
        driver.get(getContext().getBaseUri().toString());
53
    }
54

    
55
    /**
56
     * Test for correct sensu representation of misapplied names, see #5676, #5647 and #7658
57
     *
58
     * https://dev.e-taxonomy.eu/redmine/issues/5647
59
     * https://dev.e-taxonomy.eu/redmine/issues/7658
60
     *
61
     * NOTE: Species solaris has no authorship!!
62
     */
63
    @Test
64
    public void tesIssue5647() throws MalformedURLException {
65

    
66
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), miconia_cubacinerea_Uuid);
67

    
68

    
69
        assertEquals("–\n\"Ossaea glomerata\" sensu A&S1; sensu A&S: 221; sensu A&S: 331; sensu Lem2; sensu Species solaris; auct.; auct. sensu A&S1; auctrs. afr.", p.getMisappliedName(1).getText());
70
        // with doubtful flag
71
        assertEquals("–\n" + StringConstants.DOUBTFULMARKER_SPACE +"\"Ossaea glomerata\" sensu A&S1", p.getMisappliedName(2).getText());
72
        // Test also invalid designation which is rendered with the misapplied names
73
        assertEquals("–\nOssaea maculata sec. Lem2, rel. sec. A&S1", p.getMisappliedName(3).getText());
74

    
75
        List<BaseElement> footnotes = ElementUtils.findFootNotes(p.getTaxonRelationships());
76
        assertEquals(2, footnotes.size());
77
        assertEquals("1. A&S, Plantas vasculares de Oz", footnotes.get(0).getText());
78
        assertEquals("2. Lem, New Species in the solar system", footnotes.get(1).getText());
79
        // "Species solaris" must not be in the footnotes as it has the same title as the short citation
80

    
81
    }
82

    
83

    
84
    /**
85
     * https://dev.e-taxonomy.eu/redmine/issues/5492
86
     */
87
    @Test
88
    public void testIssue5492() throws MalformedURLException {
89

    
90
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), trichocentrum_undulatum_Uuid);
91

    
92
        WebElement misappliedName1 = p.getMisappliedName(1);
93
        assertNotNull(misappliedName1);
94
        assertEquals("–\n" + StringConstants.DOUBTFULMARKER_SPACE +"\"Oncidium carthaginense\" auct. sensu Greuter, W. & Rankin Rodríguez, R1", misappliedName1.getText());
95

    
96
        WebElement misappliedName2 = p.getMisappliedName(2);
97
        assertNotNull(misappliedName2);
98
        assertEquals("–\n\"Oncidium guttatum\" auct. sensu Greuter, W. & Rankin Rodríguez, R1", misappliedName2.getText());
99

    
100

    
101

    
102
        List<BaseElement> footnotes = ElementUtils.findFootNotes(p.getTaxonRelationships());
103
        assertEquals(1, footnotes.size());
104
        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());
105
    }
106

    
107
    /**
108
     * https://dev.e-taxonomy.eu/redmine/issues/7658
109
     * https://dev.e-taxonomy.eu/redmine/issues/6682
110
     *
111
     * TODO 1b) Der Buchlink verweist auf den Protolog von N. blancoi Blume – der hat ja aber gerade nichts mit
112
     * dieser Namensanwendung zu tun (also: Protologbildlinks müssen bei MAN weggelassen werden oder der Link
113
     * muss nach dem <non Blume> eingefügt werden)
114
     */
115
    @Test
116
    public void testIssue7658() throws MalformedURLException {
117

    
118

    
119
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), nepenthes_abalata_Uuid);
120

    
121
        WebElement misappliedName1 = p.getMisappliedName(1);
122
        assertNotNull(misappliedName1);
123
        assertEquals("–\n\"Nepenthes alata\" pro parte, sensu Cheek, M.R. & Jebb, M.H.P. 20011, non Blanco, err. sec. Cheek, M.R. & Jebb, M.H.P. 20132", misappliedName1.getText());
124

    
125
        WebElement misappliedName2 = p.getMisappliedName(2);
126
        assertNotNull(misappliedName2);
127
        assertEquals("–\n\"Nepenthes blancoi\" pro parte, sensu Macfarlane 19083, non Blume, err. sec. Cheek, M.R. & Jebb, M.H.P. 20132", misappliedName2.getText());
128

    
129
        List<BaseElement> footnotes = ElementUtils.findFootNotes(p.getTaxonRelationships());
130
        assertEquals(3, footnotes.size());
131
   }
132

    
133
}
    (1-1/1)