ARTEMIS-1663 Tweak on Paging test

Making sure it JournalCompatibilityTest/paging is actually paging


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/58c46604
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/58c46604
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/58c46604

Branch: refs/heads/master
Commit: 58c4660426eceabecfaecaad42716562d5e2fd92
Parents: ea70af1
Author: Clebert Suconic <clebertsuco...@apache.org>
Authored: Thu Feb 8 11:45:14 2018 -0500
Committer: Clebert Suconic <clebertsuco...@apache.org>
Committed: Thu Feb 8 11:45:18 2018 -0500

----------------------------------------------------------------------
 .../journalcompatibility/forcepaging.groovy     | 23 ++++++++++++++++++++
 .../journalcompatibility/ispaging.groovy        | 23 ++++++++++++++++++++
 .../main/resources/servers/artemisServer.groovy |  5 +++--
 .../compatibility/JournalCompatibilityTest.java |  3 +++
 4 files changed, 52 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/58c46604/tests/compatibility-tests/src/main/resources/journalcompatibility/forcepaging.groovy
----------------------------------------------------------------------
diff --git 
a/tests/compatibility-tests/src/main/resources/journalcompatibility/forcepaging.groovy
 
b/tests/compatibility-tests/src/main/resources/journalcompatibility/forcepaging.groovy
new file mode 100644
index 0000000..032bcc1
--- /dev/null
+++ 
b/tests/compatibility-tests/src/main/resources/journalcompatibility/forcepaging.groovy
@@ -0,0 +1,23 @@
+import org.apache.activemq.artemis.api.core.SimpleString
+import org.apache.activemq.artemis.core.server.Queue
+import org.apache.activemq.artemis.tests.compatibility.GroovyRun
+
+/*
+ * 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.
+ */
+
+Queue queue = 
server.getJMSServerManager().getActiveMQServer().locateQueue(SimpleString.toSimpleString("queue"))
+queue.getPageSubscription().getPagingStore().startPaging();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/58c46604/tests/compatibility-tests/src/main/resources/journalcompatibility/ispaging.groovy
----------------------------------------------------------------------
diff --git 
a/tests/compatibility-tests/src/main/resources/journalcompatibility/ispaging.groovy
 
b/tests/compatibility-tests/src/main/resources/journalcompatibility/ispaging.groovy
new file mode 100644
index 0000000..a6dea7d
--- /dev/null
+++ 
b/tests/compatibility-tests/src/main/resources/journalcompatibility/ispaging.groovy
@@ -0,0 +1,23 @@
+import org.apache.activemq.artemis.api.core.SimpleString
+import org.apache.activemq.artemis.core.server.Queue
+import org.apache.activemq.artemis.tests.compatibility.GroovyRun
+
+/*
+ * 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.
+ */
+
+Queue queue = 
server.getJMSServerManager().getActiveMQServer().locateQueue(SimpleString.toSimpleString("queue"))
+GroovyRun.assertTrue(queue.getPageSubscription().getPagingStore().isPaging())

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/58c46604/tests/compatibility-tests/src/main/resources/servers/artemisServer.groovy
----------------------------------------------------------------------
diff --git 
a/tests/compatibility-tests/src/main/resources/servers/artemisServer.groovy 
b/tests/compatibility-tests/src/main/resources/servers/artemisServer.groovy
index 78d1241..913c971 100644
--- a/tests/compatibility-tests/src/main/resources/servers/artemisServer.groovy
+++ b/tests/compatibility-tests/src/main/resources/servers/artemisServer.groovy
@@ -19,7 +19,8 @@ package servers
 // starts an artemis server
 
 import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
-import org.apache.activemq.artemis.core.server.JournalType;
+import org.apache.activemq.artemis.core.server.JournalType
+import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
 import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS
@@ -47,7 +48,7 @@ try {
     if (!type.startsWith("ARTEMIS-1")) {
         configuration.addAddressesSetting("#", new 
AddressSettings().setAutoCreateAddresses(true));
         if (globalMaxSize != null) {
-            
configuration.getAddressesSettings().get("#").setPageSizeBytes(globalMaxSize);
+            
configuration.getAddressesSettings().get("#").setPageSizeBytes(globalMaxSize).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)
             configuration.setGlobalMaxSize(Long.parseLong(globalMaxSize));
         }
     }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/58c46604/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java
----------------------------------------------------------------------
diff --git 
a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java
 
b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java
index 958db27..171e721 100644
--- 
a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java
+++ 
b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java
@@ -133,11 +133,14 @@ public class JournalCompatibilityTest extends 
VersionedBaseTest {
       setVariable(senderClassloader, "persistent", true);
       //Set max size to 1 to cause messages to immediately go to the paging 
store
       startServer(serverFolder.getRoot(), senderClassloader, "journalTest", 
Long.toString(1));
+      evaluate(senderClassloader, "journalcompatibility/forcepaging.groovy");
       evaluate(senderClassloader, "meshTest/sendMessages.groovy", server, 
sender, "sendAckMessages");
+      evaluate(senderClassloader, "journalcompatibility/ispaging.groovy");
       stopServer(senderClassloader);
 
       setVariable(receiverClassloader, "persistent", true);
       startServer(serverFolder.getRoot(), receiverClassloader, "journalTest", 
Long.toString(1));
+      evaluate(receiverClassloader, "journalcompatibility/ispaging.groovy");
 
 
       evaluate(receiverClassloader, "metrics/queueMetrics.groovy", server, 
receiver, "receiveMessages");

Reply via email to