1
1
package org.utbot.contest
2
2
3
+ import java.io.File
4
+ import java.lang.reflect.Method
5
+ import java.lang.reflect.Modifier
6
+ import java.net.URL
7
+ import java.net.URLClassLoader
8
+ import java.nio.file.Paths
9
+ import kotlin.concurrent.thread
10
+ import kotlin.math.max
11
+ import kotlin.math.min
12
+ import kotlin.reflect.KCallable
13
+ import kotlin.reflect.jvm.isAccessible
3
14
import kotlinx.coroutines.CancellationException
4
15
import kotlinx.coroutines.CoroutineScope
5
16
import kotlinx.coroutines.GlobalScope
@@ -39,8 +50,6 @@ import org.utbot.framework.plugin.api.UtMethodTestSet
39
50
import org.utbot.framework.plugin.api.util.UtContext
40
51
import org.utbot.framework.plugin.api.util.executableId
41
52
import org.utbot.framework.plugin.api.util.id
42
- import org.utbot.framework.plugin.api.util.isConstructor
43
- import org.utbot.framework.plugin.api.util.isEnum
44
53
import org.utbot.framework.plugin.api.util.jClass
45
54
import org.utbot.framework.plugin.api.util.utContext
46
55
import org.utbot.framework.plugin.api.util.withUtContext
@@ -50,18 +59,6 @@ import org.utbot.instrumentation.ConcreteExecutor
50
59
import org.utbot.instrumentation.ConcreteExecutorPool
51
60
import org.utbot.instrumentation.Settings
52
61
import org.utbot.instrumentation.warmup.Warmup
53
- import java.io.File
54
- import java.lang.reflect.Method
55
- import java.lang.reflect.Modifier
56
- import java.net.URL
57
- import java.net.URLClassLoader
58
- import java.nio.file.Paths
59
- import java.util.concurrent.ConcurrentSkipListSet
60
- import kotlin.concurrent.thread
61
- import kotlin.math.max
62
- import kotlin.math.min
63
- import kotlin.reflect.KCallable
64
- import kotlin.reflect.jvm.isAccessible
65
62
66
63
internal const val junitVersion = 4
67
64
private val logger = KotlinLogging .logger {}
@@ -396,14 +393,13 @@ private fun prepareClass(javaClazz: Class<*>, methodNameFilter: String?): List<E
396
393
397
394
// 2. all constructors from cut
398
395
val constructors =
399
- if (javaClazz.isAbstract) emptyList() else javaClazz.declaredConstructors.filterNotNull()
396
+ if (javaClazz.isAbstract || javaClazz.isEnum ) emptyList() else javaClazz.declaredConstructors.filterNotNull()
400
397
401
398
// 3. Now join methods and constructors together
402
399
val methodsToGenerate = methods.filter { it.isVisibleFromGeneratedTest } + constructors
403
400
404
401
val classFilteredMethods = methodsToGenerate
405
402
.map { it.executableId }
406
- .filterNot { it.isConstructor && it.classId.isEnum }
407
403
.filter { methodNameFilter?.equals(it.name) ? : true }
408
404
.filterWhen(UtSettings .skipTestGenerationForSyntheticMethods) { ! isKnownSyntheticMethod(it) }
409
405
.toList()
0 commit comments