mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-19 07:53:08 +00:00
[DS-3832] Recast test support classes.
This commit is contained in:
@@ -15,18 +15,29 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* Mock service that uses an embedded SOLR server for the statistics core
|
||||
* Mock service that uses an embedded SOLR server for the statistics core.
|
||||
*/
|
||||
public class MockSolrLoggerServiceImpl extends SolrLoggerServiceImpl implements InitializingBean {
|
||||
public class MockSolrLoggerServiceImpl
|
||||
extends SolrLoggerServiceImpl
|
||||
implements InitializingBean {
|
||||
|
||||
@Autowired(required = true)
|
||||
private ConfigurationService configurationService;
|
||||
|
||||
public MockSolrLoggerServiceImpl() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
//We don't use SOLR in the tests of this module
|
||||
solr = null;
|
||||
locationService = new DatabaseReader.Builder(new File(".")).build();
|
||||
|
||||
new FakeDatabaseReader(); // Activate fake
|
||||
new FakeDatabaseReader.Builder(); // Activate fake
|
||||
String locationDbPath = configurationService.getProperty("usage-statistics.dbfile");
|
||||
File locationDb = new File(locationDbPath);
|
||||
locationDb.createNewFile();
|
||||
locationService = new DatabaseReader.Builder(locationDb).build();
|
||||
useProxies = configurationService.getBooleanProperty("useProxies");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user