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 33b67b4 NO-JIRA add page decoding test for large message with no persistence new eca3c6c This closes #2391 33b67b4 is described below commit 33b67b42d8102110f9aa0324a31d59f34d7951bd Author: Chao Wang <chao...@redhat.com> AuthorDate: Tue Oct 23 16:44:40 2018 +0800 NO-JIRA add page decoding test for large message with no persistence --- .../tests/integration/paging/PagingTest.java | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java index 23a1e32..4082639 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java @@ -119,6 +119,7 @@ public class PagingTest extends ActiveMQTestBase { protected ActiveMQServer server; protected ClientSessionFactory sf; static final int MESSAGE_SIZE = 1024; // 1k + static final int LARGE_MESSAGE_SIZE = 100 * 1024; protected static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; @@ -192,17 +193,26 @@ public class PagingTest extends ActiveMQTestBase { @Test public void testPageOnLargeMessageMultipleQueues() throws Exception { + internaltestOnLargetMessageMultipleQueues(MESSAGE_SIZE, true); + } + + @Test + public void testPageOnLargeMessageMultipleQueuesNoPersistence() throws Exception { + internaltestOnLargetMessageMultipleQueues(LARGE_MESSAGE_SIZE, false); + } + + private void internaltestOnLargetMessageMultipleQueues(final int messageSize, final boolean enablePersistence) throws Exception, ActiveMQException { + clearDataRecreateServerDirs(); + Configuration config = createDefaultInVMConfig(); final int PAGE_MAX = 20 * 1024; final int PAGE_SIZE = 10 * 1024; - ActiveMQServer server = createServer(true, config, PAGE_SIZE, PAGE_MAX); + ActiveMQServer server = createServer(enablePersistence, config, PAGE_SIZE, PAGE_MAX); server.start(); - final int numberOfBytes = 1024; - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true); ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator)); @@ -221,9 +231,9 @@ public class PagingTest extends ActiveMQTestBase { message.getBodyBuffer().writerIndex(0); - message.getBodyBuffer().writeBytes(new byte[numberOfBytes]); + message.getBodyBuffer().writeBytes(new byte[messageSize]); - for (int j = 1; j <= numberOfBytes; j++) { + for (int j = 1; j <= messageSize; j++) { message.getBodyBuffer().writeInt(j); } @@ -232,13 +242,6 @@ public class PagingTest extends ActiveMQTestBase { session.close(); - server.stop(); - - server = createServer(true, config, PAGE_SIZE, PAGE_MAX); - server.start(); - - sf = createSessionFactory(locator); - for (int ad = 0; ad < 2; ad++) { session = sf.createSession(false, false, false);