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.net.URISyntaxException;
|
14
|
import java.util.UUID;
|
15
|
|
16
|
import org.apache.log4j.Logger;
|
17
|
|
18
|
/**
|
19
|
* TODO 1. allow overwriting the hard coded contexts configuration by {user.home}/.cdmLibrary/DataPortalTest.properties
|
20
|
* TODO 2. let constructor read from a dataPortalTestContext.properties located in the jar (/dataportal-selenium-tests/src/main/resources/eu/etaxonomy/dataportal/DataPortalTest.properties)
|
21
|
* TODO 3. DataPortalTest.properties should allow setting the defalut eu.etaxonomy.dataportal.selenium.CdmDataPortalTestBase.SYSTEM_PROPERTY_NAME_BROWSER
|
22
|
* TODO 4. DataPortalTest.properties should allow setting webdriver.firefox.bin etc in order to circumven the need to set it by -Dwebdriver.firefox.bin
|
23
|
*
|
24
|
* @author a.kohlbecker
|
25
|
*
|
26
|
*/
|
27
|
public enum DataPortalContext {
|
28
|
|
29
|
cichorieae(""),
|
30
|
palmae(""),
|
31
|
cyprus("");
|
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(String dummy) {
|
41
|
|
42
|
this.baseUri = TestConfiguration.getProperty(composePropertyKey("baseUri"), URI.class);
|
43
|
this.cdmServerUri = TestConfiguration.getProperty(composePropertyKey("cdmServerUri"), URI.class);
|
44
|
this.classificationUUID = TestConfiguration.getProperty(composePropertyKey("classificationUUID"), UUID.class);
|
45
|
|
46
|
}
|
47
|
|
48
|
private String composePropertyKey(String fieldName) {
|
49
|
String key = this.getClass().getSimpleName().substring(0, 1).toLowerCase() + this.getClass().getSimpleName().substring(1) + "." + this.name() + "." + fieldName;
|
50
|
return key;
|
51
|
}
|
52
|
|
53
|
public URI getBaseUri() {
|
54
|
return baseUri;
|
55
|
}
|
56
|
|
57
|
public URI getCdmServerUri() {
|
58
|
return cdmServerUri;
|
59
|
}
|
60
|
|
61
|
public UUID getClassificationUUID() {
|
62
|
return classificationUUID;
|
63
|
}
|
64
|
|
65
|
}
|