ARTEMIS-3715 Support testClientID for artemis-maven-plugin

This commit is contained in:
Domenico Francesco Bruscino 2022-03-10 10:00:47 +01:00 committed by clebertsuconic
parent 82069e9c3c
commit f7915a2733
1 changed files with 5 additions and 2 deletions

View File

@ -62,6 +62,9 @@ public class ArtemisCLIPlugin extends ArtemisAbstractPlugin {
@Parameter
private String testURI = null;
@Parameter
private String testClientID = null;
@Parameter
private String testUser = null;
@ -107,8 +110,8 @@ public class ArtemisCLIPlugin extends ArtemisAbstractPlugin {
long timeout = System.currentTimeMillis() + spawnTimeout;
while (System.currentTimeMillis() <= timeout) {
try (ServerLocator locator = ActiveMQClient.createServerLocator(testURI)) {
if (testUser != null && testPassword != null) {
locator.createSessionFactory().createSession(testUser, testPassword, false, false, false, false, 0).close();
if (testUser != null || testPassword != null || testClientID != null) {
locator.createSessionFactory().createSession(testUser, testPassword, false, false, false, false, 0, testClientID).close();
} else {
locator.createSessionFactory().createSession().close();
}