Skip to content

Refactor to reduce coupling of base UtBot implementation with Spring-specific features #2411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jul 20, 2023

Conversation

IlyaMuravjov
Copy link
Collaborator

@IlyaMuravjov IlyaMuravjov commented Jul 13, 2023

Description

Fixes #2358, #2226

How to test

Regression tests (this pull request should not change UtBot semantics at all)

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@IlyaMuravjov IlyaMuravjov added ctg-refactoring Issue related to refactoring process comp-spring Issue is related to Spring projects support labels Jul 13, 2023
@IlyaMuravjov IlyaMuravjov force-pushed the ilya_m/refactor_spring_app_context branch from a7aaf80 to 6569628 Compare July 17, 2023 10:11
@IlyaMuravjov IlyaMuravjov changed the title Split ApplicationContext into multiple interfaces Refactor to reduce coupling of base UtBot implementation with Spring-specific features Jul 17, 2023
@IlyaMuravjov IlyaMuravjov force-pushed the ilya_m/refactor_spring_app_context branch 2 times, most recently from 19cb36d to 2874151 Compare July 18, 2023 12:50
@IlyaMuravjov IlyaMuravjov marked this pull request as ready for review July 18, 2023 15:25
Copy link
Member

@Damtev Damtev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}
}

class SimpleUtExecutionInstrumentation(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's extract it to a separate file

@@ -117,4 +117,8 @@ class InvokeInstrumentation : Instrumentation<Result<*>> {
protectionDomain: ProtectionDomain,
classfileBuffer: ByteArray
) = null

class Factory : Instrumentation.Factory<Result<*>, InvokeInstrumentation> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not object?

@@ -57,4 +57,8 @@ class ExecutionTraceInstrumentation : Instrumentation<Trace> {
classByteCode
}
}

class Factory : Instrumentation.Factory<Trace, ExecutionTraceInstrumentation> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not object?

@@ -94,6 +94,10 @@ object CoverageInstrumentation : Instrumentation<Result<*>> {

return instrumenter.classByteCode
}

class Factory : Instrumentation.Factory<Result<*>, CoverageInstrumentation> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not object?

@@ -89,6 +89,10 @@ class InvokeWithStaticsInstrumentation : Instrumentation<Result<*>> {
.forEach { it.withAccessibility { it.set(null, savedFields[it.name]) } }
}
}

class Factory : Instrumentation.Factory<Result<*>, InvokeWithStaticsInstrumentation> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not object?

@IlyaMuravjov IlyaMuravjov force-pushed the ilya_m/refactor_spring_app_context branch from 396a4fb to 186a0fb Compare July 19, 2023 14:53
@IlyaMuravjov IlyaMuravjov force-pushed the ilya_m/refactor_spring_app_context branch from f9a6a20 to dbf4da7 Compare July 20, 2023 08:59
@IlyaMuravjov IlyaMuravjov merged commit eab0b84 into main Jul 20, 2023
@IlyaMuravjov IlyaMuravjov deleted the ilya_m/refactor_spring_app_context branch July 20, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-spring Issue is related to Spring projects support ctg-refactoring Issue related to refactoring process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid whens by applicationContext by introducing UTBotComponentFactory
4 participants