mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
do not load metrics in test
This commit is contained in:
parent
d82bd9b22c
commit
b0f32fdba2
2 changed files with 11 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ import io.delilaheve.CustomAnvil
|
||||||
import io.delilaheve.util.ConfigOptions
|
import io.delilaheve.util.ConfigOptions
|
||||||
import xyz.alexcrea.cuanvil.command.DiagnosticExecutor
|
import xyz.alexcrea.cuanvil.command.DiagnosticExecutor
|
||||||
import xyz.alexcrea.cuanvil.config.ConfigHolder
|
import xyz.alexcrea.cuanvil.config.ConfigHolder
|
||||||
|
import xyz.alexcrea.cuanvil.dependency.DependencyManager
|
||||||
|
|
||||||
object MetricsUtil {
|
object MetricsUtil {
|
||||||
|
|
||||||
|
|
@ -17,6 +18,8 @@ object MetricsUtil {
|
||||||
private var FAST_STATS_METRICS: BukkitContext? = null
|
private var FAST_STATS_METRICS: BukkitContext? = null
|
||||||
|
|
||||||
fun loadMetrics(plugin: CustomAnvil) {
|
fun loadMetrics(plugin: CustomAnvil) {
|
||||||
|
if(DependencyManager.externGuiTester.isInTest()) return
|
||||||
|
|
||||||
val config = ConfigHolder.DEFAULT_CONFIG.config
|
val config = ConfigHolder.DEFAULT_CONFIG.config
|
||||||
val metricString = config.getString(ConfigOptions.METRIC_TYPE, MetricType.AUTO.value)!!
|
val metricString = config.getString(ConfigOptions.METRIC_TYPE, MetricType.AUTO.value)!!
|
||||||
val metricType = MetricType.from(metricString)
|
val metricType = MetricType.from(metricString)
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,15 @@ public class CustomAnvilTests extends DefaultCustomAnvilTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void simpleInitTest() {
|
public void simpleInitTest() {
|
||||||
Assertions.assertNotNull(server);
|
try {
|
||||||
Assertions.assertNotNull(plugin);
|
Assertions.assertNotNull(server);
|
||||||
|
Assertions.assertNotNull(plugin);
|
||||||
|
|
||||||
// Test shutdown
|
// Test shutdown
|
||||||
plugin.onDisable();
|
plugin.onDisable();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Assertions.fail(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue