Skip to content

Commit

Permalink
ARTEMIS-4464 Cleanup on Soak and Smoke tests
Browse files Browse the repository at this point in the history
- removed a few ignored tests
- removed some artemis maven plugin usage and using the CLI directly now
  • Loading branch information
clebertsuconic committed Oct 24, 2023
1 parent c990ed7 commit 9b56d29
Show file tree
Hide file tree
Showing 74 changed files with 1,662 additions and 5,358 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public long getMessageCountOnQueue(String queueName) throws Exception {
return simpleManagementLong(ResourceNames.QUEUE + queueName, "getMessageCount");
}

public long getMessagesAddedOnQueue(String queueName) throws Exception {
return simpleManagementLong(ResourceNames.QUEUE + queueName, "getMessagesAdded");
}

public Map<String, Long> getQueueCounts(int maxRows) throws Exception {
String responseString = simpleManagement("broker", "listQueues", SIMPLE_OPTIONS, 1, maxRows);

Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,14 @@
-->

<!-- for tests that will need a new server created -->
<artemis.distribution.output>${activemq.basedir}/artemis-distribution/target/apache-artemis-${project.version}-bin/apache-artemis-${project.version}</artemis.distribution.output>

<activemq-surefire-argline>-Dorg.apache.activemq.artemis.utils.RetryRule.retry=${retryTests} -Dbrokerconfig.maxDiskUsage=100 -Dorg.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_QUIET_PERIOD=0 -Dorg.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_SHUTDOWN_TIMEOUT=0
-Djava.library.path="${activemq.basedir}/target/bin/lib/linux-x86_64:${activemq.basedir}/target/bin/lib/linux-i686" -Djgroups.bind_addr=localhost
-Djava.net.preferIPv4Stack=true -Dbasedir=${basedir}
-Djdk.attach.allowAttachSelf=true
-Dartemis.distribution.output="${artemis.distribution.output}"
-Dlog4j2.configurationFile="file:${activemq.basedir}/tests/config/${logging.config}"
</activemq-surefire-argline>
<activemq.basedir>${project.basedir}</activemq.basedir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
public class RealServerTestBase extends ActiveMQTestBase {

private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

public static final String STOP_FILE_NAME = "STOP_ME";

Set<Process> processes = new HashSet<>();
Expand Down Expand Up @@ -93,6 +92,10 @@ public static String getServerLocation(String serverName) {
return basedir + "/target/" + serverName;
}

public static File getFileServerLocation(String serverName) {
return new File(getServerLocation(serverName));
}

public static boolean cleanupData(String serverName) {
String location = getServerLocation(serverName);
boolean result = deleteDirectory(new File(location, "data"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.activemq.artemis.utils.cli.helper;

import java.io.File;
import java.lang.invoke.MethodHandles;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HelperBase {

private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

public static final String ARTEMIS_HOME_PROPERTY = "artemis.distribution.output";

File artemisHome;
File artemisInstance;

HelperBase(String homeProperty) {
String propertyHome = System.getProperty(homeProperty);
if (propertyHome == null) {
throw new IllegalArgumentException("System property " + propertyHome + " not defined");
}
if (propertyHome != null) {
artemisHome = new File(propertyHome);
}
logger.debug("using artemisHome as {}", artemisHome);
if (!artemisHome.exists()) {
throw new IllegalArgumentException(artemisHome + " folder does not exist in the file system");
}
if (!new File(artemisHome, "/bin").exists() || !new File(artemisHome, "/bin/artemis").exists()) {
throw new IllegalArgumentException("invalid bin folder");
}
}

public File getArtemisHome() {
return artemisHome;
}

public HelperBase setArtemisHome(File artemisHome) {
this.artemisHome = artemisHome;
return this;
}

public File getArtemisInstance() {
return artemisInstance;
}

public HelperBase setArtemisInstance(File artemisInstance) {
this.artemisInstance = artemisInstance;
return this;
}

public String[] getArgs() {
return args;
}

public HelperBase setArgs(String... args) {
this.args = args;
return this;
}

String[] args = new String[0];
}
Loading

0 comments on commit 9b56d29

Please sign in to comment.