Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1de5cf9

Browse files
authored
Make Spring integration tests useAbstractsValueProvider (#2433)
1 parenteab0b84 commit1de5cf9

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

‎utbot-framework/src/main/kotlin/org/utbot/framework/context/spring/SpringIntegrationTestConcreteExecutionContext.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import org.utbot.fuzzing.JavaValueProvider
1717
importorg.utbot.fuzzing.ValueProvider
1818
importorg.utbot.fuzzing.providers.FieldValueProvider
1919
importorg.utbot.fuzzing.providers.ObjectValueProvider
20+
importorg.utbot.fuzzing.providers.anyObjectValueProvider
2021
importorg.utbot.fuzzing.spring.SavedEntityValueProvider
2122
importorg.utbot.fuzzing.spring.SpringBeanValueProvider
2223
importorg.utbot.instrumentation.ConcreteExecutor
@@ -85,7 +86,7 @@ class SpringIntegrationTestConcreteExecutionContext(
8586
springApplicationContext.getBeansAssignableTo(classId).map { it.beanName }
8687
},
8788
relevantRepositories= relevantRepositories
88-
).withFallback(ObjectValueProvider(idGenerator))
89+
).withFallback(anyObjectValueProvider(idGenerator))
8990

9091
return delegateContext.tryCreateValueProvider(concreteExecutor, classUnderTest, idGenerator)
9192
.except { p-> pisObjectValueProvider }

‎utbot-java-fuzzing/src/main/kotlin/org/utbot/fuzzing/JavaLanguage.kt‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
packageorg.utbot.fuzzing
22

33
importmu.KotlinLogging
4-
importorg.utbot.framework.UtSettings
54
importorg.utbot.framework.plugin.api.ClassId
65
importorg.utbot.framework.plugin.api.ExecutableId
76
importorg.utbot.framework.plugin.api.Instruction
@@ -43,9 +42,7 @@ fun defaultValueProviders(idGenerator: IdentityPreservingIdGenerator<Int>) = lis
4342
FloatValueProvider,
4443
StringValueProvider,
4544
NumberValueProvider,
46-
ObjectValueProvider(idGenerator).letIf(UtSettings.fuzzingImplementationOfAbstractClasses) { ovp->
47-
ovp.withFallback(AbstractsObjectValueProvider(idGenerator))
48-
},
45+
anyObjectValueProvider(idGenerator),
4946
ArrayValueProvider(idGenerator),
5047
EnumValueProvider(idGenerator),
5148
ListSetValueProvider(idGenerator),

‎utbot-java-fuzzing/src/main/kotlin/org/utbot/fuzzing/providers/Objects.kt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
packageorg.utbot.fuzzing.providers
22

33
importmu.KotlinLogging
4+
importorg.utbot.framework.UtSettings
45
importorg.utbot.framework.plugin.api.*
56
importorg.utbot.framework.plugin.api.util.*
67
importorg.utbot.fuzzer.*
@@ -30,6 +31,11 @@ private fun isIgnored(type: ClassId): Boolean {
3031
|| (type.isInner&&!type.isStatic)
3132
}
3233

34+
funanyObjectValueProvider(idGenerator:IdentityPreservingIdGenerator<Int>)=
35+
ObjectValueProvider(idGenerator).letIf(UtSettings.fuzzingImplementationOfAbstractClasses) { ovp->
36+
ovp.withFallback(AbstractsObjectValueProvider(idGenerator))
37+
}
38+
3339
classObjectValueProvider(
3440
validGenerator:IdGenerator<Int>,
3541
) : ValueProvider<FuzzedType, FuzzedValue, FuzzedDescription> {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp