1
|
/**
|
2
|
* Copyright (C) 2017 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 unitils;
|
10
|
|
11
|
import org.junit.internal.runners.InitializationError;
|
12
|
import org.junit.runner.notification.RunNotifier;
|
13
|
import org.unitils.UnitilsJUnit4TestClassRunner;
|
14
|
|
15
|
/**
|
16
|
* A runner which causes the {@link org.unitils.core.ConfigurationLoader} to load <code>unitils-alternativeRunner.properties</code>
|
17
|
* instead of <code>unitils.properties</code>.
|
18
|
*
|
19
|
* @author a.kohlbecker
|
20
|
* @since Nov 23, 2017
|
21
|
*
|
22
|
*/
|
23
|
public class AlternativeUnitilsJUnit4TestClassRunner extends UnitilsJUnit4TestClassRunner {
|
24
|
|
25
|
/**
|
26
|
* @param testClass
|
27
|
* @throws InitializationError
|
28
|
*/
|
29
|
public AlternativeUnitilsJUnit4TestClassRunner(Class<?> testClass) throws InitializationError {
|
30
|
super(testClass);
|
31
|
}
|
32
|
|
33
|
/**
|
34
|
* {@inheritDoc}
|
35
|
*/
|
36
|
@Override
|
37
|
public void run(RunNotifier notifier) {
|
38
|
System.setProperty("unitils.configuration.customFileName", "unitils-alternativeRunner.properties");
|
39
|
super.run(notifier);
|
40
|
}
|
41
|
|
42
|
|
43
|
|
44
|
}
|