Skip to content

Extend Java API for Spring-aware generation #2614

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 1 commit into from
Oct 17, 2023

Conversation

denis-fokin
Copy link
Collaborator

@denis-fokin denis-fokin commented Sep 21, 2023

Description

Fixes #2613

Add more info if needed:

  • context/purpose for implementing changes
  • detailed description of the changes made

How to test

Implement some simple logic or execute the automated example.

Automated tests

utbot-spring-test/src/test/java/org/utibot/examples/spring/SpringUtBotJavaApiTest.java

Manual tests

No manual tests

Self-check list

Check off the item if the statement is true. Hint: [x] is a marked item.

Please do not delete the list or its items.

  • 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.

@denis-fokin denis-fokin added the comp-spring Issue is related to Spring projects support label Sep 21, 2023
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 1b40139 to 49b7bad Compare September 21, 2023 14:55
@denis-fokin denis-fokin marked this pull request as draft September 21, 2023 15:00
Copy link
Collaborator

@IlyaMuravjov IlyaMuravjov left a comment

Choose a reason for hiding this comment

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

UtBotJavaApi.generate() method should also accept ApplicationContext, it should be the same applicationContext instance that was earlier passed to generateTestSets() or fuzzingTestSets(), preferably to guarantee that same applicationContext instance is used for both methods it should be injected into UtBotJavaApi via a constructor and not individually passed to every method.

CodeGenerator should be created with applicationContext.createCodeGenerator(...) (similarly to how it's done in EngineProcessMain), UtExecutionInstrumentation.Factory for ConcreteExecutor should be created with applicationContext.createConcreteExecutionContext(...).instrumentationFactory (simillarly to how it's done TestCaseGenerator).

@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 49b7bad to 02764a4 Compare October 5, 2023 13:11
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 02764a4 to f26b7a7 Compare October 5, 2023 15:15
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from f26b7a7 to 7605bdc Compare October 5, 2023 15:52
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 7605bdc to 05448aa Compare October 6, 2023 08:53
Copy link
Collaborator

@Markoutte Markoutte left a comment

Choose a reason for hiding this comment

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

Looks good to me

@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 05448aa to 174a1d2 Compare October 10, 2023 10:05
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 174a1d2 to ca9284c Compare October 10, 2023 10:21
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from ca9284c to 4504978 Compare October 10, 2023 10:23
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 4504978 to ba9071e Compare October 10, 2023 13:04
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from ba9071e to a819d13 Compare October 13, 2023 08:34
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from a819d13 to d407311 Compare October 13, 2023 16:26
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from d407311 to e2edbce Compare October 14, 2023 17:36
@denis-fokin denis-fokin marked this pull request as ready for review October 16, 2023 08:43
@denis-fokin denis-fokin marked this pull request as draft October 16, 2023 10:48
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 9f54992 to 061f015 Compare October 16, 2023 10:51
@denis-fokin denis-fokin marked this pull request as ready for review October 16, 2023 15:05
@denis-fokin denis-fokin force-pushed the denis-fokin/Java-API-for-Spring-aware-generation branch from 061f015 to 60081eb Compare October 16, 2023 15:47
@denis-fokin denis-fokin merged commit 8852277 into main Oct 17, 2023
@denis-fokin denis-fokin deleted the denis-fokin/Java-API-for-Spring-aware-generation branch October 17, 2023 08:55
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java API for the engine should be extended to support Spring-aware generation
3 participants