NO-JIRA: Add extra debug logging and add asserts to verify broker store persistence
authorAlex Rudyy <orudyy@apache.org>
Fri, 18 May 2018 16:29:21 +0000 (17:29 +0100)
committerAlex Rudyy <orudyy@apache.org>
Fri, 18 May 2018 16:29:21 +0000 (17:29 +0100)
systests/src/main/java/org/apache/qpid/systest/core/brokerj/SpawnQpidBrokerAdmin.java
systests/src/main/java/org/apache/qpid/systest/core/cpp/SpawnQpidBrokerAdmin.java
systests/src/test/java/org/apache/qpid/systest/connection/FailoverBehaviourTest.java
systests/src/test/java/org/apache/qpid/systest/core/brokerj/SpawnQpidBrokerAdminTest.java

index b3c967f..c2379b8 100644 (file)
@@ -281,7 +281,7 @@ public class SpawnQpidBrokerAdmin extends AbstractSpawnQpidBrokerAdmin
         jvmArguments.add("--initial-config-path");
         jvmArguments.add(escapePath(testInitialConfiguration.toString()));
 
-        LOGGER.debug("Spawning broker JVM :", jvmArguments);
+        LOGGER.debug("Spawning broker JVM : {}", jvmArguments);
         String[] cmd = jvmArguments.toArray(new String[jvmArguments.size()]);
 
         return new ProcessBuilder(cmd);
index 5cc27d2..764402b 100644 (file)
@@ -27,12 +27,17 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.systest.core.AbstractSpawnQpidBrokerAdmin;
 import org.apache.qpid.systest.core.BrokerAdminException;
 import org.apache.qpid.systest.core.LogConsumer;
 
 public class SpawnQpidBrokerAdmin extends AbstractSpawnQpidBrokerAdmin
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(SpawnQpidBrokerAdmin.class);
+
     private static final String SYSTEST_PROPERTY_BROKER_EXECUTABLE = "qpid.systest.broker.executable";
     private static final String SYSTEST_PROPERTY_BROKER_MODULE_DIR = "qpid.systest.broker.moduleDir";
     private static final String SYSTEST_PROPERTY_BROKER_STORE_INITIALIZED = "qpid.systest.broker.storeInitialized";
@@ -143,6 +148,7 @@ public class SpawnQpidBrokerAdmin extends AbstractSpawnQpidBrokerAdmin
     @Override
     public void restart()
     {
+        LOGGER.info("Restarting the broker");
         try
         {
             _previousPort = getBrokerAddress(PortType.AMQP).getPort();
@@ -195,6 +201,7 @@ public class SpawnQpidBrokerAdmin extends AbstractSpawnQpidBrokerAdmin
             cmd.add("--no-module-dir");
         }
 
+        LOGGER.info("Spawning cpp broker : {}", cmd );
         return new ProcessBuilder(cmd);
     }
 }
index 6654a4a..9601de6 100644 (file)
@@ -232,6 +232,7 @@ public class FailoverBehaviourTest extends JmsTestBase implements ExceptionListe
     @Test
     public void testTransactionRolledBackExceptionThrownOnCommitAfterFailoverOnMessageReceiving() throws Exception
     {
+        assumeTrue(getBrokerAdmin().supportsPersistence());
         init(Session.SESSION_TRANSACTED, true);
         produceMessages();
         _producerSession.commit();
@@ -284,6 +285,7 @@ public class FailoverBehaviourTest extends JmsTestBase implements ExceptionListe
     @Test
     public void testRollbackAfterFailover() throws Exception
     {
+        assumeTrue(getBrokerAdmin().supportsPersistence());
         init(Session.SESSION_TRANSACTED, true);
 
         produceMessages();
@@ -332,6 +334,7 @@ public class FailoverBehaviourTest extends JmsTestBase implements ExceptionListe
     @Test
     public void testRecoverAfterFailover() throws Exception
     {
+        assumeTrue(getBrokerAdmin().supportsPersistence());
         init(Session.CLIENT_ACKNOWLEDGE, true);
 
         produceMessages();
@@ -356,6 +359,7 @@ public class FailoverBehaviourTest extends JmsTestBase implements ExceptionListe
     @Test
     public void testRecoverWithConsumedMessagesAfterFailover() throws Exception
     {
+        assumeTrue(getBrokerAdmin().supportsPersistence());
         init(Session.CLIENT_ACKNOWLEDGE, true);
 
         produceMessages();
@@ -385,7 +389,7 @@ public class FailoverBehaviourTest extends JmsTestBase implements ExceptionListe
     @Test
     public void testAcknowledgeAfterFailover() throws Exception
     {
-        LOGGER.debug("KWDEBUG");
+        assumeTrue(getBrokerAdmin().supportsPersistence());
         init(Session.CLIENT_ACKNOWLEDGE, true);
 
         produceMessages();
@@ -442,6 +446,7 @@ public class FailoverBehaviourTest extends JmsTestBase implements ExceptionListe
     @Test
     public void testAcknowledgeAfterMessageReceivingAfterFailover() throws Exception
     {
+        assumeTrue(getBrokerAdmin().supportsPersistence());
         init(Session.CLIENT_ACKNOWLEDGE, true);
 
         produceMessages();
@@ -830,6 +835,7 @@ public class FailoverBehaviourTest extends JmsTestBase implements ExceptionListe
     @Test
     public void testFailoverWhenConnectionStopped() throws Exception
     {
+        assumeTrue(getBrokerAdmin().supportsPersistence());
         init(Session.SESSION_TRANSACTED, true);
 
         produceMessages();
index fa25dac..335b5d8 100644 (file)
@@ -27,7 +27,6 @@ import static org.apache.qpid.systest.core.brokerj.SpawnQpidBrokerAdmin.SYSTEST_
 import static org.apache.qpid.systest.core.brokerj.SpawnQpidBrokerAdmin.SYSTEST_PROPERTY_VIRTUALHOSTNODE_TYPE;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeThat;