1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.dataportal;
|
11
|
|
12
|
import java.net.URI;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import org.apache.log4j.Logger;
|
16
|
|
17
|
/**
|
18
|
* TODO 1. allow overwriting the hard coded contexts configuration by {user.home}/.cdmLibrary/DataPortalTest.properties
|
19
|
* TODO 2. let constructor read from a dataPortalTestContext.properties located in the jar (/dataportal-selenium-tests/src/main/resources/eu/etaxonomy/dataportal/DataPortalTest.properties)
|
20
|
* TODO 3. DataPortalTest.properties should allow setting the defalut eu.etaxonomy.dataportal.selenium.CdmDataPortalTestBase.SYSTEM_PROPERTY_NAME_BROWSER
|
21
|
* TODO 4. DataPortalTest.properties should allow setting webdriver.firefox.bin etc in order to circumven the need to set it by -Dwebdriver.firefox.bin
|
22
|
*
|
23
|
* @author a.kohlbecker
|
24
|
*
|
25
|
*/
|
26
|
public enum DataPortalContext {
|
27
|
|
28
|
cichorieae,
|
29
|
palmae,
|
30
|
cyprus,
|
31
|
floramalesiana;
|
32
|
|
33
|
URI baseUri;
|
34
|
URI cdmServerUri;
|
35
|
UUID classificationUUID;
|
36
|
String themeName;
|
37
|
|
38
|
public final Logger logger = Logger.getLogger(DataPortalContext.class);
|
39
|
|
40
|
private DataPortalContext() {
|
41
|
this.baseUri = TestConfiguration.getProperty(composePropertyKey("baseUri"), URI.class);
|
42
|
this.cdmServerUri = TestConfiguration.getProperty(composePropertyKey("cdmServerUri"), URI.class);
|
43
|
this.classificationUUID = TestConfiguration.getProperty(composePropertyKey("classificationUUID"), UUID.class);
|
44
|
}
|
45
|
|
46
|
private String composePropertyKey(String fieldName) {
|
47
|
String key = this.getClass().getSimpleName().substring(0, 1).toLowerCase() + this.getClass().getSimpleName().substring(1) + "." + this.name() + "." + fieldName;
|
48
|
return key;
|
49
|
}
|
50
|
|
51
|
public URI getBaseUri() {
|
52
|
return baseUri;
|
53
|
}
|
54
|
|
55
|
public URI getCdmServerUri() {
|
56
|
return cdmServerUri;
|
57
|
}
|
58
|
|
59
|
public UUID getClassificationUUID() {
|
60
|
return classificationUUID;
|
61
|
}
|
62
|
|
63
|
}
|