Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Introduce native hints for AssertJ - #1223

Closed
ttddyy wants to merge 2 commits into
spring-attic:mainfrom
ttddyy:gh-1220_assertj
Closed

ttddyy wants to merge 2 commits into
spring-attic:mainfrom
ttddyy:gh-1220_assertj

Conversation

@ttddyy

@ttddyy ttddyy commented Nov 5, 2021

Copy link
Copy Markdown
Contributor

gh-1220

Signed-off-by: Tadaya Tsuyukubo tadaya@ttddyy.net

spring-atticgh-1220

Signed-off-by: Tadaya Tsuyukubo <tadaya@ttddyy.net>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 5, 2021
@sdeleuze

sdeleuze commented Nov 6, 2021

Copy link
Copy Markdown
Contributor

Thanks for this PR, could you please add a related test in one of the samples? Maybe using 8919ac6 from @sbrannen ?

@sdeleuze sdeleuze added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 6, 2021
@ttddyy

ttddyy commented Nov 6, 2021

Copy link
Copy Markdown
Contributor Author

ok, I have added a revert commit of df3da7b.
It was passing the commandlinerunner test yesterday, but I see a different failure, today. :<

Though, at least, building a test image with AssertJ is passing.

JUnit Platform on Native Image - report
----------------------------------------

com.example.commandlinerunner.CommandlinerunnerApplicationTests > contextLoads() FAILED


Failures (1):
  JUnit Jupiter:CommandlinerunnerApplicationTests:contextLoads()
    MethodSource [className = 'com.example.commandlinerunner.CommandlinerunnerApplicationTests', methodName = 'contextLoads', methodParameterTypes = '']
    => java.lang.IllegalStateException: Failed to load ApplicationContext
       org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)
       org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
       org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)
       org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
       org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:43)
       [...]
     Caused by: java.lang.IllegalStateException: java.lang.ClassNotFoundException: org.springframework.aot.ContextBootstrapInitializer. This exception was synthesized during native image building from a call to java.lang.Class.forName(String) with constant arguments.
       org.springframework.aot.SpringApplicationAotUtils.getBootstrapInitializer(SpringApplicationAotUtils.java:41)
       org.springframework.boot.SpringApplication.<init>(SpringApplication.java:121)
       org.springframework.boot.SpringApplication.<init>(SpringApplication.java:240)
       org.springframework.boot.test.context.SpringBootContextLoader.getSpringApplication(SpringBootContextLoader.java:132)
       org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:90)
       [...]
     Caused by: java.lang.ClassNotFoundException: org.springframework.aot.ContextBootstrapInitializer. This exception was synthesized during native image building from a call to java.lang.Class.forName(String) with constant arguments.
       org.springframework.aot.SpringApplicationAotUtils.getBootstrapInitializer(SpringApplicationAotUtils.java:38)
       [...]

Test run finished after 33 ms
[         2 containers found      ]
[         0 containers skipped    ]
[         2 containers started    ]
[         0 containers aborted    ]
[         2 containers successful ]
[         0 containers failed     ]
[         1 tests found           ]
[         0 tests skipped         ]
[         1 tests started         ]
[         0 tests aborted         ]
[         0 tests successful      ]
[         1 tests failed          ]

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 6, 2021
@sbrannen

sbrannen commented Nov 6, 2021

Copy link
Copy Markdown
Contributor

It was passing the commandlinerunner test yesterday, but I see a different failure, today.

That's a known issue:

     Caused by: java.lang.ClassNotFoundException: org.springframework.aot.ContextBootstrapInitializer. This exception was synthesized during native image building from a call to java.lang.Class.forName(String) with constant arguments.

... and it's the next issue to be addressed for the AOT testing support.

I just haven't yet gotten around to creating a GitHub issue for it. 😉

Though, at least, building a test image with AssertJ is passing.

Yes, indeed. Thanks

@sbrannen sbrannen changed the title Native hints for AssertJ Introduce native hints for AssertJ Nov 6, 2021
@sbrannen sbrannen self-assigned this Nov 6, 2021
@sbrannen sbrannen added type: enhancement A general enhancement and removed status: feedback-provided Feedback has been provided labels Nov 6, 2021
@sbrannen sbrannen added this to the 0.11.0-RC1 milestone Nov 6, 2021
@sbrannen sbrannen closed this in d06c82a Nov 6, 2021
@ttddyy
ttddyy deleted the gh-1220_assertj branch November 11, 2021 01:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

type: enhancement A general enhancement

Development

Successfully merging this pull request may close these issues.

4 participants