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

Commit 8dae4b6

Browse files
author
yweber
committed
addressed PR change requests
1 parent 564c6f6 commit 8dae4b6

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ build/
77

88
.DS_Store
99
.java-version
10-
/junit4/src/test/resources/maven-extension/target/
11-
/junit5/src/test/resources/maven-extension/target/
10+
target/

core/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ dependencies {
1616
implementation group: 'org.jboss.shrinkwrap', name: 'shrinkwrap-impl-base', version: shrinkWrapVersion
1717
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: zip4jVersion
1818

19+
/* This dependency needs to be explicitly added, because shrinkwrap-resolver-api-maven-embedded
20+
and shrinkwrap-resolver-impl-maven-embedded depend on different versions of it.
21+
This would lead to issues when the HiveMQ Testcontainer is included in maven projects. */
1922
implementation group: 'org.codehaus.plexus', name: 'plexus-utils', version: '3.2.1'
20-
implementation (group: 'org.jboss.shrinkwrap.resolver', name: 'shrinkwrap-resolver-api-maven-embedded', version: shrinkwrapResolverDepchainVersion) {
23+
implementation(group: 'org.jboss.shrinkwrap.resolver', name: 'shrinkwrap-resolver-api-maven-embedded', version: shrinkwrapResolverDepchainVersion) {
2124
exclude group: 'org.codehouse.plexus', module: 'plexus-utils'
2225
}
23-
runtimeOnly (group: 'org.jboss.shrinkwrap.resolver', name: 'shrinkwrap-resolver-impl-maven-embedded', version: shrinkwrapResolverDepchainVersion) {
26+
runtimeOnly(group: 'org.jboss.shrinkwrap.resolver', name: 'shrinkwrap-resolver-impl-maven-embedded', version: shrinkwrapResolverDepchainVersion) {
2427
exclude group: 'org.codehouse.plexus', module: 'plexus-utils'
2528
}
2629

core/src/main/java/com/hivemq/testcontainer/core/HiveMQTestContainerCore.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ private void putSubclassesIntoJar(
377377
* @param extensionDirectory the name of the extension's directory
378378
* @param timeout the timeout
379379
* @return self
380+
* @since 1.1.0
380381
*/
381382
public @NotNull SELF disableExtension(
382383
final @NotNull String extensionName,
@@ -417,6 +418,7 @@ private void putSubclassesIntoJar(
417418
* @param extensionName the name of the extension to disable
418419
* @param extensionDirectory the name of the extension's directory
419420
* @return self
421+
* @since 1.1.0
420422
*/
421423
public @NotNull SELF disableExtension(
422424
final @NotNull String extensionName,
@@ -466,6 +468,7 @@ private void putSubclassesIntoJar(
466468
* @param extensionDirectory the name of the extension's directory
467469
* @param timeout the timeout
468470
* @return self
471+
* @since 1.1.0
469472
*/
470473
public @NotNull SELF enableExtension(
471474
final @NotNull String extensionName,
@@ -506,6 +509,7 @@ private void putSubclassesIntoJar(
506509
* @param extensionName the name of the extension to disable
507510
* @param extensionDirectory the name of the extension's directory
508511
* @return self
512+
* @since 1.1.0
509513
*/
510514
public @NotNull SELF enableExtension(
511515
final @NotNull String extensionName,

core/src/main/java/com/hivemq/testcontainer/core/MavenHiveMQExtensionSupplier.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* This class automates the process of packaging a HiveMQ extension from a maven project.
3131
*
3232
* @author Yannick Weber
33+
* @since 1.1.0
3334
*/
3435
public class MavenHiveMQExtensionSupplier implements Supplier<File> {
3536

@@ -40,6 +41,7 @@ public class MavenHiveMQExtensionSupplier implements Supplier<File> {
4041
* It uses the pom.xml file of the current maven project.
4142
*
4243
* @return a {@link MavenHiveMQExtensionSupplier} for the current maven project
44+
* @since 1.1.0
4345
*/
4446
public static @NotNull MavenHiveMQExtensionSupplier direct() {
4547
return new MavenHiveMQExtensionSupplier("pom.xml");
@@ -49,6 +51,7 @@ public class MavenHiveMQExtensionSupplier implements Supplier<File> {
4951
* Creates a Maven HiveMQ extension {@link Supplier}.
5052
*
5153
* @param pomFile the path of the pom.xml of the HiveMQ extension to supply.
54+
* @since 1.1.0
5255
*/
5356
public MavenHiveMQExtensionSupplier(final @NotNull String pomFile) {
5457
this.pomFile = pomFile;
@@ -58,6 +61,7 @@ public MavenHiveMQExtensionSupplier(final @NotNull String pomFile) {
5861
* Packages the HiveMQ extension, copies it to a temporary directory and returns the directory as a {@link File}.
5962
*
6063
* @return the {@link File} of the packaged HiveMQ extension
64+
* @since 1.1.0
6165
*/
6266
@Override
6367
public @NotNull File get() {

readme.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ You can define a custom image and tag in the constructor:
150150
### JUnit 5
151151

152152
@RegisterExtension
153-
final @NotNull HiveMQTestContainerExtension rule =
153+
final @NotNull HiveMQTestContainerExtension extension =
154154
new HiveMQTestContainerExtension("hivemq/hivemq4", "latest")
155155
.withHiveMQConfig(new File("src/test/resources/config.xml"));
156156
@@ -268,8 +268,6 @@ Note that disabling or enabling of extension during runtime is only supported in
268268
extension.disableExtension(hiveMQExtension);
269269
}
270270

271-
It is possible to enable and disable extensions that are loaded from a file by providing their directory name and extension name:
272-
273271
## Enable/Disable an extension loaded from a folder
274272

275273
You can enable or disable extensions loaded from an extension folder during runtime.

0 commit comments

Comments
 (0)