clebertsuconic commented on code in PR #5145:
URL: https://github.com/apache/activemq-artemis/pull/5145#discussion_r1715300521


##########
tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/realServer/RolledUpgradeTest.java:
##########
@@ -0,0 +1,295 @@
+/*
+ * 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.tests.compatibility.realServer;
+
+import java.io.File;
+import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.artemis.api.core.Pair;
+import org.apache.activemq.artemis.api.core.management.SimpleManagement;
+import org.apache.activemq.artemis.util.ServerUtil;
+import org.apache.activemq.artemis.utils.FileUtil;
+import org.apache.activemq.artemis.utils.SpawnedVMSupport;
+import org.apache.activemq.artemis.utils.Wait;
+import org.apache.activemq.artemis.utils.cli.helper.HelperBase;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RolledUpgradeTest extends CompatBaseTest {
+
+   private static final Logger logger = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   private static final String TWO_THIRTY_ZIP = 
"./target/old-releases/apache-artemis-2.30.0-bin.zip";
+   private static final String TWO_THIRTY_FIVE_ZIP = 
"./target/old-releases/apache-artemis-2.35.0-bin.zip";
+
+   //private static String sourceHome = HelperBase.getHome().getAbsolutePath();
+
+   public static final String LIVE_0 = "RolledUpgradeTest/live0";
+   public static final String LIVE_1 = "RolledUpgradeTest/live1";
+   public static final String LIVE_2 = "RolledUpgradeTest/live2";
+
+   public static final String BKP_0 = "RolledUpgradeTest/bkp0";
+   public static final String BKP_1 = "RolledUpgradeTest/bkp1";
+   public static final String BKP_2 = "RolledUpgradeTest/bkp2";
+
+   Process live0Process;
+   Process live1Process;
+   Process live2Process;
+
+   Process bkp0Process;
+   Process bkp1Process;
+   Process bkp2Process;
+
+   private static String getHost(int nodeID) {
+      return "localhost";
+   }
+
+   private static int getPort(int nodeID) {
+      return 61616 + nodeID;
+   }
+
+   private static int getPortOffeset(int nodeID) {
+      return nodeID;
+   }
+
+   private static void newServer(File homeLocation,
+                                 String location,
+                                 int serverID,
+                                 String replicaGroupName,
+                                 boolean live,
+                                 int[] connectedNodes) throws Exception {
+      File serverLocation = getFileServerLocation(location);
+      List<String> parameters = new ArrayList<>();
+      deleteDirectory(serverLocation);
+
+      StringBuilder clusterList = new StringBuilder();
+      for (int i = 0; i < connectedNodes.length; i++) {
+         if (i > 0) {
+            clusterList.append(",");
+         }
+         clusterList.append("tcp://" + getHost(connectedNodes[i]) + ":" + 
getPort(connectedNodes[i]));
+      }
+
+      parameters.add(homeLocation.getAbsolutePath() + "/bin/artemis");
+      parameters.add("create");
+      parameters.add("--silent");
+      parameters.add("--user");
+      parameters.add("guest");
+      parameters.add("--password");
+      parameters.add("guest");
+      parameters.add("--port-offset");
+      parameters.add(String.valueOf(getPortOffeset(serverID)));
+      parameters.add("--allow-anonymous");
+      parameters.add("--no-web");
+      parameters.add("--no-autotune");
+      parameters.add("--host");
+      parameters.add("localhost");
+      parameters.add("--clustered");
+      parameters.add("--staticCluster");
+      parameters.add(clusterList.toString());
+      parameters.add("--replicated");
+      if (!live) {
+         parameters.add("--slave");
+      }
+      parameters.add("--no-amqp-acceptor");
+      parameters.add("--no-mqtt-acceptor");
+      parameters.add("--no-hornetq-acceptor");
+      parameters.add("--no-stomp-acceptor");
+      parameters.add(serverLocation.getAbsolutePath());
+
+      ProcessBuilder processBuilder = new ProcessBuilder();
+      processBuilder.command(parameters.toArray(new 
String[parameters.size()]));
+      Process process = processBuilder.start();
+      SpawnedVMSupport.spawnLoggers(null, null, "ArtemisCreate", true, true, 
process);
+      Assertions.assertTrue(process.waitFor(10, TimeUnit.SECONDS));

Review Comment:
   This is asserting the process waited and finished in 10 seconds.  Not sure 
what else I would assert for here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to