1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.remoting;
|
10
|
|
11
|
import org.apache.log4j.Level;
|
12
|
import org.apache.log4j.Logger;
|
13
|
import org.hibernate.collection.internal.AbstractPersistentCollection;
|
14
|
import org.hibernate.proxy.AbstractLazyInitializer;
|
15
|
import org.junit.Before;
|
16
|
import org.junit.BeforeClass;
|
17
|
import org.springframework.core.io.ClassPathResource;
|
18
|
import org.springframework.core.io.Resource;
|
19
|
import org.unitils.UnitilsJUnit4;
|
20
|
|
21
|
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
|
22
|
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
|
23
|
import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
|
24
|
import eu.etaxonomy.cdm.database.DataSourceNotFoundException;
|
25
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
26
|
|
27
|
/**
|
28
|
* Base class for remoting tests, responsible mainly for setting up the
|
29
|
* remote configuration.
|
30
|
*
|
31
|
* @author c.mathew
|
32
|
* @created 13.032014
|
33
|
*/
|
34
|
|
35
|
public class RemoteApplicationConfigurationTest extends UnitilsJUnit4 {
|
36
|
|
37
|
protected static ICdmApplicationConfiguration applicationController;
|
38
|
/**
|
39
|
* @throws DataSourceNotFoundException
|
40
|
*/
|
41
|
@BeforeClass
|
42
|
public static void initializeContext() throws DataSourceNotFoundException {
|
43
|
|
44
|
Resource DEFAULT_APPLICATION_CONTEXT = new ClassPathResource(
|
45
|
"/eu/etaxonomy/cdm/remotingApplicationContext.xml");
|
46
|
//FIXME:Remoting Currently the 'local-cyprus' param does not really do anything.
|
47
|
// This will just connect to a local runjettyrun cdmserver
|
48
|
// instance
|
49
|
ICdmDataSource datasource = CdmPersistentDataSource.NewInstance("local-cyprus");
|
50
|
applicationController =
|
51
|
CdmApplicationController.NewInstance(DEFAULT_APPLICATION_CONTEXT,
|
52
|
datasource,
|
53
|
null,
|
54
|
false,
|
55
|
null);
|
56
|
AbstractLazyInitializer.setConfiguration(applicationController);
|
57
|
AbstractPersistentCollection.setConfiguration(applicationController);
|
58
|
|
59
|
}
|
60
|
|
61
|
}
|