-
Notifications
You must be signed in to change notification settings - Fork 217
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
Upgrade to Java 17 #1673
Upgrade to Java 17 #1673
Conversation
...allegro/tech/hermes/frontend/producer/kafka/KafkaBrokerMessageProducerIntegrationTest.groovy
Show resolved
Hide resolved
...allegro/tech/hermes/frontend/producer/kafka/KafkaBrokerMessageProducerIntegrationTest.groovy
Show resolved
Hide resolved
...search/src/test/java/pl/allegro/tech/hermes/tracker/elasticsearch/ElasticsearchResource.java
Show resolved
Hide resolved
integration/build.gradle
Outdated
implementation project(':hermes-tracker') | ||
|
||
implementation project(':hermes-test-helper') | ||
//TODO: why testImplementations do not work? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Great question which I'm more than glad to answer :)
Module integration
uses Java Plugin, which gives you implementation
configuration. To define our custom configuration - integration
- we use configuration extending implementation
.
Here you can find definition of integration
configuration:
project.configurations {
integration {
extendsFrom project.configurations.runtimeClasspath
description = 'Dependencies for integration tests'
transitive = true
visible = true
}
alpnboot
}
Crucial thing here is extendsFrom project.configurations.runtimeClasspath
line.
runtimeClasspath
is (yet another) configuration which extends implementation
configuration:
runtimeClasspath extends runtimeOnly, implementation
Runtime classpath contains elements of the implementation, as well as runtime only elements.
So whole configuration chain looks like this:
+--------------+ +----------------+ +-----------+
|implementation|<-----+runtimeClasspath|<----+integration|
+--------------+ +----------------+ +-----------+
^
|
| +------------------+
+-------+testImplementation|
+------------------+
And as you can see, integration
configuration does not use testImplementation
configuration resources - that's why using testImplementation
doesn't work.
PS - using integration
instead of implementation
would also do the job 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great explanation, thank you!
We have a pice of code strictly related to the java version: public class DirectBufferUtilsTest {
@Test
public void shouldReleaseDirectByteBuffer() {
// given
ByteBuffer buffer = ByteBuffer.allocateDirect(128);
// when
boolean released = DirectBufferUtils.release(buffer);
// then
assertTrue(released);
}
@Test
public void shouldNotReleaseByteBuffer() {
// given
ByteBuffer buffer = ByteBuffer.allocate(128);
// when
boolean released = DirectBufferUtils.release(buffer);
// then
assertFalse(released);
}
} I suspect that checking if the Additionally, you might consider renaming the internal class: |
@piotrrzysko Good catch with the |
i am facing this issue. Please help |
changing jdk looks ok but failed to start hermes-management COPY --chown=gradle:gradle . /home/gradle/src/ FROM eclipse-temurin:17 2023-06-26 05:49:50 |
No description provided.