DS-3484: Refactoring builders and extended Browse by title test

This commit is contained in:
Tom Desair
2017-10-16 23:24:22 +02:00
committed by Tom Desair
parent 9529e5634f
commit 6a7c60c121
29 changed files with 614 additions and 289 deletions

View File

@@ -8,31 +8,23 @@
package org.dspace.statistics;
import org.dspace.services.ConfigurationService;
import org.dspace.solr.MockSolrServer;
import org.springframework.beans.factory.DisposableBean;
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
*/
public class MockSolrLoggerServiceImpl extends SolrLoggerServiceImpl implements InitializingBean, DisposableBean {
private MockSolrServer mockSolrServer;
public class MockSolrLoggerServiceImpl extends SolrLoggerServiceImpl implements InitializingBean {
@Autowired(required = true)
private ConfigurationService configurationService;
@Override
public void afterPropertiesSet() throws Exception {
mockSolrServer = new MockSolrServer("statistics");
solr = mockSolrServer.getSolrServer();
//We don' use SOLR in the tests of this module
solr = null;
locationService = new MockLookupService();
useProxies = configurationService.getBooleanProperty("useProxies");
}
public void destroy() throws Exception {
mockSolrServer.destroy();
}
}