|
1 | 1 | package com.alibaba.dcm.tool |
2 | 2 |
|
3 | 3 | import io.kotest.assertions.fail |
4 | | -import io.kotest.core.annotation.EnabledCondition |
5 | | -import io.kotest.core.annotation.EnabledIf |
6 | | -import io.kotest.core.spec.Spec |
7 | 4 | import io.kotest.core.spec.style.AnnotationSpec |
| 5 | +import io.kotest.core.test.config.TestCaseConfig |
8 | 6 | import io.kotest.matchers.shouldBe |
9 | 7 | import org.apache.commons.io.FileUtils |
10 | 8 | import org.apache.commons.lang3.SystemUtils |
11 | 9 | import org.apache.maven.artifact.versioning.ComparableVersion |
12 | 10 | import java.io.File |
13 | 11 | import java.net.InetAddress |
14 | | -import kotlin.reflect.KClass |
15 | 12 | import kotlin.streams.toList |
16 | 13 |
|
17 | 14 | /** |
18 | 15 | * https://kotest.io/docs/framework/testing-styles.html#annotation-spec |
19 | 16 | * |
20 | 17 | * @author Jerry Lee (oldratlee at gmail dot com) |
21 | 18 | */ |
22 | | -// Ignore "attach to current VM" test for jdk 9+, since java 9+ does not support |
23 | | -// "java.io.IOException: Can not attach to current VM" |
24 | | -@EnabledIf(Java8Only::class) |
25 | 19 | class DcmToolTests : AnnotationSpec() { |
26 | 20 |
|
| 21 | + // Ignore "attach to current VM" test for jdk 9+, since java 9+ does not support |
| 22 | + // "java.io.IOException: Can not attach to current VM" |
| 23 | + @Suppress("OverridingDeprecatedMember") |
| 24 | + override fun defaultTestCaseConfig(): TestCaseConfig = |
| 25 | + TestCaseConfig(enabled = SystemUtils.IS_JAVA_1_8) |
| 26 | + |
27 | 27 | private lateinit var agentFilePath: String |
28 | 28 |
|
29 | 29 | @BeforeAll |
@@ -98,10 +98,3 @@ class DcmToolTests : AnnotationSpec() { |
98 | 98 | return !replaced.contains("-") |
99 | 99 | } |
100 | 100 | } |
101 | | - |
102 | | -/** |
103 | | - * https://kotest.io/docs/framework/conditional/spec-annotations-conditional-evaluation.html |
104 | | - */ |
105 | | -class Java8Only : EnabledCondition { |
106 | | - override fun enabled(kclass: KClass<out Spec>): Boolean = SystemUtils.IS_JAVA_1_8 |
107 | | -} |
0 commit comments