Skip to content
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

New Module: HiveMQ #4797

Merged
merged 67 commits into from Feb 17, 2022
Merged

New Module: HiveMQ #4797

merged 67 commits into from Feb 17, 2022

Conversation

YannickWeber
Copy link
Contributor

This brings HiveMQ's official Testcontainer to testcontainers-java.

Features:

  • Testing MQTT 3 and MQTT 5 client applications
  • Integration Testing of HiveMQ Extensions
  • HiveMQ specific WaitStrategy

docs/modules/hivemq.md Outdated Show resolved Hide resolved
@kiview
Copy link
Member

kiview commented Dec 22, 2021

@YannickWeber
CI is currently failing with

/home/runner/work/testcontainers-java/testcontainers-java/modules/hivemq/src/main/java/org/testcontainers/hivemq/HiveMQExtension.java:27: error: cannot access com.hivemq.extension.sdk.api.ExtensionMain
import com.hivemq.extension.sdk.api.ExtensionMain;
                                   ^
  bad class file: /home/runner/.gradle/caches/modules-2/files-2.1/com.hivemq/hivemq-extension-sdk/4.4.4/f0c556c64f5ae71249381038f0f86e5ba7b9c4e9/hivemq-extension-sdk-4.4.4.jar(com/hivemq/extension/sdk/api/ExtensionMain.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

Do you have specific Java requirements? Then we should check out using Gradle's Java Toolchain feature for the HiveMQ module. We currently use JDK8.

@YannickWeber
Copy link
Contributor Author

@YannickWeber CI is currently failing with

/home/runner/work/testcontainers-java/testcontainers-java/modules/hivemq/src/main/java/org/testcontainers/hivemq/HiveMQExtension.java:27: error: cannot access com.hivemq.extension.sdk.api.ExtensionMain
import com.hivemq.extension.sdk.api.ExtensionMain;
                                   ^
  bad class file: /home/runner/.gradle/caches/modules-2/files-2.1/com.hivemq/hivemq-extension-sdk/4.4.4/f0c556c64f5ae71249381038f0f86e5ba7b9c4e9/hivemq-extension-sdk-4.4.4.jar(com/hivemq/extension/sdk/api/ExtensionMain.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

Do you have specific Java requirements? Then we should check out using Gradle's Java Toolchain feature for the HiveMQ module. We currently use JDK8.

The problem is that the hivemq-extension-sdk requires Java 11. We solved the problem in the following way:

  • removed the compileOnly dependency on the hivemq-extension-sdk
  • configured gradle to execute the test with Java 11

What this achieves:

  • User that just want to use the HiveMQ Container can use Java 8.
  • Users that want to build HiveMQ Extensions on the fly are required to include the hivemq-extension-sdk as usual and are required to use Java 11 anyway

@kiview
Copy link
Member

kiview commented Dec 22, 2021

CI is currently failing in the Javadoc task for the HiveMQ module (https://github.com/testcontainers/testcontainers-java/runs/4609274189?check_suite_focus=true#step:7:70):

/home/runner/work/testcontainers-java/testcontainers-java/modules/hivemq/build/delombok/org/testcontainers/hivemq/HiveMQExtension.java:185: error: reference not found

         * This class MUST implement {@link com.hivemq.extension.sdk.api.ExtensionMain}.
> Task :hivemq:javadoc FAILED
                                            ^
/home/runner/work/testcontainers-java/testcontainers-java/modules/hivemq/build/delombok/org/testcontainers/hivemq/HiveMQExtension.java:189: error: reference not found
         * @throws IllegalArgumentException if the provides class does not implement {@link com.hivemq.extension.sdk.api.ExtensionMain}
                                                                                            ^
/home/runner/work/testcontainers-java/testcontainers-java/modules/hivemq/build/delombok/org/testcontainers/hivemq/HiveMQExtension.java:190: error: reference not found
         * @throws IllegalStateException if {@link com.hivemq.extension.sdk.api.ExtensionMain} is not found in the classpath
                                                   ^
3 errors

@kiview kiview mentioned this pull request Jan 11, 2022
Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

Have added some comments but will try and have another look tomorrow!

docs/modules/hivemq.md Outdated Show resolved Hide resolved
docs/modules/hivemq.md Outdated Show resolved Hide resolved
mkdocs.yml Show resolved Hide resolved
modules/hivemq/.gitignore Outdated Show resolved Hide resolved
modules/hivemq/src/test/resources/logback-test.xml Outdated Show resolved Hide resolved
alter container command only if prepackaged extensions need to be removed
@kiview kiview mentioned this pull request Feb 17, 2022
@kiview kiview added this to the next milestone Feb 17, 2022
@kiview
Copy link
Member

kiview commented Feb 17, 2022

Thanks to everyone involved and especially @YannickWeber for your patience. This was indeed a massive PR, but I am very happy we reworked it together and that we get a great new module into Testcontainers. Thanks!

@kiview kiview merged commit bfb8cec into testcontainers:master Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants