mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Remove unused Spring loader and test
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.statistics.configuration;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import org.dspace.kernel.config.SpringLoader;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
|
||||
/**
|
||||
* Supply paths for configuring statistical code.
|
||||
*
|
||||
* @author mwood
|
||||
*/
|
||||
public class StatisticsSpringLoader
|
||||
implements SpringLoader
|
||||
{
|
||||
/*
|
||||
* (non-Javadoc) @see
|
||||
* org.dspace.kernel.config.SpringLoader#getResourcePaths(org.dspace.services.ConfigurationService)
|
||||
*/
|
||||
@Override
|
||||
public String[] getResourcePaths(ConfigurationService configurationService)
|
||||
{
|
||||
StringBuffer filePath = new StringBuffer();
|
||||
filePath.append(configurationService.getProperty("dspace.dir"));
|
||||
filePath.append(File.separator);
|
||||
filePath.append("config");
|
||||
filePath.append(File.separator);
|
||||
filePath.append("spring");
|
||||
filePath.append(File.separator);
|
||||
filePath.append("statistics");
|
||||
filePath.append(File.separator);
|
||||
|
||||
try
|
||||
{
|
||||
return new String[]
|
||||
{
|
||||
new File(filePath.toString()).toURI().toURL().toString()
|
||||
+ File.separator + XML_SUFFIX
|
||||
};
|
||||
} catch (MalformedURLException e)
|
||||
{
|
||||
return new String[0];
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.dspace.statistics.configuration;
|
||||
|
||||
import org.dspace.servicemanager.DSpaceKernelInit;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.junit.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author mwood
|
||||
*/
|
||||
public class StatisticsSpringLoaderTest
|
||||
{
|
||||
public StatisticsSpringLoaderTest()
|
||||
{
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass()
|
||||
throws Exception
|
||||
{
|
||||
DSpaceKernelInit.getKernel(null).start();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass()
|
||||
throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getResourcePaths method, of class StatisticsSpringLoader.
|
||||
*/
|
||||
@Test
|
||||
public void testGetResourcePaths()
|
||||
{
|
||||
System.out.println("getResourcePaths");
|
||||
|
||||
ConfigurationService configurationService = new DSpace().getConfigurationService();
|
||||
|
||||
StatisticsSpringLoader instance = new StatisticsSpringLoader();
|
||||
String[] result = instance.getResourcePaths(configurationService);
|
||||
assertNotNull("getResourcePaths returned null", result);
|
||||
assertEquals("Wrong number of paths returned", 1, result.length);
|
||||
for (int i = 0; i < result.length; i++)
|
||||
{
|
||||
System.out.printf("result[%d] = %s\n", i, result[i]);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user