Revision 3ca53aa1
Added by Andreas Müller over 2 years ago
cdmlib-commons/src/test/java/eu/etaxonomy/cdm/test/suite/CdmTestSuite.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.test.suite; |
11 | 11 |
|
12 |
import org.apache.log4j.Logger; |
|
12 | 13 |
import org.junit.runner.RunWith; |
13 | 14 |
import org.junit.runners.Suite; |
14 |
import org.apache.log4j.Logger; |
|
15 | 15 |
|
16 | 16 |
import eu.etaxonomy.cdm.common.CdmUtilsTest; |
17 | 17 |
import eu.etaxonomy.cdm.common.XmlHelpTest; |
18 | 18 |
|
19 | 19 |
@RunWith(Suite.class) |
20 |
@Suite.SuiteClasses(
|
|
21 |
{
|
|
20 |
@Suite.SuiteClasses( |
|
21 |
{ |
|
22 | 22 |
CdmUtilsTest.class, |
23 | 23 |
XmlHelpTest.class |
24 | 24 |
} |
... | ... | |
27 | 27 |
@SuppressWarnings("unused") |
28 | 28 |
private static final Logger logger = Logger.getLogger(CdmTestSuite.class); |
29 | 29 |
|
30 |
// the class remains completely empty,
|
|
30 |
// the class remains completely empty, |
|
31 | 31 |
// being used only as a holder for the above annotations |
32 | 32 |
|
33 | 33 |
//console test //TODO test |
34 | 34 |
public static void consoleRun() { |
35 | 35 |
org.junit.runner.JUnitCore.runClasses( |
36 |
CdmUtilsTest.class,
|
|
36 |
CdmUtilsTest.class, |
|
37 | 37 |
XmlHelpTest.class |
38 | 38 |
); |
39 | 39 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/config/ApplicationConfiguration.java | ||
---|---|---|
23 | 23 |
/** |
24 | 24 |
* @author a.kohlbecker |
25 | 25 |
* @since Feb 16, 2018 |
26 |
* |
|
27 | 26 |
*/ |
28 | 27 |
@Component |
29 | 28 |
public class ApplicationConfiguration { |
... | ... | |
41 | 40 |
public static final String TEST_MODE = "testmode"; |
42 | 41 |
|
43 | 42 |
@Autowired |
44 |
Environment env; |
|
43 |
private Environment env;
|
|
45 | 44 |
|
46 | 45 |
@Autowired |
47 |
ConfigFileUtil configFileUtil; |
|
46 |
private ConfigFileUtil configFileUtil;
|
|
48 | 47 |
|
49 |
Map<String, Properties> configurations = new HashMap<>(); |
|
48 |
private Map<String, Properties> configurations = new HashMap<>();
|
|
50 | 49 |
|
51 | 50 |
public String getProperty(ApplicationConfigurationFile configFile, String key){ |
52 | 51 |
Properties props = loadPropertiesFile(configFile); |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/config/ApplicationConfigurationFile.java | ||
---|---|---|
11 | 11 |
/** |
12 | 12 |
* @author a.kohlbecker |
13 | 13 |
* @since Feb 16, 2018 |
14 |
* |
|
15 | 14 |
*/ |
16 | 15 |
public class ApplicationConfigurationFile { |
17 | 16 |
|
18 |
String defaultContet = |
|
17 |
private String defaultContet =
|
|
19 | 18 |
"# application configuration file #\n" + |
20 | 19 |
"######################################"; |
21 | 20 |
|
22 |
String fileName; |
|
21 |
private String fileName;
|
|
23 | 22 |
|
24 |
/** |
|
25 |
* @param defaultContet |
|
26 |
* @param fileName |
|
27 |
*/ |
|
28 | 23 |
public ApplicationConfigurationFile(String fileName, String defaultContet) { |
29 | 24 |
this.defaultContet = defaultContet; |
30 | 25 |
this.fileName = fileName; |
31 | 26 |
} |
32 | 27 |
|
33 |
/** |
|
34 |
* @return the defaultContet |
|
35 |
*/ |
|
36 | 28 |
public String getDefaultContet() { |
37 | 29 |
return defaultContet; |
38 | 30 |
} |
39 | 31 |
|
40 |
/** |
|
41 |
* @return the fileName |
|
42 |
*/ |
|
43 | 32 |
public String getFileName() { |
44 | 33 |
return fileName; |
45 | 34 |
} |
46 |
|
|
47 |
} |
|
35 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/config/CdmConfigurationKeys.java | ||
---|---|---|
11 | 11 |
/** |
12 | 12 |
* @author a.kohlbecker |
13 | 13 |
* @since Feb 15, 2018 |
14 |
* |
|
15 | 14 |
*/ |
16 | 15 |
public class CdmConfigurationKeys { |
17 | 16 |
|
... | ... | |
19 | 18 |
* key for the spring environment to the datasource bean id aka instance name |
20 | 19 |
*/ |
21 | 20 |
public static final String CDM_DATA_SOURCE_ID = "cdm.dataSource.id"; |
22 |
|
|
23 |
} |
|
21 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/config/EhCacheConfiguration.java | ||
---|---|---|
22 | 22 |
import net.sf.ehcache.store.MemoryStoreEvictionPolicy; |
23 | 23 |
|
24 | 24 |
/** |
25 |
* |
|
26 | 25 |
* @author a.kohlbecker |
27 | 26 |
* @since Feb 1, 2017 |
28 |
* |
|
29 | 27 |
*/ |
30 | 28 |
@Configuration |
31 | 29 |
// @EnableCaching // for future use |
... | ... | |
62 | 60 |
return cacheManager; |
63 | 61 |
} |
64 | 62 |
|
65 |
|
|
66 | 63 |
/** |
67 | 64 |
* Returns the default cache configuration for the cache |
68 | 65 |
* named {@link CdmCacherBase#DEFAULT_CACHE_NAME "cdmDefaultCache"} |
69 |
* |
|
70 |
* @return |
|
71 | 66 |
*/ |
72 | 67 |
protected CacheConfiguration getDefaultCacheConfiguration() { |
73 | 68 |
|
... | ... | |
82 | 77 |
.eternal(false) |
83 | 78 |
// default ttl and tti set to 2 hours |
84 | 79 |
.timeToLiveSeconds(60*60*2) |
85 |
.timeToIdleSeconds(60*60*2) |
|
86 |
.statistics(true); |
|
80 |
.timeToIdleSeconds(60*60*2); |
|
87 | 81 |
|
88 | 82 |
return cc; |
89 | 83 |
} |
90 | 84 |
|
91 |
|
|
92 | 85 |
@Override |
93 | 86 |
public void destroy() { |
94 | 87 |
if (cacheManager != null) { |
... | ... | |
96 | 89 |
this.cacheManager.shutdown(); |
97 | 90 |
} |
98 | 91 |
} |
99 |
|
|
100 |
} |
|
92 |
} |
Also available in: Unified diff
cleanup