Revision f2647484
Added by Andreas Kohlbecker about 12 years ago
5.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/palmae/Calamus_acanthospathus_TaxonProfileTest.java | ||
---|---|---|
18 | 18 |
import org.apache.commons.lang.StringUtils; |
19 | 19 |
import org.junit.After; |
20 | 20 |
import org.junit.Before; |
21 |
import org.junit.Ignore; |
|
21 | 22 |
import org.junit.Test; |
22 | 23 |
import org.openqa.selenium.By; |
23 | 24 |
import org.openqa.selenium.WebElement; |
... | ... | |
40 | 41 |
@DataPortalContexts( { DataPortalContext.palmae }) |
41 | 42 |
public class Calamus_acanthospathus_TaxonProfileTest extends CdmDataPortalTestBase{ |
42 | 43 |
|
43 |
static UUID taxonUuid = UUID.fromString("bb340c78-880e-4dd0-91ff-81788a482b31");
|
|
44 |
static UUID taxonUuid = UUID.fromString("bb340c78-880e-4dd0-91ff-81788a482b31");
|
|
44 | 45 |
|
45 |
TaxonProfilePage p = null;
|
|
46 |
TaxonProfilePage p = null;
|
|
46 | 47 |
|
47 |
@Before
|
|
48 |
public void setUp() throws MalformedURLException {
|
|
48 |
@Before
|
|
49 |
public void setUp() throws MalformedURLException {
|
|
49 | 50 |
|
50 |
p = new TaxonProfilePage(driver, getContext(), taxonUuid);
|
|
51 |
p = new TaxonProfilePage(driver, getContext(), taxonUuid);
|
|
51 | 52 |
|
52 |
}
|
|
53 |
}
|
|
53 | 54 |
|
54 | 55 |
|
55 |
@Test
|
|
56 |
public void testTitleAndTabs() {
|
|
56 |
@Test
|
|
57 |
public void testTitleAndTabs() {
|
|
57 | 58 |
|
58 |
assertEquals(getContext().prepareTitle("Calamus acanthospathus Griff., Calcutta J. Nat. Hist. 5: 39. 1845"), p.getTitle());
|
|
59 |
assertNull("Authorship information should be hidden", p.getAuthorInformationText());
|
|
59 |
assertEquals(getContext().prepareTitle("Calamus acanthospathus Griff., Calcutta J. Nat. Hist. 5: 39. 1845"), p.getTitle());
|
|
60 |
assertNull("Authorship information should be hidden", p.getAuthorInformationText());
|
|
60 | 61 |
|
61 |
List<LinkElement> primaryTabs = p.getPrimaryTabs();
|
|
62 |
int tabId = 0;
|
|
63 |
assertEquals("General", primaryTabs.get(tabId++).getText());
|
|
64 |
assertEquals("Synonymy", primaryTabs.get(tabId++).getText());
|
|
65 |
assertEquals("Images", primaryTabs.get(tabId++).getText());
|
|
66 |
assertEquals("Specimens", primaryTabs.get(tabId++).getText());
|
|
67 |
assertEquals("Expecting " + tabId + " tabs", tabId, primaryTabs.size());
|
|
62 |
List<LinkElement> primaryTabs = p.getPrimaryTabs();
|
|
63 |
int tabId = 0;
|
|
64 |
assertEquals("General", primaryTabs.get(tabId++).getText());
|
|
65 |
assertEquals("Synonymy", primaryTabs.get(tabId++).getText());
|
|
66 |
assertEquals("Images", primaryTabs.get(tabId++).getText());
|
|
67 |
assertEquals("Specimens", primaryTabs.get(tabId++).getText());
|
|
68 |
assertEquals("Expecting " + tabId + " tabs", tabId, primaryTabs.size());
|
|
68 | 69 |
|
69 |
}
|
|
70 |
}
|
|
70 | 71 |
|
71 |
@Test
|
|
72 |
public void testProfileImage() {
|
|
73 |
ImgElement profileImage = p.getProfileImage();
|
|
74 |
assertNotNull("Expecting profile images to be switched on", profileImage);
|
|
75 |
assertTrue("Expoecting image palm_tc_29336_1.jpg", profileImage.getSrcUrl().toString().endsWith("/palm_tc_29336_1.jpg"));
|
|
76 |
}
|
|
72 |
@Test
|
|
73 |
public void testProfileImage() {
|
|
74 |
ImgElement profileImage = p.getProfileImage();
|
|
75 |
assertNotNull("Expecting profile images to be switched on", profileImage);
|
|
76 |
assertTrue("Expoecting image palm_tc_29336_1.jpg", profileImage.getSrcUrl().toString().endsWith("/palm_tc_29336_1.jpg"));
|
|
77 |
}
|
|
77 | 78 |
|
78 | 79 |
|
79 |
@Test |
|
80 |
public void testFeatures() { |
|
81 |
assertEquals("Content", p.getTableOfContentHeader()); |
|
82 |
List<LinkElement> links = p.getTableOfContentLinks(); |
|
83 |
assertNotNull("Expecting a list of TOC links in the profile page.", links); |
|
80 |
@Test |
|
81 |
@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 */ |
|
82 |
public void testFeatures() { |
|
83 |
assertEquals("Content", p.getTableOfContentHeader()); |
|
84 |
List<LinkElement> links = p.getTableOfContentLinks(); |
|
85 |
assertNotNull("Expecting a list of TOC links in the profile page.", links); |
|
84 | 86 |
|
85 |
FeatureBlock featureBlock;
|
|
86 |
int featureId = 0;
|
|
87 |
FeatureBlock featureBlock;
|
|
88 |
int featureId = 0;
|
|
87 | 89 |
|
88 |
int descriptionElementFontSize = 11;
|
|
89 |
String expectedCssDisplay = "inline";
|
|
90 |
String expectedListStyleType = "none";
|
|
91 |
String expectedListStylePosition = "outside";
|
|
92 |
String expectedListStyleImage = "none";
|
|
93 |
int indent = 23;
|
|
94 |
|
|
95 |
/* distribution */
|
|
96 |
String featureClass = "distribution";
|
|
97 |
String featureLabel = "Distribution";
|
|
98 |
String blockTextFull = featureLabel + "\n\n\nMap accurate to TDWG level 3 distributions\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)";
|
|
99 |
|
|
100 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
101 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "p", "span");
|
|
102 |
|
|
103 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
104 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
105 |
assertEquals(2, featureBlock.getOriginalSourcesSections().size());
|
|
106 |
assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "World Checklist of Monocotyledons", this.getContext().getBaseUri().toString()));
|
|
107 |
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"));
|
|
108 |
|
|
109 |
assertNotNull("Expecting an OpenLayers map", featureBlock.getElement().findElement(By.id("openlayers_map")));
|
|
110 |
assertEquals("Map accurate to TDWG level 3 distributions", featureBlock.getElement().findElement(By.className("distribution_map_caption")).getText());
|
|
111 |
|
|
112 |
|
|
113 |
/* Biology And Ecology */
|
|
114 |
featureClass = "biology_and_ecology";
|
|
115 |
featureLabel = "Biology And Ecology";
|
|
116 |
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)";
|
|
117 |
expectedCssDisplay = "list-item";
|
|
118 |
expectedListStyleType = "none";
|
|
119 |
|
|
120 |
p.testTableOfContentEntry(featureId++,featureLabel, featureClass);
|
|
121 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
122 |
|
|
123 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
124 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
125 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
126 |
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"));
|
|
127 |
|
|
128 |
|
|
129 |
/* Conservation */
|
|
130 |
featureClass = "conservation";
|
|
131 |
featureLabel = "Conservation";
|
|
132 |
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)";
|
|
133 |
expectedCssDisplay = "list-item";
|
|
134 |
expectedListStyleType = "none";
|
|
135 |
|
|
136 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
137 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
138 |
|
|
139 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
140 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
141 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
142 |
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 |
|
|
144 |
/* Common Name */
|
|
145 |
featureClass = "common_name";
|
|
146 |
featureLabel = "Common Name";
|
|
147 |
blockTextFull = featureLabel + "\nwai hom (Lao Loum), blong eur (Khamu), wai hawm (Thailand) (T. Evans et al. 2002)";
|
|
148 |
expectedCssDisplay = "list-item";
|
|
149 |
expectedListStyleType = "none";
|
|
150 |
|
|
151 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
152 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
153 |
|
|
154 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
155 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
156 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
157 |
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"));
|
|
158 |
|
|
159 |
/* Uses */
|
|
160 |
featureClass = "uses";
|
|
161 |
featureLabel = "Uses";
|
|
162 |
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)";
|
|
163 |
expectedCssDisplay = "list-item";
|
|
164 |
expectedListStyleType = "none";
|
|
165 |
|
|
166 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
167 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
168 |
|
|
169 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
170 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
171 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
172 |
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"));
|
|
173 |
|
|
174 |
/* Discussion */
|
|
175 |
featureClass = "discussion";
|
|
176 |
featureLabel = "Discussion";
|
|
177 |
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";
|
|
178 |
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)";
|
|
179 |
expectedCssDisplay = "list-item";
|
|
180 |
expectedListStyleType = "none";
|
|
181 |
|
|
182 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
183 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
184 |
|
|
185 |
assertTrue(featureBlock.getText().startsWith(blockTextBegin));
|
|
186 |
assertTrue(featureBlock.getText().endsWith(blockTextEnd));
|
|
187 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
188 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
189 |
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"));
|
|
190 |
|
|
191 |
/* Discussion */
|
|
192 |
featureClass = "materials_examined";
|
|
193 |
featureLabel = "Materials Examined";
|
|
194 |
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.)";
|
|
195 |
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)";
|
|
196 |
expectedCssDisplay = "list-item";
|
|
197 |
expectedListStyleType = "none";
|
|
198 |
|
|
199 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
200 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
201 |
|
|
202 |
assertTrue(featureBlock.getText().startsWith(blockTextBegin));
|
|
203 |
assertTrue(featureBlock.getText().endsWith(blockTextEnd));
|
|
204 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
205 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
206 |
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"));
|
|
207 |
|
|
208 |
}
|
|
90 |
int descriptionElementFontSize = 11;
|
|
91 |
String expectedCssDisplay = "inline";
|
|
92 |
String expectedListStyleType = "none";
|
|
93 |
String expectedListStylePosition = "outside";
|
|
94 |
String expectedListStyleImage = "none";
|
|
95 |
int indent = 23;
|
|
96 |
|
|
97 |
/* distribution */
|
|
98 |
String featureClass = "distribution";
|
|
99 |
String featureLabel = "Distribution";
|
|
100 |
String blockTextFull = featureLabel + "\n\n\nMap accurate to TDWG level 3 distributions\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)";
|
|
101 |
|
|
102 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
103 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "p", "span");
|
|
104 |
|
|
105 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
106 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
107 |
assertEquals(2, featureBlock.getOriginalSourcesSections().size());
|
|
108 |
assertTrue(LinkElement.testIfLinkElement(featureBlock.getOriginalSourcesSections().get(0).getLinksInElement().get(0), "World Checklist of Monocotyledons", this.getContext().getBaseUri().toString()));
|
|
109 |
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"));
|
|
110 |
|
|
111 |
assertNotNull("Expecting an OpenLayers map", featureBlock.getElement().findElement(By.id("openlayers_map")));
|
|
112 |
assertEquals("Map accurate to TDWG level 3 distributions", featureBlock.getElement().findElement(By.className("distribution_map_caption")).getText());
|
|
113 |
|
|
114 |
|
|
115 |
/* Biology And Ecology */
|
|
116 |
featureClass = "biology_and_ecology";
|
|
117 |
featureLabel = "Biology And Ecology";
|
|
118 |
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)";
|
|
119 |
expectedCssDisplay = "list-item";
|
|
120 |
expectedListStyleType = "none";
|
|
121 |
|
|
122 |
p.testTableOfContentEntry(featureId++,featureLabel, featureClass);
|
|
123 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
124 |
|
|
125 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
126 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
127 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
128 |
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"));
|
|
129 |
|
|
130 |
|
|
131 |
/* Conservation */
|
|
132 |
featureClass = "conservation";
|
|
133 |
featureLabel = "Conservation";
|
|
134 |
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)";
|
|
135 |
expectedCssDisplay = "list-item";
|
|
136 |
expectedListStyleType = "none";
|
|
137 |
|
|
138 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
139 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
140 |
|
|
141 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
142 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
143 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
144 |
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"));
|
|
145 |
|
|
146 |
/* Common Name */
|
|
147 |
featureClass = "common_name";
|
|
148 |
featureLabel = "Common Name";
|
|
149 |
blockTextFull = featureLabel + "\nwai hom (Lao Loum), blong eur (Khamu), wai hawm (Thailand) (T. Evans et al. 2002)";
|
|
150 |
expectedCssDisplay = "list-item";
|
|
151 |
expectedListStyleType = "none";
|
|
152 |
|
|
153 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
154 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
155 |
|
|
156 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
157 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
158 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
159 |
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"));
|
|
160 |
|
|
161 |
/* Uses */
|
|
162 |
featureClass = "uses";
|
|
163 |
featureLabel = "Uses";
|
|
164 |
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)";
|
|
165 |
expectedCssDisplay = "list-item";
|
|
166 |
expectedListStyleType = "none";
|
|
167 |
|
|
168 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
169 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
170 |
|
|
171 |
assertEquals(blockTextFull, featureBlock.getText());
|
|
172 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
173 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
174 |
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"));
|
|
175 |
|
|
176 |
/* Discussion */
|
|
177 |
featureClass = "discussion";
|
|
178 |
featureLabel = "Discussion";
|
|
179 |
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";
|
|
180 |
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)";
|
|
181 |
expectedCssDisplay = "list-item";
|
|
182 |
expectedListStyleType = "none";
|
|
183 |
|
|
184 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
185 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
186 |
|
|
187 |
assertTrue(featureBlock.getText().startsWith(blockTextBegin));
|
|
188 |
assertTrue(featureBlock.getText().endsWith(blockTextEnd));
|
|
189 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
190 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
191 |
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"));
|
|
192 |
|
|
193 |
/* Discussion */
|
|
194 |
featureClass = "materials_examined";
|
|
195 |
featureLabel = "Materials Examined";
|
|
196 |
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.)";
|
|
197 |
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)";
|
|
198 |
expectedCssDisplay = "list-item";
|
|
199 |
expectedListStyleType = "none";
|
|
200 |
|
|
201 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass);
|
|
202 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "ul", "li");
|
|
203 |
|
|
204 |
assertTrue(featureBlock.getText().startsWith(blockTextBegin));
|
|
205 |
assertTrue(featureBlock.getText().endsWith(blockTextEnd));
|
|
206 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage);
|
|
207 |
assertEquals(1, featureBlock.getOriginalSourcesSections().size());
|
|
208 |
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"));
|
|
209 |
|
|
210 |
}
|
|
209 | 211 |
|
210 | 212 |
} |
Also available in: Unified diff
ignoring one test temporarily