|
|
@ -3,8 +3,8 @@ package org.libresonic.player.service; |
|
|
|
import com.codahale.metrics.ConsoleReporter; |
|
|
|
import com.codahale.metrics.ConsoleReporter; |
|
|
|
import com.codahale.metrics.MetricRegistry; |
|
|
|
import com.codahale.metrics.MetricRegistry; |
|
|
|
import com.codahale.metrics.Timer; |
|
|
|
import com.codahale.metrics.Timer; |
|
|
|
import junit.framework.Assert; |
|
|
|
|
|
|
|
import org.apache.commons.io.IOUtils; |
|
|
|
import org.apache.commons.io.IOUtils; |
|
|
|
|
|
|
|
import org.junit.Assert; |
|
|
|
import org.junit.ClassRule; |
|
|
|
import org.junit.ClassRule; |
|
|
|
import org.junit.Rule; |
|
|
|
import org.junit.Rule; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.Test; |
|
|
@ -38,16 +38,15 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* A unit test class to test the MediaScannerService. |
|
|
|
* A unit test class to test the MediaScannerService. |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* This class uses the Spring application context configuration present in the |
|
|
|
* This class uses the Spring application context configuration present in the |
|
|
|
* /org/libresonic/player/service/mediaScannerServiceTestCase/ directory. |
|
|
|
* /org/libresonic/player/service/mediaScannerServiceTestCase/ directory. |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* The media library is found in the /MEDIAS directory. |
|
|
|
* The media library is found in the /MEDIAS directory. |
|
|
|
* It is composed of 2 musicFolders (Music and Music2) and several little weight audio files. |
|
|
|
* It is composed of 2 musicFolders (Music and Music2) and several little weight audio files. |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* At runtime, the subsonic_home dir is set to target/test-classes/org/libresonic/player/service/mediaScannerServiceTestCase. |
|
|
|
* At runtime, the subsonic_home dir is set to target/test-classes/org/libresonic/player/service/mediaScannerServiceTestCase. |
|
|
|
* An empty database is created on the fly. |
|
|
|
* An empty database is created on the fly. |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ContextConfiguration(locations = { |
|
|
|
@ContextConfiguration(locations = { |
|
|
|
"/applicationContext-service.xml", |
|
|
|
"/applicationContext-service.xml", |
|
|
@ -60,6 +59,7 @@ public class MediaScannerServiceTestCase { |
|
|
|
@ClassRule |
|
|
|
@ClassRule |
|
|
|
public static final SpringClassRule classRule = new SpringClassRule() { |
|
|
|
public static final SpringClassRule classRule = new SpringClassRule() { |
|
|
|
LibresonicHomeRule libresonicRule = new LibresonicHomeRule(); |
|
|
|
LibresonicHomeRule libresonicRule = new LibresonicHomeRule(); |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Statement apply(Statement base, Description description) { |
|
|
|
public Statement apply(Statement base, Description description) { |
|
|
|
Statement spring = super.apply(base, description); |
|
|
|
Statement spring = super.apply(base, description); |
|
|
|