Project

General

Profile

Revision b9a4f351

IDb9a4f3514629137ea43ddaa41159da13fec2dca5
Parent 5e1b1f4e
Child 1b756c5f

Added by Andreas Kohlbecker almost 3 years ago

ref #6392 problems in selenium tests for palmweb solved
- disabled test active again
- splitting huge test method into multiple
- trimming reference citation strings in theme method
- replacing old custom reference ciatation string by generically string as provided by the cdm

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.references.theme
61 61
    $citation = $reference->titleCache;
62 62
  }
63 63

  
64
  $citation = trim($citation);
64 65
  if (isset($doLink) && $doLink === TRUE) {
65 66
    $out = '<span class="reference">';
66 67
    $out .= l($citation, path_to_reference($reference->uuid), array(
src/main/java/eu/etaxonomy/dataportal/elements/LinkElement.java
10 10
package eu.etaxonomy.dataportal.elements;
11 11

  
12 12
import static org.junit.Assert.assertEquals;
13
import static org.junit.Assert.assertTrue;
13 14

  
14 15
import org.openqa.selenium.WebElement;
15 16

  
......
55 56
		return testIfLinkElement(element.getElement(), text, href);
56 57
	}
57 58

  
58
	public static boolean testIfLinkElement(WebElement element, String text, String href) {
59
	/**
60
	 * @param element
61
	 * @param text
62
	 * @param hrefEndsWith
63
	 *   The actual link is must end with this. The full URL works of course also.
64
	 * @return
65
	 */
66
	public static boolean testIfLinkElement(WebElement element, String text, String hrefEndsWith) {
59 67
		assertEquals("a", element.getTagName());
60
		assertEquals(href, element.getAttribute("href"));
68
		assertTrue(element.getAttribute("href").endsWith(hrefEndsWith));
61 69
		assertEquals(text, element.getText());
62 70
		return true;
63 71
	}
src/test/java/eu/etaxonomy/dataportal/selenium/tests/palmae/Calamus_acanthospathus_TaxonProfileTest.java
34 34

  
35 35
    static UUID taxonUuid = UUID.fromString("bb340c78-880e-4dd0-91ff-81788a482b31");
36 36

  
37
    TaxonProfilePage p = null;
37
    static TaxonProfilePage p = null;
38

  
39
    /**
40
     * NOTE
41
     *
42
     * This was formerly formated as '" + evans_et_al_referenceCitation + "' by special citation
43
     * string generation in the drupal code which need to be removed
44
     * in order to retain the maintainability of the code.
45
     */
46
    String evans_et_al_referenceCitation = "T. Evans & K. Sengdala & B. Thammavong & O.V. Viengkham & J. Dransfield, A Synopsis of the Rattans (Arecaceae: Calamoideae) of Laos and Neighbouring Parts of Indochina. 2002";
38 47

  
39 48
    @Before
40 49
    public void setUp() throws MalformedURLException {
41 50

  
42
        p = new TaxonProfilePage(driver, getContext(), taxonUuid);
51
        if(p == null){
52
            p = new TaxonProfilePage(driver, getContext(), taxonUuid);
53
        }
43 54

  
44 55
    }
45 56

  
......
69 80

  
70 81

  
71 82
    @Test
72
    //@Ignore /* ignoring until the change of T. Evans et al. 2002 to T. Evans, K. Sengdala, B. Thammavong, O.V. Viengkham and J. Dransfield. 2002 is clarified */
73
    public void testFeatures() {
83
    public void testFeatureToc() {
84

  
74 85
        assertEquals("Content", p.getTableOfContentHeader());
75 86
        List<LinkElement> links = p.getTableOfContentLinks();
76 87
        assertNotNull("Expecting a list of TOC links in the profile page.", links);
88
    }
89

  
90
    @Test
91
    public void testFeatureDistribution() {
77 92

  
78
        FeatureBlock featureBlock;
79 93
        int featureId = 0;
80 94

  
81 95
        int descriptionElementFontSize = 11;
82
        String expectedCssDisplay = "inline";
83 96
        String expectedListStyleType = "none";
97
        String expectedCssDisplay = "inline";
84 98
        String expectedListStylePosition = "outside";
85 99
        String expectedListStyleImage = "none";
86 100
        int indent = 23;
......
88 102
        /* distribution */
89 103
        String featureClass = "distribution";
90 104
        String featureLabel = "Distribution";
91
        String blockTextFull = featureLabel + "\n\n\nMap uses TDWG level 3 distributions (http://www.nhm.ac.uk/hosted_sites/tdwg/geogrphy.html)\n\nAssam, China South-Central, China Southeast, East Himalaya, India, Laos, Myanmar, Nepal, Thailand, Tibet (World Checklist of Monocotyledons)\nIndia (North-east), Bhutan, Myanmar, China (Tibet, South-east and South Yunnan), Thailand (North) and Laos (North). (T. Evans et al. 2002)";
105
        String blockTextFull = featureLabel + "\n\n\n\n\nMap uses TDWG level 3 distributions (http://www.nhm.ac.uk/hosted_sites/tdwg/geogrphy.html)\nAssam (World Checklist of Arecaceae), China South-Central (World Checklist of Arecaceae), China Southeast (World Checklist of Arecaceae), East Himalaya (World Checklist of Arecaceae), India (World Checklist of Arecaceae), Laos (World Checklist of Arecaceae), Myanmar (World Checklist of Arecaceae), Nepal (World Checklist of Arecaceae), Thailand (World Checklist of Arecaceae), Tibet (World Checklist of Arecaceae)\nIndia (North-east), Bhutan, Myanmar, China (Tibet, South-east and South Yunnan), Thailand (North) and Laos (North). (T. Evans & K. Sengdala & B. Thammavong & O.V. Viengkham & J. Dransfield, A Synopsis of the Rattans (Arecaceae: Calamoideae) of Laos and Neighbouring Parts of Indochina. 2002)";
92 106

  
93
        p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
94
        featureBlock = p.getFeatureBlockAt(featureId, featureClass, "div", "span");
107
        p.testTableOfContentEntry(featureId, featureLabel, featureClass);
108
        FeatureBlock featureBlockDistribution = p.getFeatureBlockAt(featureId, featureClass, "div", "span");
109

  
110
        assertEquals(blockTextFull, featureBlockDistribution.getText());
111
        featureBlockDistribution.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
112
        assertEquals(1, featureBlockDistribution.getOriginalSourcesSections().size());
113
        // NOTE: the first source has been deleted in latest data
114
        // assertTrue(LinkElement.testIfLinkElement(featureBlockDistribution.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "World Checklist of Monocotyledons", getContext().getBaseUri().toString()));
115
        assertTrue(LinkElement.testIfLinkElement(featureBlockDistribution.getOriginalSourcesSections().get(0).getLinksInElement().get(0), evans_et_al_referenceCitation, "cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
116

  
117
        assertNotNull("Expecting an OpenLayers map", featureBlockDistribution.getElement().findElement(By.id("openlayers-map-distribution")));
118
        assertEquals("Map uses TDWG level 3 distributions (http://www.nhm.ac.uk/hosted_sites/tdwg/geogrphy.html)", featureBlockDistribution.getElement().findElement(By.className("distribution_map_caption")).getText());
95 119

  
96
        assertEquals(blockTextFull, featureBlock.getText());
97
        featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
98
        assertEquals(2, featureBlock.getOriginalSourcesSections().size());
99
        assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "World Checklist of Monocotyledons", this.getContext().getBaseUri().toString()));
100
        assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(1).getLinksInElement().get(0), "T. Evans et al. 2002", this.getContext().getBaseUri().toString() + "?q=cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
120
    }
101 121

  
102
        assertNotNull("Expecting an OpenLayers map", featureBlock.getElement().findElement(By.id("openlayers-map-distribution")));
103
        assertEquals("Map uses TDWG level 3 distributions (http://www.nhm.ac.uk/hosted_sites/tdwg/geogrphy.html)", featureBlock.getElement().findElement(By.className("distribution_map_caption")).getText());
122
    @Test
123
    public void testFeatureBiologyAndEcology() {
104 124

  
125
        int featureId = 2;
126
        int descriptionElementFontSize = 11;
127
        String expectedCssDisplay = "inline";
128
        String expectedListStyleType = "none";
129
        String expectedListStylePosition = "outside";
130
        String expectedListStyleImage = "none";
131
        int indent = 23;
105 132

  
106 133
        /* Biology And Ecology */
107
        featureClass = "biology-and-ecology";
108
        featureLabel = "Biology And Ecology";
109
        blockTextFull = featureLabel + "\nEvergreen forest. In Laos at 1800 m, in Thailand at 1500 - 1700 m, in South Yunnan at 1600 m. (T. Evans et al. 2002)";
134
        String featureClass = "biology-and-ecology";
135
        String featureLabel = "Biology And Ecology";
136
        String blockTextFull = featureLabel + "\nEvergreen forest. In Laos at 1800 m, in Thailand at 1500 - 1700 m, in South Yunnan at 1600 m. (" + evans_et_al_referenceCitation + ")";
110 137
        expectedCssDisplay = "list-item";
111 138
        expectedListStyleType = "none";
112 139

  
113
        p.testTableOfContentEntry(featureId++,featureLabel, featureClass);
114
        featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
140
        p.testTableOfContentEntry(featureId,featureLabel, featureClass);
141
        FeatureBlock featureBlockBioEco = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
115 142

  
116
        assertEquals(blockTextFull, featureBlock.getText());
117
        featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
118
        assertEquals(1, featureBlock.getOriginalSourcesSections().size());
119
        assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "T. Evans et al. 2002", getContext().getBaseUri().toString() + "?q=cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
143
        assertEquals(blockTextFull, featureBlockBioEco.getText());
144
        featureBlockBioEco.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
145
        assertEquals(1, featureBlockBioEco.getOriginalSourcesSections().size());
146
        assertTrue(LinkElement.testIfLinkElement(featureBlockBioEco.getOriginalSourcesSections().get(0).getLinksInElement().get(0), evans_et_al_referenceCitation, "cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
147
    }
120 148

  
149
    @Test
150
    public void testFeatureConservation() {
151

  
152
        int featureId = 3;
153
        int descriptionElementFontSize = 11;
154
        String expectedListStyleType = "none";
155
        String expectedCssDisplay = "list-item";
156
        String expectedListStylePosition = "outside";
157
        String expectedListStyleImage = "none";
158
        int indent = 23;
121 159

  
122 160
        /* Conservation */
123
        featureClass = "conservation";
124
        featureLabel = "Conservation";
125
        blockTextFull = featureLabel + "\nOf moderate concern. In Indochina it apparently produces at most one or two additional stems and so probably regenerates poorly after harvesting, putting it at elevated risk even though it is widespread and occurs in high altitude forests, which are less threatened by agriculture and logging. It had declined severely due to harvesting in Sikkim over 100 years ago (Anderson 1869). (T. Evans et al. 2002)";
126
        expectedCssDisplay = "list-item";
127
        expectedListStyleType = "none";
161
        String featureClass = "conservation";
162
        String featureLabel = "Conservation";
163
        String blockTextFull = featureLabel + "\nOf moderate concern. In Indochina it apparently produces at most one or two additional stems and so probably regenerates poorly after harvesting, putting it at elevated risk even though it is widespread and occurs in high altitude forests, which are less threatened by agriculture and logging. It had declined severely due to harvesting in Sikkim over 100 years ago (Anderson 1869). (" + evans_et_al_referenceCitation + ")";
128 164

  
129 165
        p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
130
        featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
166
        FeatureBlock featureBlockConservation = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
131 167

  
132
        assertEquals(blockTextFull, featureBlock.getText());
133
        featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
134
        assertEquals(1, featureBlock.getOriginalSourcesSections().size());
135
        assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "T. Evans et al. 2002", getContext().getBaseUri().toString() + "?q=cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
168
        assertEquals(blockTextFull, featureBlockConservation.getText());
169
        featureBlockConservation.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
170
        assertEquals(1, featureBlockConservation.getOriginalSourcesSections().size());
171
        assertTrue(LinkElement.testIfLinkElement(featureBlockConservation.getOriginalSourcesSections().get(0).getLinksInElement().get(0), evans_et_al_referenceCitation, "cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
172
    }
173

  
174
    @Test
175
    public void testFeatureCommonName() {
176

  
177
        int featureId = 4;
178
        String expectedCssDisplay = "list-item";
179
        String expectedListStyleType = "none";
180
        int descriptionElementFontSize = 11;
181
        String expectedListStylePosition = "outside";
182
        String expectedListStyleImage = "none";
183
        int indent = 23;
136 184

  
137 185
        /* Common Name */
138
        featureClass = "common-name";
139
        featureLabel = "Common Name";
140
        blockTextFull = featureLabel + "\nwai hom (Lao Loum), blong eur (Khamu), wai hawm (Thailand) (T. Evans et al. 2002)";
141
        expectedCssDisplay = "list-item";
142
        expectedListStyleType = "none";
186
        String featureClass = "common-name";
187
        String featureLabel = "Common Name";
188
        String blockTextFull = featureLabel + "\nwai hom (Lao Loum), blong eur (Khamu), wai hawm (Thailand) (" + evans_et_al_referenceCitation + ")";
143 189

  
144 190
        p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
145
        featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
191
        FeatureBlock featureBlockCommonName = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
146 192

  
147
        assertEquals(blockTextFull, featureBlock.getText());
148
        featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
149
        assertEquals(1, featureBlock.getOriginalSourcesSections().size());
150
        assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "T. Evans et al. 2002", getContext().getBaseUri().toString() + "?q=cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
193
        assertEquals(blockTextFull, featureBlockCommonName.getText());
194
        featureBlockCommonName.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
195
        assertEquals(1, featureBlockCommonName.getOriginalSourcesSections().size());
196
        assertTrue(LinkElement.testIfLinkElement(featureBlockCommonName.getOriginalSourcesSections().get(0).getLinksInElement().get(0), evans_et_al_referenceCitation, "cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
197

  
198
    }
199

  
200
    @Test
201
    public void testFeatureUses() {
202

  
203
        int featureId = 5;
204
        String expectedCssDisplay = "list-item";
205
        String expectedListStyleType = "none";
206
        int descriptionElementFontSize = 11;
207
        String expectedListStylePosition = "outside";
208
        String expectedListStyleImage = "none";
209
        int indent = 23;
151 210

  
152 211
        /* Uses */
153
        featureClass = "uses";
154
        featureLabel = "Uses";
155
        blockTextFull = featureLabel + "\nThis species is highly valued for its excellent quality small-diameter cane throughout its range. There are small trial plantations in South Yunnan. (T. Evans et al. 2002)";
156
        expectedCssDisplay = "list-item";
157
        expectedListStyleType = "none";
212
        String featureClass = "uses";
213
        String featureLabel = "Uses";
214
        String  blockTextFull = featureLabel + "\nThis species is highly valued for its excellent quality small-diameter cane throughout its range. There are small trial plantations in South Yunnan. (" + evans_et_al_referenceCitation + ")";
158 215

  
159
        p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
160
        featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
216
        p.testTableOfContentEntry(featureId, featureLabel, featureClass);
217
        FeatureBlock featureBlockUses = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
218

  
219
        assertEquals(blockTextFull, featureBlockUses.getText());
220
        featureBlockUses.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
221
        assertEquals(1, featureBlockUses.getOriginalSourcesSections().size());
222
        assertTrue(LinkElement.testIfLinkElement(featureBlockUses.getOriginalSourcesSections().get(0).getLinksInElement().get(0), evans_et_al_referenceCitation, "cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
223
    }
161 224

  
162
        assertEquals(blockTextFull, featureBlock.getText());
163
        featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
164
        assertEquals(1, featureBlock.getOriginalSourcesSections().size());
165
        assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "T. Evans et al. 2002", getContext().getBaseUri().toString() + "?q=cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
225
    @Test
226
    public void testFeatureDiscussion() {
227

  
228
        int featureId = 1;
229
        String expectedCssDisplay = "list-item";
230
        String expectedListStyleType = "none";
231
        int descriptionElementFontSize = 11;
232
        String expectedListStylePosition = "outside";
233
        String expectedListStyleImage = "none";
234
        int indent = 23;
166 235

  
167 236
        /* Discussion */
168
        featureClass = "discussion";
169
        featureLabel = "Discussion";
237
        String featureClass = "discussion";
238
        String featureLabel = "Discussion";
170 239
        String blockTextBegin = featureLabel + "\nBeccari (1908) confidently synonymised C. montanus under C. acanthospathus on the basis of the protologue and some detached fruits at K. They match well but";
171
        String blockTextEnd = "represent arbitrary divisions in a continuum between more and less robust individuals. There is no doubt about their identity with C. acanthospathus, a conclusion also reached by Wei (1986). (T. Evans et al. 2002)";
172
        expectedCssDisplay = "list-item";
173
        expectedListStyleType = "none";
240
        String blockTextEnd = "represent arbitrary divisions in a continuum between more and less robust individuals. There is no doubt about their identity with C. acanthospathus, a conclusion also reached by Wei (1986). (" + evans_et_al_referenceCitation + ")";
174 241

  
175
        p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
176
        featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
242
        p.testTableOfContentEntry(featureId, featureLabel, featureClass);
243
        FeatureBlock featureBlockDiscussion = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
177 244

  
178
        assertTrue(featureBlock.getText().startsWith(blockTextBegin));
179
        assertTrue(featureBlock.getText().endsWith(blockTextEnd));
180
        featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
181
        assertEquals(1, featureBlock.getOriginalSourcesSections().size());
182
        assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "T. Evans et al. 2002", getContext().getBaseUri().toString() + "?q=cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
245
        assertTrue(featureBlockDiscussion.getText().startsWith(blockTextBegin));
246
        assertTrue(featureBlockDiscussion.getText().endsWith(blockTextEnd));
247
        featureBlockDiscussion.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
248
        assertEquals(1, featureBlockDiscussion.getOriginalSourcesSections().size());
249
        assertTrue(LinkElement.testIfLinkElement(featureBlockDiscussion.getOriginalSourcesSections().get(0).getLinksInElement().get(0), evans_et_al_referenceCitation, "cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
250
    }
183 251

  
184
        /* Discussion */
185
        featureClass = "materials-examined";
186
        featureLabel = "Materials Examined";
187
        blockTextBegin = featureLabel + "\nINDIA (NORTH-EAST): Sikkim, undated, (fr.), Hooker s.n. E72 (K); Khasia, undated, (pist.), Griffith 503 (K). BHUTAN: Sarbhang Distr., 2.5 km below Getchu on Chirang Road, 12 March 1982, (ster.)";
188
        blockTextEnd = "A. 5293 (K, BM, BK). LAOS (NORTH): Huaphanh Province, Viengthong Distr., Ban Sakok, Phou Loeuy Noy, 21 June 1999, (fr.), Oulathong OL 231 (FRCL, K). (T. Evans et al. 2002)";
189
        expectedCssDisplay = "list-item";
190
        expectedListStyleType = "none";
252
    @Test
253
    public void testFeatureMaterialsExamined() {
191 254

  
192
        p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
193
        featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
255
        int featureId = 6;
256
        String expectedCssDisplay = "list-item";
257
        String expectedListStyleType = "none";
258
        int descriptionElementFontSize = 11;
259
        String expectedListStylePosition = "outside";
260
        String expectedListStyleImage = "none";
261
        int indent = 23;
194 262

  
195
        assertTrue(featureBlock.getText().startsWith(blockTextBegin));
196
        assertTrue(featureBlock.getText().endsWith(blockTextEnd));
197
        featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
198
        assertEquals(1, featureBlock.getOriginalSourcesSections().size());
199
        assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "T. Evans et al. 2002", getContext().getBaseUri().toString() + "?q=cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
263
        /* Materials Examined */
264
        String featureClass = "materials-examined";
265
        String featureLabel = "Materials Examined";
266
        String blockTextBegin = featureLabel + "\nINDIA (NORTH-EAST): Sikkim, undated, (fr.), Hooker s.n. E72 (K); Khasia, undated, (pist.), Griffith 503 (K). BHUTAN: Sarbhang Distr., 2.5 km below Getchu on Chirang Road, 12 March 1982, (ster.)";
267
        String blockTextEnd = "A. 5293 (K, BM, BK). LAOS (NORTH): Huaphanh Province, Viengthong Distr., Ban Sakok, Phou Loeuy Noy, 21 June 1999, (fr.), Oulathong OL 231 (FRCL, K). (" + evans_et_al_referenceCitation + ")";
268

  
269
        p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
270
        FeatureBlock featureBlockMaterials = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
200 271

  
272
        assertTrue(featureBlockMaterials.getText().startsWith(blockTextBegin));
273
        assertTrue(featureBlockMaterials.getText().endsWith(blockTextEnd));
274
        featureBlockMaterials.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
275
        assertEquals(1, featureBlockMaterials.getOriginalSourcesSections().size());
276
        assertTrue(LinkElement.testIfLinkElement(featureBlockMaterials.getOriginalSourcesSections().get(0).getLinksInElement().get(0), evans_et_al_referenceCitation, "cdm_dataportal/reference/706c5e5e-1dac-4fb2-b849-8e99ad7d63aa"));
201 277
    }
202 278

  
203 279
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)