This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/master by this push:
new 9e9f88b ARTEMIS-2685 Fixing Examples
new 5085fab This closes #3080
9e9f88b is described below
commit 9e9f88b6b75e595165971e8c539fbc11f74e7a52
Author: Clebert Suconic <[email protected]>
AuthorDate: Tue Apr 14 11:22:06 2020 -0400
ARTEMIS-2685 Fixing Examples
The examples were broken after the change on ServerUtil.
---
.../main/java/org/apache/activemq/artemis/util/ServerUtil.java | 10 +++++++++-
.../activemq/artemis/tests/smoke/common/SmokeTestBase.java | 2 +-
.../apache/activemq/artemis/tests/smoke/mqtt/MQTTLeakTest.java | 2 +-
.../smoke/replicationflow/ReplicationFlowControlTest.java | 2 +-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git
a/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java
index 4812d68..087a1b1 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java
@@ -105,11 +105,19 @@ public class ServerUtil {
}
public static void killServer(final Process server) throws Exception {
+ killServer(server, false);
+ }
+
+ public static void killServer(final Process server, boolean forcibly)
throws Exception {
if (server != null) {
System.out.println("**********************************");
System.out.println("Killing server " + server);
System.out.println("**********************************");
- server.destroyForcibly();
+ if (forcibly) {
+ server.destroyForcibly();
+ } else {
+ server.destroy();
+ }
server.waitFor();
Thread.sleep(1000);
}
diff --git
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/common/SmokeTestBase.java
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/common/SmokeTestBase.java
index f91a361..e6c2a6e 100644
---
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/common/SmokeTestBase.java
+++
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/common/SmokeTestBase.java
@@ -33,7 +33,7 @@ public class SmokeTestBase extends ActiveMQTestBase {
public void after() throws Exception {
for (Process process : processes) {
try {
- ServerUtil.killServer(process);
+ ServerUtil.killServer(process, true);
} catch (Throwable e) {
e.printStackTrace();
}
diff --git
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/mqtt/MQTTLeakTest.java
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/mqtt/MQTTLeakTest.java
index 4ac374a..5d017db 100644
---
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/mqtt/MQTTLeakTest.java
+++
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/mqtt/MQTTLeakTest.java
@@ -60,7 +60,7 @@ public class MQTTLeakTest extends SmokeTestBase {
MQTTRunner.run();
} finally {
- ServerUtil.killServer(server0);
+ ServerUtil.killServer(server0, true);
}
}
diff --git
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
index 0dd579d..7dd6507 100644
---
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
+++
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
@@ -122,7 +122,7 @@ public class ReplicationFlowControlTest extends
SmokeTestBase {
if (KILL_SERVER >= 0 && i == KILL_SERVER) {
session.commit();
System.out.println("Killing server");
- ServerUtil.killServer(server0);
+ ServerUtil.killServer(server0, true);
Thread.sleep(2000);
connection.close();
connection = connectionFactory.createConnection();