11package org.utbot.contest
22
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
314import kotlinx.coroutines.CancellationException
415import kotlinx.coroutines.CoroutineScope
516import kotlinx.coroutines.GlobalScope
@@ -39,8 +50,6 @@ import org.utbot.framework.plugin.api.UtMethodTestSet
3950import org.utbot.framework.plugin.api.util.UtContext
4051import org.utbot.framework.plugin.api.util.executableId
4152import 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
4453import org.utbot.framework.plugin.api.util.jClass
4554import org.utbot.framework.plugin.api.util.utContext
4655import org.utbot.framework.plugin.api.util.withUtContext
@@ -50,18 +59,6 @@ import org.utbot.instrumentation.ConcreteExecutor
5059import org.utbot.instrumentation.ConcreteExecutorPool
5160import org.utbot.instrumentation.Settings
5261import 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
6562
6663internal const val junitVersion = 4
6764private val logger = KotlinLogging .logger {}
@@ -396,14 +393,13 @@ private fun prepareClass(javaClazz: Class<*>, methodNameFilter: String?): List<E
396393
397394 // 2. all constructors from cut
398395 val constructors =
399- if (javaClazz.isAbstract) emptyList() else javaClazz.declaredConstructors.filterNotNull()
396+ if (javaClazz.isAbstract || javaClazz.isEnum ) emptyList() else javaClazz.declaredConstructors.filterNotNull()
400397
401398 // 3. Now join methods and constructors together
402399 val methodsToGenerate = methods.filter { it.isVisibleFromGeneratedTest } + constructors
403400
404401 val classFilteredMethods = methodsToGenerate
405402 .map { it.executableId }
406- .filterNot { it.isConstructor && it.classId.isEnum }
407403 .filter { methodNameFilter?.equals(it.name) ? : true }
408404 .filterWhen(UtSettings .skipTestGenerationForSyntheticMethods) { ! isKnownSyntheticMethod(it) }
409405 .toList()
0 commit comments