ARTEMIS-4081 Comparing upgrades against fresh instances and some adjustments
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InstallAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InstallAbstract.java
index ae6f082..d12692b 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InstallAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InstallAbstract.java
@@ -94,7 +94,7 @@
return null;
}
- protected String applyFilters(String content, Map<String, String> filters) {
+ protected static String applyFilters(String content, Map<String, String> filters) {
if (filters != null) {
for (Map.Entry<String, String> entry : filters.entrySet()) {
content = replace(content, entry.getKey(), entry.getValue());
@@ -103,11 +103,11 @@
return content;
}
- protected String replace(String content, String key, String value) {
+ protected static String replace(String content, String key, String value) {
return content.replaceAll(Pattern.quote(key), Matcher.quoteReplacement(value));
}
- protected void copy(InputStream is, OutputStream os) throws IOException {
+ protected static void copy(InputStream is, OutputStream os) throws IOException {
byte[] buffer = new byte[1024 * 4];
int c = is.read(buffer);
while (c >= 0) {
@@ -140,7 +140,7 @@
}
}
- protected String readTextFile(String source, Map<String, String> filters) throws IOException {
+ protected static String readTextFile(String source, Map<String, String> filters) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try (InputStream in = openStream(source)) {
if (in == null) {
@@ -163,7 +163,7 @@
}
}
- protected InputStream openStream(String source) {
- return this.getClass().getResourceAsStream(source);
+ protected static InputStream openStream(String source) {
+ return InputAbstract.class.getResourceAsStream(source);
}
}
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Upgrade.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Upgrade.java
index a268ea8..0529018 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Upgrade.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Upgrade.java
@@ -31,10 +31,20 @@
import java.util.stream.Stream;
import io.airlift.airline.Command;
+import org.apache.activemq.artemis.util.JVMArgumentParser;
@Command(name = "upgrade", description = "Update an artemis instance to the current artemis.home, keeping all the data and broker.xml. Warning: backup your instance before using this command and compare the files.")
public class Upgrade extends InstallAbstract {
+ // these are the JVM argumnents we must keep between upgrades
+ private static final String[] KEEPING_JVM_ARGUMENTS = new String[]{"-Xmx", "-Djava.security.auth.login.config", "-Dhawtio.role="};
+
+ // this is the prefix where we can find the JDK arguments in Windows script
+ private static final String JDK_PREFIX_WINDOWS = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS=";
+
+ // this is the prefix where we can find the JDK arguments in Linux script
+ private static final String JDK_PREFIX_LINUX = "JAVA_ARGS=";
+
protected static final String OLD_LOGGING_PROPERTIES = "logging.properties";
/**
@@ -98,6 +108,10 @@
Create.addScriptFilters(filters, getHome(), getInstance(), etcFolder, new File(getInstance(), "notUsed"), new File(getInstance(), "om-not-used.dmp"), javaMemory, javaOptions, "NA");
if (IS_WINDOWS) {
+ // recreating the service.exe in case we ever upgrade it
+ write(Create.BIN_ARTEMIS_SERVICE_EXE, true);
+ write(Create.BIN_ARTEMIS_SERVICE_EXE_CONFIG, true);
+
write(Create.BIN_ARTEMIS_CMD, new File(tmp, Create.ARTEMIS_CMD), filters, false, false);
upgrade(new File(tmp, Create.ARTEMIS_CMD), new File(bin, Create.ARTEMIS_CMD), binBkp, "set ARTEMIS_INSTANCE_ETC=");
@@ -105,11 +119,12 @@
upgrade(new File(tmp, Create.ARTEMIS_SERVICE_XML), new File(bin, Create.ARTEMIS_SERVICE_XML), binBkp,
"<env name=\"ARTEMIS_INSTANCE\"", "<env name=\"ARTEMIS_INSTANCE_ETC\"",
"<env name=\"ARTEMIS_INSTANCE_URI\"", "<env name=\"ARTEMIS_INSTANCE_ETC_URI\"",
- "<env name=\"ARTEMIS_DATA_DIR\"", "<logpath>", "<startargument>-Xmx", "<stopargument>-Xmx");
+ "<env name=\"ARTEMIS_DATA_DIR\"", "<logpath>", "<startargument>-Xmx", "<stopargument>-Xmx",
+ "<name>", "<id>", "<startargument>-Dhawtio.role=");
write("etc/" + Create.ETC_ARTEMIS_PROFILE_CMD, new File(tmp, Create.ETC_ARTEMIS_PROFILE_CMD), filters, false, false);
- upgrade(new File(tmp, Create.ETC_ARTEMIS_PROFILE_CMD), new File(etcFolder, Create.ETC_ARTEMIS_PROFILE_CMD), binBkp,
- "set ARTEMIS_INSTANCE=\"", "set ARTEMIS_DATA_DIR=", "set ARTEMIS_ETC_DIR=", "set ARTEMIS_OOME_DUMP=", "set ARTEMIS_INSTANCE_URI=", "set ARTEMIS_INSTANCE_ETC_URI=");
+ upgradeJDK(JDK_PREFIX_WINDOWS, "", KEEPING_JVM_ARGUMENTS, new File(tmp, Create.ETC_ARTEMIS_PROFILE_CMD), new File(etcFolder, Create.ETC_ARTEMIS_PROFILE_CMD), binBkp,
+ "set ARTEMIS_INSTANCE=\"", "set ARTEMIS_DATA_DIR=", "set ARTEMIS_ETC_DIR=", "set ARTEMIS_OOME_DUMP=", "set ARTEMIS_INSTANCE_URI=", "set ARTEMIS_INSTANCE_ETC_URI=");
}
if (!IS_WINDOWS || IS_CYGWIN) {
@@ -120,10 +135,15 @@
upgrade(new File(tmp, Create.ARTEMIS_SERVICE), new File(bin, Create.ARTEMIS_SERVICE), binBkp); // we replace the whole thing
write("etc/" + Create.ETC_ARTEMIS_PROFILE, new File(tmp, Create.ETC_ARTEMIS_PROFILE), filters, false, false);
- upgrade(new File(tmp, Create.ETC_ARTEMIS_PROFILE), new File(etcFolder, Create.ETC_ARTEMIS_PROFILE), etcBkp, "ARTEMIS_INSTANCE=",
- "ARTEMIS_DATA_DIR=", "ARTEMIS_ETC_DIR=", "ARTEMIS_OOME_DUMP=", "ARTEMIS_INSTANCE_URI=", "ARTEMIS_INSTANCE_ETC_URI=", "HAWTIO_ROLE=");
+ upgradeJDK(JDK_PREFIX_LINUX, "\"", KEEPING_JVM_ARGUMENTS,
+ new File(tmp, Create.ETC_ARTEMIS_PROFILE), new File(etcFolder, Create.ETC_ARTEMIS_PROFILE), etcBkp, "ARTEMIS_INSTANCE=",
+ "ARTEMIS_DATA_DIR=", "ARTEMIS_ETC_DIR=", "ARTEMIS_OOME_DUMP=", "ARTEMIS_INSTANCE_URI=", "ARTEMIS_INSTANCE_ETC_URI=", "HAWTIO_ROLE=");
}
+
+ Files.copy( new File(etcFolder, Create.ETC_BOOTSTRAP_XML).toPath(), new File(tmp, Create.ETC_BOOTSTRAP_XML).toPath());
+ replaceLines(new File(tmp, Create.ETC_BOOTSTRAP_XML), new File(etcFolder, Create.ETC_BOOTSTRAP_XML), binBkp, "<web path", " <web path=\"web\" rootRedirectLocation=\"console\">");
+
upgradeLogging(context, etcBkp, etcFolder);
context.out.println();
@@ -158,6 +178,54 @@
return null;
}
+
+ private void upgradeJDK(String jdkPrefix, String endOfLine, String[] keepArguments, File tmpFile, File targetFile, File bkp, String... keepingPrefixes) throws Exception {
+
+ final HashMap<String, String> replaceMatrix = new HashMap<>();
+ final HashMap<String, String> currentArguments = new HashMap<>();
+
+ doUpgrade(tmpFile, targetFile, bkp,
+ oldLine -> {
+ if (oldLine.trim().startsWith(jdkPrefix)) {
+ JVMArgumentParser.parseOriginalArgs(jdkPrefix, endOfLine, oldLine, keepArguments, currentArguments);
+ return;
+ } else {
+ for (String prefix : keepingPrefixes) {
+ if (oldLine.trim().startsWith(prefix)) {
+ replaceMatrix.put(prefix, oldLine);
+ }
+ }
+ }
+ },
+ newLine -> {
+ if (newLine.trim().startsWith(jdkPrefix)) {
+ String result = JVMArgumentParser.parseNewLine(jdkPrefix, endOfLine, newLine, keepArguments, currentArguments);
+ return result;
+ } else {
+ for (String prefix : keepingPrefixes) {
+ if (newLine.trim().startsWith(prefix)) {
+ String originalLine = replaceMatrix.get(prefix);
+ return originalLine;
+ }
+ }
+ return newLine;
+ }
+ });
+ }
+
+ private void replaceLines(File tmpFile, File targetFile, File bkp, String... replacePairs) throws Exception {
+ doUpgrade(tmpFile, targetFile, bkp,
+ null,
+ newLine -> {
+ for (int i = 0; i < replacePairs.length; i += 2) {
+ if (newLine.trim().startsWith(replacePairs[i])) {
+ return replacePairs[i + 1];
+ }
+ }
+ return newLine;
+ });
+ }
+
private void upgrade(File tmpFile, File targetFile, File bkp, String... keepingPrefixes) throws Exception {
HashMap<String, String> replaceMatrix = new HashMap<>();
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/util/JVMArgumentParser.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/util/JVMArgumentParser.java
new file mode 100644
index 0000000..8b26a8b
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/util/JVMArgumentParser.java
@@ -0,0 +1,60 @@
+/*
+ * 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.util;
+
+import java.util.Map;
+
+public class JVMArgumentParser {
+
+ public static void parseOriginalArgs(String prefix, String endOfLine, String originalLine, String[] keepingPrefixes, Map<String, String> originalArgs) {
+ originalLine = originalLine.trim();
+ String line = originalLine.substring(prefix.length(), originalLine.length() - endOfLine.length());
+ String[] split = line.split(" ");
+ for (String s : split) {
+ for (String k : keepingPrefixes) {
+ if (s.startsWith(k)) {
+ originalArgs.put(k, s);
+ }
+ }
+ }
+ }
+
+ public static String parseNewLine(String prefix, String endOfLine, String newLine, String[] keepingPrefixes, Map<String, String> originalArgs) {
+ String spacesBeginning = newLine.substring(0, newLine.indexOf(prefix));
+ newLine = newLine.trim();
+ StringBuffer output = new StringBuffer();
+ String line = newLine.substring(prefix.length(), newLine.length() - endOfLine.length());
+ String[] split = line.split(" ");
+ for (String s : split) {
+ for (String k : keepingPrefixes) {
+ if (s.startsWith(k)) {
+ String value = originalArgs.get(k);
+ if (value != null) {
+ s = value;
+ }
+ break;
+ }
+ }
+ output.append(s);
+ output.append(" ");
+ }
+
+ return spacesBeginning + prefix + output + endOfLine;
+ }
+
+}
diff --git a/artemis-cli/src/test/java/org/apache/activemq/artemis/util/JVMArgumentTest.java b/artemis-cli/src/test/java/org/apache/activemq/artemis/util/JVMArgumentTest.java
new file mode 100644
index 0000000..7c8fe75
--- /dev/null
+++ b/artemis-cli/src/test/java/org/apache/activemq/artemis/util/JVMArgumentTest.java
@@ -0,0 +1,84 @@
+/*
+ * 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.util;
+
+import java.util.HashMap;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class JVMArgumentTest {
+
+ @Test
+ public void testArgumentsWindows() {
+ String arguments = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= -must-go -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms333M -Xmx77G -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE%)";
+
+ String prefix = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= ";
+
+ String[] fixedArguments = new String[]{"-Xmx", "-Xms"};
+
+ HashMap<String, String> usedArgs = new HashMap<>();
+ JVMArgumentParser.parseOriginalArgs(prefix, "\"", arguments, fixedArguments, usedArgs);
+ Assert.assertEquals(2, usedArgs.size());
+ Assert.assertEquals("-Xmx77G", usedArgs.get("-Xmx"));
+ Assert.assertEquals("-Xms333M", usedArgs.get("-Xms"));
+
+ String newLine = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx1G -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE%)";
+
+ String resultLine = JVMArgumentParser.parseNewLine(prefix, "\"", newLine, fixedArguments, usedArgs);
+
+ System.out.println("output::" + resultLine);
+
+ Assert.assertFalse(resultLine.contains("-must-go"));
+ Assert.assertTrue(resultLine.contains("-Xmx77G"));
+ Assert.assertTrue(resultLine.contains("-Xms333M"));
+ Assert.assertFalse(resultLine.contains("-Xmx1G"));
+ Assert.assertFalse(resultLine.contains("-Xmx512M"));
+ }
+
+
+ @Test
+ public void testArgumentsLinux() {
+ String arguments = " JAVA_ARGS=\"-must-go -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms333M -Xmx77G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml \"";
+
+ String prefix = "JAVA_ARGS=";
+
+ String[] fixedArguments = new String[]{"-Xmx", "-Xms"};
+
+ HashMap<String, String> usedArgs = new HashMap<>();
+ JVMArgumentParser.parseOriginalArgs(prefix, "\"", arguments, fixedArguments, usedArgs);
+ Assert.assertEquals(2, usedArgs.size());
+ Assert.assertEquals("-Xmx77G", usedArgs.get("-Xmx"));
+ Assert.assertEquals("-Xms333M", usedArgs.get("-Xms"));
+
+ String newLine = " JAVA_ARGS= -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx1G -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE%)";
+
+ String resultLine = JVMArgumentParser.parseNewLine(prefix, "\"", newLine, fixedArguments, usedArgs);
+
+ System.out.println("output::" + resultLine);
+
+ Assert.assertFalse(resultLine.contains("-must-go"));
+ Assert.assertTrue(resultLine.contains("-Xmx77G"));
+ Assert.assertTrue(resultLine.contains("-Xms333M"));
+ Assert.assertFalse(resultLine.contains("-Xmx1G"));
+ Assert.assertFalse(resultLine.contains("-Xmx512M"));
+
+ Assert.assertTrue(resultLine.startsWith(" "));
+ }
+
+}
diff --git a/tests/smoke-tests/pom.xml b/tests/smoke-tests/pom.xml
index f59550d..c34da04 100644
--- a/tests/smoke-tests/pom.xml
+++ b/tests/smoke-tests/pom.xml
@@ -1224,12 +1224,14 @@
</execution>
<execution>
<phase>test-compile</phase>
- <id>upgrade</id>
+ <id>upgrade-linux</id>
<goals>
<goal>upgrade</goal>
</goals>
<configuration>
- <instance>${basedir}/target/classes/servers/toUpgradeTest</instance>
+ <instance>${basedir}/target/classes/servers/linuxUpgrade</instance>
+ <!-- we don't pass the java memory argumnent on purpose,
+ as the upgrade should keep the relevant JVM arguments during the upgrade -->
</configuration>
</execution>
<execution>
@@ -1239,12 +1241,58 @@
<goal>upgrade</goal>
</goals>
<configuration>
- <instance>${basedir}/target/classes/servers/windows</instance>
+ <instance>${basedir}/target/classes/servers/windowsUpgrade</instance>
<args>
<arg>--windows</arg>
+ <!-- we don't pass the java memory argumnent on purpose,
+ as the upgrade should keep the relevant JVM arguments during the upgrade -->
</args>
</configuration>
</execution>
+ <execution>
+ <phase>test-compile</phase>
+ <id>createExpectedWindows</id>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ <configuration>
+ <allowAnonymous>true</allowAnonymous>
+ <instance>${basedir}/target/classes/servers/windowsUpgradeExpected</instance>
+ <noWeb>false</noWeb>
+ <role>amq</role>
+ <user>y</user>
+ <password>y</password>
+ <args>
+ <arg>--windows</arg>
+ <arg>--etc</arg>
+ <arg>${basedir}/target/classes/servers/windowsUpgradeETCExpected</arg>
+ <arg>--java-memory</arg>
+ <arg>1G</arg>
+ </args>
+ </configuration>
+ </execution>
+ <execution>
+ <phase>test-compile</phase>
+ <id>createExpectedLinux</id>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ <configuration>
+ <allowAnonymous>true</allowAnonymous>
+ <instance>${basedir}/target/classes/servers/linuxUpgradeExpected</instance>
+ <noWeb>false</noWeb>
+ <role>amq</role>
+ <user>y</user>
+ <password>y</password>
+ <args>
+ <arg>--etc</arg>
+ <arg>${basedir}/target/classes/servers/linuxUpgradeETCExpected</arg>
+ <arg>--java-memory</arg>
+ <arg>1G</arg>
+ </args>
+ </configuration>
+ </execution>
+
</executions>
<dependencies>
<dependency>
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeTest/bin/artemis b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgrade/bin/artemis
similarity index 98%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeTest/bin/artemis
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgrade/bin/artemis
index ebb92a0..05d7a0c 100755
--- a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeTest/bin/artemis
+++ b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgrade/bin/artemis
@@ -21,4 +21,4 @@
## the upgrade should keep this line in the new script
-ARTEMIS_INSTANCE_ETC='${project.basedir}/target/classes/servers/toUpgradeETC'
+ARTEMIS_INSTANCE_ETC='${project.basedir}/target/classes/servers/linuxUpgradeETC'
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeTest/bin/artemis-service b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgrade/bin/artemis-service
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeTest/bin/artemis-service
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgrade/bin/artemis-service
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis-roles.properties b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/artemis-roles.properties
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis-roles.properties
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/artemis-roles.properties
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis-users.properties b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/artemis-users.properties
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis-users.properties
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/artemis-users.properties
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis.profile b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/artemis.profile
similarity index 88%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis.profile
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/artemis.profile
index 4f0539b..c7f498a 100644
--- a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis.profile
+++ b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/artemis.profile
@@ -16,16 +16,16 @@
# under the License.
ARTEMIS_HOME='must-change'
-ARTEMIS_INSTANCE='${project.basedir}/target/classes/servers/toUpgradeTest'
-ARTEMIS_DATA_DIR='${project.basedir}/target/classes/servers/toUpgradeTest/data'
-ARTEMIS_ETC_DIR='${project.basedir}/target/classes/servers/toUpgradeETC'
-ARTEMIS_OOME_DUMP='${project.basedir}/target/classes/servers/toUpgradeTest/log/oom_dump.hprof'
+ARTEMIS_INSTANCE='${project.basedir}/target/classes/servers/linuxUpgrade'
+ARTEMIS_DATA_DIR='${project.basedir}/target/classes/servers/linuxUpgrade/data'
+ARTEMIS_ETC_DIR='${project.basedir}/target/classes/servers/linuxUpgradeETC'
+ARTEMIS_OOME_DUMP='${project.basedir}/target/classes/servers/linuxUpgrade/log/oom_dump.hprof'
# The logging config will need an URI
# this will be encoded in case you use spaces or special characters
# on your directory structure
-ARTEMIS_INSTANCE_URI='file:${project.basedir}/target/classes/servers/toUpgradeTest'
-ARTEMIS_INSTANCE_ETC_URI='file:${project.basedir}/target/classes/servers/toUpgradeETC'
+ARTEMIS_INSTANCE_URI='file:${project.basedir}/target/classes/servers/linuxUpgrade/'
+ARTEMIS_INSTANCE_ETC_URI='file:${project.basedir}/target/classes/servers/linuxUpgradeETC/'
# Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
#ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446"
@@ -39,7 +39,7 @@
if [ -z "$JAVA_ARGS" ]; then
#### I am adding a customization to the JAVA-ARGS that would be replaced
#### If this line is seen on the upgrade it means that things are not working
- JAVA_ARGS="-should-not-work -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml "
+ JAVA_ARGS="-should-not-work -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx1G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml "
fi
# Uncomment to enable logging for Safepoint JVM pauses
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/bootstrap.xml b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/bootstrap.xml
similarity index 97%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/bootstrap.xml
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/bootstrap.xml
index c16bcf9..3908e3b 100644
--- a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/bootstrap.xml
+++ b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/bootstrap.xml
@@ -23,7 +23,7 @@
<!-- artemis.URI.instance is parsed from artemis.instance by the CLI startup.
This is to avoid situations where you could have spaces or special characters on this URI -->
- <server configuration="file:${project.basedir}/target/classes/servers/toUpgradeETC/broker.xml"/>
+ <server configuration="file:${project.basedir}/target/classes/servers/linuxUpgradeETC//broker.xml"/>
<!-- The web server is only bound to localhost by default -->
<web path="web">
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/broker.xml b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/broker.xml
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/broker.xml
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/broker.xml
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/jolokia-access.xml b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/jolokia-access.xml
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/jolokia-access.xml
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/jolokia-access.xml
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/logging.properties b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/logging.properties
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/logging.properties
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/logging.properties
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/login.config b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/login.config
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/login.config
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/login.config
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/management.xml b/tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/management.xml
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/management.xml
rename to tests/smoke-tests/src/main/filtered-resources/servers/linuxUpgradeETC/management.xml
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/artemis-roles.properties b/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/artemis-roles.properties
deleted file mode 100644
index ee6feea..0000000
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/artemis-roles.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-amq = y
\ No newline at end of file
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/bootstrap.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/bootstrap.xml
deleted file mode 100644
index 9576de7..0000000
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/bootstrap.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- ~ 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.
- -->
-
-<broker xmlns="http://activemq.apache.org/schema">
-
- <jaas-security domain="activemq"/>
-
-
- <!-- artemis.URI.instance is parsed from artemis.instance by the CLI startup.
- This is to avoid situations where you could have spaces or special characters on this URI -->
- <server configuration="file:/no-change/broker.xml"/>
-
- <!-- The web server is only bound to localhost by default -->
- <web path="web" rootRedirectLocation="console">
- <binding uri="http://localhost:8161">
- <app url="activemq-branding" war="activemq-branding.war"/>
- <app url="artemis-plugin" war="artemis-plugin.war"/>
- <app url="console" war="console.war"/>
- </binding>
- </web>
-
-
-</broker>
-
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/broker.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/broker.xml
deleted file mode 100644
index c88da8e..0000000
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/broker.xml
+++ /dev/null
@@ -1,254 +0,0 @@
-<?xml version='1.0'?>
-<!--
-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.
--->
-
-<configuration xmlns="urn:activemq"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
-
- <core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:activemq:core ">
-
- <name>0.0.0.0</name>
-
-
- <persistence-enabled>true</persistence-enabled>
-
- <!-- this could be ASYNCIO, MAPPED, NIO
- ASYNCIO: Linux Libaio
- MAPPED: mmap files
- NIO: Plain Java Files
- -->
- <journal-type>NIO</journal-type>
-
- <paging-directory>data/paging</paging-directory>
-
- <bindings-directory>data/bindings</bindings-directory>
-
- <journal-directory>data/journal</journal-directory>
-
- <large-messages-directory>data/large-messages</large-messages-directory>
-
-
- <!-- if you want to retain your journal uncomment this following configuration.
-
- This will allow your system to keep 7 days of your data, up to 10G. Tweak it accordingly to your use case and capacity.
-
- it is recommended to use a separate storage unit from the journal for performance considerations.
-
- <journal-retention-directory period="7" unit="DAYS" storage-limit="10G">data/retention</journal-retention-directory>
-
- You can also enable retention by using the argument journal-retention on the `artemis create` command -->
-
-
-
- <journal-datasync>true</journal-datasync>
-
- <journal-min-files>2</journal-min-files>
-
- <journal-pool-files>10</journal-pool-files>
-
- <journal-device-block-size>4096</journal-device-block-size>
-
- <journal-file-size>10M</journal-file-size>
- <!--
- You can verify the network health of a particular NIC by specifying the <network-check-NIC> element.
- <network-check-NIC>theNicName</network-check-NIC>
- -->
-
- <!--
- Use this to use an HTTP server to validate the network
- <network-check-URL-list>http://www.apache.org</network-check-URL-list> -->
-
- <!-- <network-check-period>10000</network-check-period> -->
- <!-- <network-check-timeout>1000</network-check-timeout> -->
-
- <!-- this is a comma separated list, no spaces, just DNS or IPs
- it should accept IPV6
-
- Warning: Make sure you understand your network topology as this is meant to validate if your network is valid.
- Using IPs that could eventually disappear or be partially visible may defeat the purpose.
- You can use a list of multiple IPs, and if any successful ping will make the server OK to continue running -->
- <!-- <network-check-list>10.0.0.1</network-check-list> -->
-
- <!-- use this to customize the ping used for ipv4 addresses -->
- <!-- <network-check-ping-command>ping -c 1 -t %d %s</network-check-ping-command> -->
-
- <!-- use this to customize the ping used for ipv6 addresses -->
- <!-- <network-check-ping6-command>ping6 -c 1 %2$s</network-check-ping6-command> -->
-
-
-
-
- <!-- how often we are looking for how many bytes are being used on the disk in ms -->
- <disk-scan-period>5000</disk-scan-period>
-
- <!-- once the disk hits this limit the system will block, or close the connection in certain protocols
- that won't support flow control. -->
- <max-disk-usage>90</max-disk-usage>
-
- <!-- should the broker detect dead locks and other issues -->
- <critical-analyzer>true</critical-analyzer>
-
- <critical-analyzer-timeout>120000</critical-analyzer-timeout>
-
- <critical-analyzer-check-period>60000</critical-analyzer-check-period>
-
- <critical-analyzer-policy>HALT</critical-analyzer-policy>
-
-
-
- <!-- the system will enter into page mode once you hit this limit. This is an estimate in bytes of how much the messages are using in memory
-
- The system will use half of the available memory (-Xmx) by default for the global-max-size.
- You may specify a different value here if you need to customize it to your needs.
-
- <global-max-size>100Mb</global-max-size> -->
-
- <!-- the maximum number of messages accepted before entering full address mode.
- if global-max-size is specified the full address mode will be specified by whatever hits it first. -->
- <global-max-messages>-1</global-max-messages>
-
- <acceptors>
-
- <!-- useEpoll means: it will use Netty epoll if you are on a system (Linux) that supports it -->
- <!-- amqpCredits: The number of credits sent to AMQP producers -->
- <!-- amqpLowCredits: The server will send the # credits specified at amqpCredits at this low mark -->
- <!-- amqpDuplicateDetection: If you are not using duplicate detection, set this to false
- as duplicate detection requires applicationProperties to be parsed on the server. -->
- <!-- amqpMinLargeMessageSize: Determines how many bytes are considered large, so we start using files to hold their data.
- default: 102400, -1 would mean to disable large mesasge control -->
-
- <!-- Note: If an acceptor needs to be compatible with HornetQ and/or Artemis 1.x clients add
- "anycastPrefix=jms.queue.;multicastPrefix=jms.topic." to the acceptor url.
- See https://issues.apache.org/jira/browse/ARTEMIS-1644 for more information. -->
-
-
- <!-- Acceptor for every supported protocol -->
- <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true;supportAdvisory=false;suppressInternalManagementObjects=false</acceptor>
-
- <!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.-->
- <acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true</acceptor>
-
- <!-- STOMP Acceptor. -->
- <acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>
-
- <!-- HornetQ Compatibility Acceptor. Enables HornetQ Core and STOMP for legacy HornetQ clients. -->
- <acceptor name="hornetq">tcp://0.0.0.0:5445?anycastPrefix=jms.queue.;multicastPrefix=jms.topic.;protocols=HORNETQ,STOMP;useEpoll=true</acceptor>
-
- <!-- MQTT Acceptor -->
- <acceptor name="mqtt">tcp://0.0.0.0:1883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>
-
- </acceptors>
-
-
- <security-settings>
- <security-setting match="#">
- <permission type="createNonDurableQueue" roles="amq"/>
- <permission type="deleteNonDurableQueue" roles="amq"/>
- <permission type="createDurableQueue" roles="amq"/>
- <permission type="deleteDurableQueue" roles="amq"/>
- <permission type="createAddress" roles="amq"/>
- <permission type="deleteAddress" roles="amq"/>
- <permission type="consume" roles="amq"/>
- <permission type="browse" roles="amq"/>
- <permission type="send" roles="amq"/>
- <!-- we need this otherwise ./artemis data imp wouldn't work -->
- <permission type="manage" roles="amq"/>
- </security-setting>
- </security-settings>
-
- <address-settings>
- <!-- if you define auto-create on certain queues, management has to be auto-create -->
- <address-setting match="activemq.management#">
- <dead-letter-address>DLQ</dead-letter-address>
- <expiry-address>ExpiryQueue</expiry-address>
- <redelivery-delay>0</redelivery-delay>
- <!-- with -1 only the global-max-size is in use for limiting -->
- <max-size-bytes>-1</max-size-bytes>
- <message-counter-history-day-limit>10</message-counter-history-day-limit>
- <address-full-policy>PAGE</address-full-policy>
- <auto-create-queues>true</auto-create-queues>
- <auto-create-addresses>true</auto-create-addresses>
- </address-setting>
- <!--default for catch all-->
- <address-setting match="#">
- <dead-letter-address>DLQ</dead-letter-address>
- <expiry-address>ExpiryQueue</expiry-address>
- <redelivery-delay>0</redelivery-delay>
-
- <!-- if max-size-bytes and max-size-messages were both enabled, the system will enter into paging
- based on the first attribute to hits the maximum value -->
- <!-- limit for the address in bytes, -1 means unlimited -->
- <max-size-bytes>-1</max-size-bytes>
-
- <!-- limit for the address in messages, -1 means unlimited -->
- <max-size-messages>-1</max-size-messages>
-
- <!-- the size of each file on paging. Notice we keep files in memory while they are in use.
- Lower this setting if you have too many queues in memory. -->
- <page-size-bytes>10M</page-size-bytes>
-
- <!-- limit how many messages are read from paging into the Queue. -->
- <max-read-page-messages>-1</max-read-page-messages>
-
- <!-- limit how much memory is read from paging into the Queue. -->
- <max-read-page-bytes>20M</max-read-page-bytes>
-
- <message-counter-history-day-limit>10</message-counter-history-day-limit>
- <address-full-policy>PAGE</address-full-policy>
- <auto-create-queues>true</auto-create-queues>
- <auto-create-addresses>true</auto-create-addresses>
- <auto-delete-queues>false</auto-delete-queues>
- <auto-delete-addresses>false</auto-delete-addresses>
- </address-setting>
- </address-settings>
-
- <addresses>
- <address name="DLQ">
- <anycast>
- <queue name="DLQ" />
- </anycast>
- </address>
- <address name="ExpiryQueue">
- <anycast>
- <queue name="ExpiryQueue" />
- </anycast>
- </address>
-
- </addresses>
-
-
- <!-- Uncomment the following if you want to use the Standard LoggingActiveMQServerPlugin pluging to log in events
- <broker-plugins>
- <broker-plugin class-name="org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin">
- <property key="LOG_ALL_EVENTS" value="true"/>
- <property key="LOG_CONNECTION_EVENTS" value="true"/>
- <property key="LOG_SESSION_EVENTS" value="true"/>
- <property key="LOG_CONSUMER_EVENTS" value="true"/>
- <property key="LOG_DELIVERING_EVENTS" value="true"/>
- <property key="LOG_SENDING_EVENTS" value="true"/>
- <property key="LOG_INTERNAL_EVENTS" value="true"/>
- </broker-plugin>
- </broker-plugins>
- -->
-
- </core>
-</configuration>
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/jolokia-access.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/jolokia-access.xml
deleted file mode 100644
index 679523f..0000000
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/jolokia-access.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-
-<!-- This policy file controls the Jolokia JMX-HTTP bridge security options for the web console.
- see: https://jolokia.org/reference/html/security.html -->
-<restrict>
-
- <cors>
- <!-- Allow cross origin access from localhost ... -->
- <allow-origin>*://localhost*</allow-origin>
-
-
- <!-- Options from this point on are auto-generated by Create.java from the Artemis CLI -->
- <!-- Check for the proper origin on the server side, too -->
- <strict-checking/>
- </cors>
-
-</restrict>
\ No newline at end of file
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/logging.properties b/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/logging.properties
deleted file mode 100644
index 97980b9..0000000
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/logging.properties
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# 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.
-#
-
-# Additional logger names to configure (root logger is always configured)
-# Root logger option
-loggers=org.eclipse.jetty,org.jboss.logging,org.apache.activemq.artemis.core.server,org.apache.activemq.artemis.utils,org.apache.activemq.artemis.utils.critical,org.apache.activemq.artemis.journal,org.apache.activemq.artemis.jms.server,org.apache.activemq.artemis.integration.bootstrap,org.apache.activemq.audit.base,org.apache.activemq.audit.message,org.apache.activemq.audit.resource,org.apache.curator,org.apache.zookeeper
-
-# Root logger level
-logger.level=INFO
-# ActiveMQ Artemis logger levels
-logger.org.apache.activemq.artemis.core.server.level=INFO
-logger.org.apache.activemq.artemis.journal.level=INFO
-logger.org.apache.activemq.artemis.utils.level=INFO
-
-# if you have issues with CriticalAnalyzer, setting this as TRACE would give you extra troubleshooting information.
-# but do not use it regularly as it would incur in some extra CPU usage for this diagnostic.
-logger.org.apache.activemq.artemis.utils.critical.level=INFO
-
-logger.org.apache.activemq.artemis.jms.level=INFO
-logger.org.apache.activemq.artemis.integration.bootstrap.level=INFO
-logger.org.eclipse.jetty.level=WARN
-# Root logger handlers
-logger.handlers=FILE,CONSOLE
-
-# quorum logger levels
-logger.org.apache.curator.level=WARN
-logger.org.apache.zookeeper.level=ERROR
-
-# to enable audit change the level to INFO
-logger.org.apache.activemq.audit.base.level=ERROR
-logger.org.apache.activemq.audit.base.handlers=AUDIT_FILE
-logger.org.apache.activemq.audit.base.useParentHandlers=false
-
-logger.org.apache.activemq.audit.resource.level=ERROR
-logger.org.apache.activemq.audit.resource.handlers=AUDIT_FILE
-logger.org.apache.activemq.audit.resource.useParentHandlers=false
-
-logger.org.apache.activemq.audit.message.level=ERROR
-logger.org.apache.activemq.audit.message.handlers=AUDIT_FILE
-logger.org.apache.activemq.audit.message.useParentHandlers=false
-
-# Console handler configuration
-handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
-handler.CONSOLE.properties=autoFlush
-handler.CONSOLE.level=DEBUG
-handler.CONSOLE.autoFlush=true
-handler.CONSOLE.formatter=PATTERN
-
-# File handler configuration
-handler.FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
-handler.FILE.level=DEBUG
-handler.FILE.properties=suffix,append,autoFlush,fileName
-handler.FILE.suffix=.yyyy-MM-dd
-handler.FILE.append=true
-handler.FILE.autoFlush=true
-handler.FILE.fileName=${artemis.instance}/log/artemis.log
-handler.FILE.formatter=PATTERN
-
-# Formatter pattern configuration
-formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
-formatter.PATTERN.properties=pattern
-formatter.PATTERN.pattern=%d %-5p [%c] %s%E%n
-
-#Audit logger
-handler.AUDIT_FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
-handler.AUDIT_FILE.level=INFO
-handler.AUDIT_FILE.properties=suffix,append,autoFlush,fileName
-handler.AUDIT_FILE.suffix=.yyyy-MM-dd
-handler.AUDIT_FILE.append=true
-handler.AUDIT_FILE.autoFlush=true
-handler.AUDIT_FILE.fileName=${artemis.instance}/log/audit.log
-handler.AUDIT_FILE.formatter=AUDIT_PATTERN
-
-formatter.AUDIT_PATTERN=org.jboss.logmanager.formatters.PatternFormatter
-formatter.AUDIT_PATTERN.properties=pattern
-formatter.AUDIT_PATTERN.pattern=%d [AUDIT](%t) %s%E%n
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/login.config b/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/login.config
deleted file mode 100644
index bcdf928..0000000
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/login.config
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.
- */
-
-activemq {
- org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule sufficient
- debug=false
- reload=true
- org.apache.activemq.jaas.properties.user="artemis-users.properties"
- org.apache.activemq.jaas.properties.role="artemis-roles.properties";
-
- org.apache.activemq.artemis.spi.core.security.jaas.GuestLoginModule sufficient
- debug=false
- org.apache.activemq.jaas.guest.user="y"
- org.apache.activemq.jaas.guest.role="amq";
-};
\ No newline at end of file
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/management.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/management.xml
deleted file mode 100644
index 002ee95..0000000
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/management.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- ~ 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.
- -->
-<management-context xmlns="http://activemq.apache.org/schema">
- <!--<connector connector-port="1099"/>-->
- <authorisation>
- <allowlist>
- <entry domain="hawtio"/>
- </allowlist>
- <default-access>
- <access method="list*" roles="amq"/>
- <access method="get*" roles="amq"/>
- <access method="is*" roles="amq"/>
- <access method="set*" roles="amq"/>
- <access method="*" roles="amq"/>
- </default-access>
- <role-access>
- <match domain="org.apache.activemq.artemis">
- <access method="list*" roles="amq"/>
- <access method="get*" roles="amq"/>
- <access method="is*" roles="amq"/>
- <access method="set*" roles="amq"/>
- <!-- Note count and browse are need to access the browse tab in the console-->
- <access method="browse*" roles="amq"/>
- <access method="count*" roles="amq"/>
- <access method="*" roles="amq"/>
- </match>
- <!--example of how to configure a specific object-->
- <!--<match domain="org.apache.activemq.artemis" key="subcomponent=queues">
- <access method="list*" roles="view,update,amq"/>
- <access method="get*" roles="view,update,amq"/>
- <access method="is*" roles="view,update,amq"/>
- <access method="set*" roles="update,amq"/>
- <access method="*" roles="amq"/>
- </match>-->
- </role-access>
- </authorisation>
-</management-context>
\ No newline at end of file
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windows/bin/artemis-service.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgrade/bin/artemis-service.xml
similarity index 85%
rename from tests/smoke-tests/src/main/filtered-resources/servers/windows/bin/artemis-service.xml
rename to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgrade/bin/artemis-service.xml
index e31e8db..f1cb1ca 100644
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windows/bin/artemis-service.xml
+++ b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgrade/bin/artemis-service.xml
@@ -18,18 +18,18 @@
-->
<service>
- <id>artemis-windows-0.0.0.0</id>
- <name>ActiveMQ Artemis: windows @ 0.0.0.0</name>
+ <id>artemis-windowsUpgrade-0.0.0.0</id>
+ <name>ActiveMQ Artemis: windowsUpgrade @ 0.0.0.0</name>
<description>Apache ActiveMQ Artemis is a reliable messaging broker</description>
<env name="ARTEMIS_HOME" value="must-change"/>
- <env name="ARTEMIS_INSTANCE" value="no-change"/>
- <env name="ARTEMIS_INSTANCE_ETC" value="${project.basedir}/target/classes/servers/windowsETC"/>
- <env name="ARTEMIS_INSTANCE_URI" value="file:/no-change"/>
- <env name="ARTEMIS_INSTANCE_ETC_URI" value="file:${project.basedir}/target/classes/servers/windowsETC"/>
- <env name="ARTEMIS_DATA_DIR" value="no-change"/>
+ <env name="ARTEMIS_INSTANCE" value="${project.basedir}/target/classes/servers/windowsUpgrade"/>
+ <env name="ARTEMIS_INSTANCE_ETC" value="${project.basedir}/target/classes/servers/windowsUpgradeETC"/>
+ <env name="ARTEMIS_INSTANCE_URI" value="file:${project.basedir}/target/classes/servers/windowsUpgrade/"/>
+ <env name="ARTEMIS_INSTANCE_ETC_URI" value="file:${project.basedir}/target/classes/servers/windowsUpgradeETC/"/>
+ <env name="ARTEMIS_DATA_DIR" value="${project.basedir}/target/classes/servers/windowsUpgrade/data"/>
- <logpath>/must-be/servers/windows\log</logpath>
+ <logpath>${project.basedir}/target/classes/servers/windowsUpgrade\log</logpath>
<logmode>roll</logmode>
<executable>%JAVA_HOME%\bin\java.exe</executable>
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windows/bin/artemis.cmd b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgrade/bin/artemis.cmd
similarity index 98%
rename from tests/smoke-tests/src/main/filtered-resources/servers/windows/bin/artemis.cmd
rename to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgrade/bin/artemis.cmd
index 2996756..12b6206 100644
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windows/bin/artemis.cmd
+++ b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgrade/bin/artemis.cmd
@@ -45,7 +45,7 @@
:RUN_JAVA
rem "Load Profile Config"
-set ARTEMIS_INSTANCE_ETC="${project.basedir}/target/classes/servers/windowsETC"
+set ARTEMIS_INSTANCE_ETC="${project.basedir}/target/classes/servers/windowsUpgradeETC"
call %ARTEMIS_INSTANCE_ETC%\artemis.profile.cmd %*
if not exist %ARTEMIS_OOME_DUMP% goto NO_ARTEMIS_OOME_DUMP
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis-roles.properties b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/artemis-roles.properties
similarity index 100%
copy from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/artemis-roles.properties
copy to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/artemis-roles.properties
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/artemis-users.properties b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/artemis-users.properties
similarity index 100%
rename from tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/artemis-users.properties
rename to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/artemis-users.properties
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/artemis.profile.cmd b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/artemis.profile.cmd
similarity index 82%
rename from tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/artemis.profile.cmd
rename to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/artemis.profile.cmd
index 0ea79ca..7359abf 100644
--- a/tests/smoke-tests/src/main/filtered-resources/servers/windowsETC/artemis.profile.cmd
+++ b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/artemis.profile.cmd
@@ -17,23 +17,23 @@
rem under the License.
set ARTEMIS_HOME="must-change"
-set ARTEMIS_INSTANCE="no-change"
-set ARTEMIS_DATA_DIR="no-change"
-set ARTEMIS_ETC_DIR="no-change"
-set ARTEMIS_OOME_DUMP="no-change"
+set ARTEMIS_INSTANCE="${project.basedir}/target/classes/servers/windowsUpgrade"
+set ARTEMIS_DATA_DIR="${project.basedir}/target/classes/servers/windowsUpgrade/data"
+set ARTEMIS_ETC_DIR="${project.basedir}/target/classes/servers/windowsUpgradeETC"
+set ARTEMIS_OOME_DUMP="${project.basedir}/target/classes/servers/windowsUpgrade/log/oom_dump.hprof"
rem The logging config will need an URI
rem this will be encoded in case you use spaces or special characters
rem on your directory structure
-set ARTEMIS_INSTANCE_URI="file:/no-change/"
-set ARTEMIS_INSTANCE_ETC_URI="file:/no-change/"
+set ARTEMIS_INSTANCE_URI="file:${project.basedir}/target/classes/servers/windowsUpgrade/"
+set ARTEMIS_INSTANCE_ETC_URI="file:${project.basedir}/target/classes/servers/windowsUpgradeETC/"
rem Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
rem set ARTEMIS_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446
rem Java Opts
-IF "%JAVA_ARGS%"=="" (set JAVA_ARGS= -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE%)
+IF "%JAVA_ARGS%"=="" (set JAVA_ARGS= -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx1G -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE%)
rem Logs Safepoints JVM pauses: Uncomment to enable them
rem In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause that could
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/bootstrap.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/bootstrap.xml
similarity index 94%
copy from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/bootstrap.xml
copy to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/bootstrap.xml
index c16bcf9..1ce4c13 100644
--- a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/bootstrap.xml
+++ b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/bootstrap.xml
@@ -23,10 +23,10 @@
<!-- artemis.URI.instance is parsed from artemis.instance by the CLI startup.
This is to avoid situations where you could have spaces or special characters on this URI -->
- <server configuration="file:${project.basedir}/target/classes/servers/toUpgradeETC/broker.xml"/>
+ <server configuration="file:${project.basedir}/target/classes/servers/windowsUpgradeETC//broker.xml"/>
<!-- The web server is only bound to localhost by default -->
- <web path="web">
+ <web path="web" rootRedirectLocation="console">
<binding uri="http://localhost:8161">
<app url="activemq-branding" war="activemq-branding.war"/>
<app url="artemis-plugin" war="artemis-plugin.war"/>
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/broker.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/broker.xml
similarity index 100%
copy from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/broker.xml
copy to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/broker.xml
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/jolokia-access.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/jolokia-access.xml
similarity index 100%
copy from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/jolokia-access.xml
copy to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/jolokia-access.xml
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/logging.properties b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/logging.properties
similarity index 100%
copy from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/logging.properties
copy to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/logging.properties
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/login.config b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/login.config
similarity index 100%
copy from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/login.config
copy to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/login.config
diff --git a/tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/management.xml b/tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/management.xml
similarity index 100%
copy from tests/smoke-tests/src/main/filtered-resources/servers/toUpgradeETC/management.xml
copy to tests/smoke-tests/src/main/filtered-resources/servers/windowsUpgradeETC/management.xml
diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/CompareUpgradeTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/CompareUpgradeTest.java
index 5f43ca2..b287c6a 100644
--- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/CompareUpgradeTest.java
+++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/CompareUpgradeTest.java
@@ -21,6 +21,7 @@
import java.lang.invoke.MethodHandles;
import java.nio.file.Files;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import java.util.stream.Stream;
@@ -36,18 +37,98 @@
public static final String basedir = System.getProperty("basedir");
+
+ @Test
+ public void testCompareWindowsFreshInstance() throws Exception {
+ String windows = basedir + "/target/classes/servers/windowsUpgrade";
+ String windowsBin = windows + "/bin";
+ String windowsETC = basedir + "/target/classes/servers/windowsUpgradeETC";
+
+ String windowsExpected = basedir + "/target/classes/servers/windowsUpgradeExpected";
+ String windowsExpectedBin = windowsExpected + "/bin";
+ String windowsExpectedETC = basedir + "/target/classes/servers/windowsUpgradeETCExpected";
+
+ compareDirectories(windowsExpectedBin, windowsBin);
+ compareDirectories(windowsExpectedETC, windowsETC, "broker.xml", "artemis-users.properties");
+ }
+
+ @Test
+ public void testCompareLinuxFreshInstance() throws Exception {
+ String linux = basedir + "/target/classes/servers/linuxUpgrade";
+ String linuxBin = linux + "/bin";
+ String linuxETC = basedir + "/target/classes/servers/linuxUpgradeETC";
+
+ String linuxExpected = basedir + "/target/classes/servers/linuxUpgradeExpected";
+ String linuxExpectedBin = linuxExpected + "/bin";
+ String linuxExpectedETC = basedir + "/target/classes/servers/linuxUpgradeETCExpected";
+
+ compareDirectories(linuxExpectedBin, linuxBin);
+ compareDirectories(linuxExpectedETC, linuxETC, "broker.xml", "artemis-users.properties");
+ }
+
+
+ private void compareDirectories(String expectedFolder, String upgradeFolder, String... ignoredFiles) throws Exception {
+ File expectedFolderFile = new File(expectedFolder);
+ File[] foundFiles = expectedFolderFile.listFiles(pathname -> {
+ for (String i :ignoredFiles) {
+ if (pathname.getName().contains(i)) {
+ return false;
+ }
+ }
+ return true;
+ });
+
+
+ File upgradeFolderFile = new File(upgradeFolder);
+
+ for (File f : foundFiles) {
+ File upgradeFile = new File(upgradeFolderFile, f.getName());
+ if (!upgradeFile.exists()) {
+ Assert.fail(upgradeFile.getAbsolutePath() + " not does exist");
+ }
+
+
+ if (f.getName().endsWith(".exe")) {
+ Assert.assertArrayEquals(f.getName() + " is different after upgrade", Files.readAllBytes(f.toPath()), Files.readAllBytes(upgradeFile.toPath()));
+ } else {
+ try (Stream<String> expectedStream = Files.lines(f.toPath()); Stream<String> upgradeStream = Files.lines(upgradeFile.toPath())) {
+
+ Iterator<String> expectedIterator = expectedStream.iterator();
+ Iterator<String> upgradeIterator = upgradeStream.iterator();
+
+ int line = 1;
+
+ while (expectedIterator.hasNext()) {
+ Assert.assertTrue(upgradeIterator.hasNext());
+
+ String expectedString = expectedIterator.next().replace("Expected", "").trim();
+ String upgradeString = upgradeIterator.next().trim();
+ Assert.assertEquals("error on line " + line + " at " + upgradeFile, expectedString, upgradeString);
+ line++;
+ }
+
+ Assert.assertFalse(upgradeIterator.hasNext());
+ }
+ }
+ }
+
+
+
+ }
+
@Test
public void testWindows() throws Exception {
- String windowsBin = basedir + "/target/classes/servers/windows/bin";
- String windowsETC = basedir + "/target/classes/servers/windowsETC";
+ String windows = basedir + "/target/classes/servers/windowsUpgrade";
+ String windowsBin = windows + "/bin";
+ String windowsETC = basedir + "/target/classes/servers/windowsUpgradeETC";
checkExpectedValues(windowsBin + "/artemis.cmd", "set ARTEMIS_INSTANCE_ETC=", "\"" + windowsETC + "\"");
Map<String, String> result = checkExpectedValues(windowsBin + "/artemis-service.xml",
"<env name=\"ARTEMIS_HOME\" value=", null, // no expected value for this, we will check on the output
- "<env name=\"ARTEMIS_INSTANCE\" value=", "\"no-change\"/>",
+ "<env name=\"ARTEMIS_INSTANCE\" value=", "\"" + windows + "\"/>",
"<env name=\"ARTEMIS_INSTANCE_ETC\" value=", "\"" + windowsETC + "\"/>",
- "<env name=\"ARTEMIS_INSTANCE_URI\" value=", "\"file:/no-change\"/>",
- "<env name=\"ARTEMIS_DATA_DIR\" value=", "\"no-change\"/>"
+ "<env name=\"ARTEMIS_INSTANCE_URI\" value=", "\"file:" + windows + "/\"/>",
+ "<env name=\"ARTEMIS_DATA_DIR\" value=", "\"" + windows + "/data\"/>"
);
String home = result.get("<env name=\"ARTEMIS_HOME\" value=");
@@ -56,19 +137,19 @@
result = checkExpectedValues(windowsETC + "/artemis.profile.cmd",
"set ARTEMIS_HOME=", null, // no expected value for this, we will check on the output
- "set ARTEMIS_INSTANCE=", "\"no-change\"",
- "set ARTEMIS_DATA_DIR=", "\"no-change\"",
- "set ARTEMIS_ETC_DIR=", "\"no-change\"",
- "set ARTEMIS_OOME_DUMP=", "\"no-change\"",
- "set ARTEMIS_INSTANCE_URI=", "\"file:/no-change/\"",
- "set ARTEMIS_INSTANCE_ETC_URI=", "\"file:/no-change/\"");
+ "set ARTEMIS_INSTANCE=", "\"" + windows + "\"",
+ "set ARTEMIS_DATA_DIR=","\"" + windows + "/data\"",
+ "set ARTEMIS_ETC_DIR=", "\"" + windowsETC + "\"",
+ "set ARTEMIS_OOME_DUMP=", "\"" + windows + "/log/oom_dump.hprof\"",
+ "set ARTEMIS_INSTANCE_URI=", "\"file:" + windows + "/\"",
+ "set ARTEMIS_INSTANCE_ETC_URI=", "\"file:" + windowsETC + "/\"");
home = result.get("set ARTEMIS_HOME=");
Assert.assertNotNull(home);
Assert.assertFalse("home value must be changed during upgrade", home.contains("must-change"));
checkExpectedValues(windowsETC + "/bootstrap.xml",
- "<server configuration=", "\"file:/no-change/broker.xml\"/>");
+ "<server configuration=", "\"file:" + windowsETC + "//broker.xml\"/>");
File oldLogging = new File(windowsETC + "/logging.properties");
File newLogging = new File(windowsETC + "/log4j2.properties");
@@ -81,9 +162,9 @@
@Test
public void testLinux() throws Exception {
- String instanceDir = basedir + "/target/classes/servers/toUpgradeTest";
+ String instanceDir = basedir + "/target/classes/servers/linuxUpgrade";
String bin = instanceDir + "/bin";
- String etc = basedir + "/target/classes/servers/toUpgradeETC";
+ String etc = basedir + "/target/classes/servers/linuxUpgradeETC";
checkExpectedValues(bin + "/artemis", "ARTEMIS_INSTANCE_ETC=", "'" + etc + "'");
@@ -93,8 +174,8 @@
"ARTEMIS_DATA_DIR=", "'" + instanceDir + "/data'",
"ARTEMIS_ETC_DIR=", "'" + etc + "'",
"ARTEMIS_OOME_DUMP=", "'" + instanceDir + "/log/oom_dump.hprof'",
- "ARTEMIS_INSTANCE_URI=", "'file:" + instanceDir + "'",
- "ARTEMIS_INSTANCE_ETC_URI=", "'file:" + etc + "'");
+ "ARTEMIS_INSTANCE_URI=", "'file:" + instanceDir + "/'",
+ "ARTEMIS_INSTANCE_ETC_URI=", "'file:" + etc + "/'");
String home = result.get("ARTEMIS_HOME=");
Assert.assertNotNull(home);
diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/UpgradeTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/UpgradeTest.java
index 7550131..4936d1c 100644
--- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/UpgradeTest.java
+++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/UpgradeTest.java
@@ -42,7 +42,7 @@
@Before
public void beforeTest() throws Exception {
- upgradedServer = new File(basedir + "/target/classes/servers/toUpgradeTest");
+ upgradedServer = new File(basedir + "/target/classes/servers/linuxUpgrade");
deleteDirectory(new File(upgradedServer, "data"));
deleteDirectory(new File(upgradedServer, "log"));