Revision 5a9cce4d
Added by Andreas Müller almost 2 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/IoConfiguratorBase.java | ||
---|---|---|
3 | 3 |
* European Distributed Institute of Taxonomy |
4 | 4 |
* http://www.e-taxonomy.eu |
5 | 5 |
*/ |
6 |
|
|
7 | 6 |
package eu.etaxonomy.cdm.io.common; |
8 | 7 |
|
9 | 8 |
import org.apache.log4j.Logger; |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/CdmDataSourceBase.java | ||
---|---|---|
38 | 38 |
* @author a.mueller |
39 | 39 |
* @since 18.12.2008 |
40 | 40 |
*/ |
41 |
abstract class CdmDataSourceBase extends CdmSource implements ICdmDataSource { |
|
41 |
public abstract class CdmDataSourceBase extends CdmSource implements ICdmDataSource {
|
|
42 | 42 |
|
43 | 43 |
private static final Logger logger = Logger.getLogger(CdmDataSourceBase.class); |
44 | 44 |
|
... | ... | |
382 | 382 |
} |
383 | 383 |
|
384 | 384 |
//********************* Base methods for CdmDataSource and CdmPersistentDatasource |
385 |
/** |
|
386 |
* @param hbm2dll |
|
387 |
* @param showSql |
|
388 |
* @param formatSql |
|
389 |
* @param registerAuditing |
|
390 |
* @param registerSearchListener |
|
391 |
* @param cacheProviderClass |
|
392 |
* @return |
|
393 |
*/ |
|
385 |
|
|
394 | 386 |
protected AbstractBeanDefinition makeHibernatePropertiesBean(DatabaseTypeEnum dbType, |
395 | 387 |
DbSchemaValidation hbm2dll, boolean showSql, |
396 | 388 |
boolean formatSql, boolean registerAuditing, boolean registerSearchListener, |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/hibernate/HibernateConfiguration.java | ||
---|---|---|
17 | 17 |
/** |
18 | 18 |
* @author a.mueller |
19 | 19 |
* @since 03.08.2017 |
20 |
* |
|
21 | 20 |
*/ |
22 | 21 |
public class HibernateConfiguration implements Serializable{ |
23 | 22 |
|
24 | 23 |
private static final long serialVersionUID = -894395918847594447L; |
25 | 24 |
|
25 |
//properties |
|
26 | 26 |
public final static String SHOW_SQL = "hibernate.show_sql"; |
27 | 27 |
|
28 | 28 |
public final static String FORMAT_SQL = "hibernate.format_sql"; |
... | ... | |
38 | 38 |
public static final boolean FORMAT_SQL_DEFAULT = false; |
39 | 39 |
public static final boolean REGISTER_SEARCH_DEFAULT = false; |
40 | 40 |
public static final boolean REGISTER_ENVERS_DEFAULT = true; |
41 |
|
|
42 | 41 |
public static final Class<? extends RegionFactory> CACHE_PROVIDER_DEFAULT = NoCachingRegionFactory.class; |
43 | 42 |
|
44 |
/** |
|
45 |
* @return |
|
46 |
*/ |
|
47 | 43 |
public static HibernateConfiguration NewDefaultInstance() { |
48 | 44 |
HibernateConfiguration result = NewInstance(SHOW_SQL_DEFAULT, FORMAT_SQL_DEFAULT, |
49 | 45 |
REGISTER_SEARCH_DEFAULT, REGISTER_ENVERS_DEFAULT, CACHE_PROVIDER_DEFAULT); |
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/database/CdmPersistentDataSourceTest.java | ||
---|---|---|
238 | 238 |
assertEquals(String.valueOf(formatSql), properties.getProperty("hibernate.format_sql")); |
239 | 239 |
} |
240 | 240 |
|
241 |
/** |
|
242 |
* Test method for {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource#exists(java.lang.String)}. |
|
243 |
*/ |
|
244 | 241 |
@Test |
245 | 242 |
public void testExists() { |
246 | 243 |
assertTrue(CdmPersistentDataSource.exists("default")); |
... | ... | |
248 | 245 |
assertFalse(CdmPersistentDataSource.exists("xlsj�dfl")); |
249 | 246 |
} |
250 | 247 |
|
251 |
/** |
|
252 |
* Test method for {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource#save(java.lang.String, eu.etaxonomy.cdm.database.DatabaseTypeEnum, java.lang.String, java.lang.String, java.lang.String, java.lang.String)}. |
|
253 |
*/ |
|
254 | 248 |
@Test |
255 | 249 |
public void testSaveStringDatabaseTypeEnumStringStringIntStringString() { |
256 | 250 |
String dataSourceString = "tmp"; |
... | ... | |
288 | 282 |
assertFalse(CdmPersistentDataSource.exists(dataSourceString)); |
289 | 283 |
} |
290 | 284 |
|
291 |
/** |
|
292 |
* Test method for {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource#save(java.lang.String, eu.etaxonomy.cdm.database.DatabaseTypeEnum, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String)}. |
|
293 |
*/ |
|
294 | 285 |
//@Test |
295 | 286 |
public void testSaveStringDatabaseTypeEnumStringStringStringString() { |
296 | 287 |
//see testSaveStringDatabaseTypeEnumStringStringIntStringString |
... | ... | |
304 | 295 |
testSaveStringDatabaseTypeEnumStringStringStringString(); |
305 | 296 |
} |
306 | 297 |
|
307 |
/** |
|
308 |
* Test method for {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource#getAllDataSources()}. |
|
309 |
*/ |
|
310 | 298 |
@Test |
311 | 299 |
public void testGetAllDataSources() { |
312 | 300 |
//assertEquals(6, CdmPersistentDataSource.getAllDataSources().size()); //does not run for all orders of tests of this class |
313 | 301 |
assertEquals("default", CdmPersistentDataSource.getAllDataSources().get(0).getName()); |
314 | 302 |
} |
315 | 303 |
|
316 |
/** |
|
317 |
* Test method for {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource#toString()}. |
|
318 |
*/ |
|
319 | 304 |
@Test |
320 | 305 |
public void testToString() { |
321 | 306 |
String dataSourceName = "default"; |
... | ... | |
326 | 311 |
} |
327 | 312 |
} |
328 | 313 |
|
329 |
/** |
|
330 |
* Test method for {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource#getDataSourceInputStream()}. |
|
331 |
*/ |
|
332 | 314 |
@Test |
333 | 315 |
public void testGetDataSourceInputStream() { |
334 | 316 |
FileInputStream is = CdmPersistentSourceUtils.getCdmSourceInputStream(); |
... | ... | |
343 | 325 |
|
344 | 326 |
} |
345 | 327 |
|
346 |
/** |
|
347 |
* Test method for {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource#getDataSourceOutputStream()}. |
|
348 |
*/ |
|
328 |
|
|
349 | 329 |
@Ignore |
350 | 330 |
@Test |
351 | 331 |
public void testGetDataSourceOutputStream() { |
cdmlib-remote-webapp/src/main/webapp/WEB-INF/datasources/routing-datasource.xml | ||
---|---|---|
12 | 12 |
<!-- The property beanDefinitionFile defaults to "datasources.xml" in {USER_HOME}./cdmLibrary |
13 | 13 |
|
14 | 14 |
WARNING !!! |
15 |
The beanDefinitionFile now mus be configured in |
|
15 |
The beanDefinitionFile now must be configured in
|
|
16 | 16 |
eu.etaxonomy.cdm.database.DataSourceBeanLoader |
17 | 17 |
|
18 | 18 |
--> |
Also available in: Unified diff
cleanup