From b4e6cb6af53a1f264314ebfdd6ee771097d0e5c2 Mon Sep 17 00:00:00 2001 From: gtully Date: Wed, 11 Feb 2015 15:27:45 +0000 Subject: [PATCH] reduce test duration, relax derbydb durability - AMQ5266SingleDestTest Conflicts: activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java --- .../src/test/java/org/apache/activemq/TestSupport.java | 5 ++++- .../org/apache/activemq/bugs/AMQ5266SingleDestTest.java | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java b/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java index 80aac149d9..a762f89f6a 100755 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java @@ -183,7 +183,9 @@ public abstract class TestSupport extends CombinationTestSupport { PersistenceAdapter adapter = null; switch (choice) { case JDBC: - adapter = new JDBCPersistenceAdapter(); + JDBCPersistenceAdapter jdbcPersistenceAdapter = new JDBCPersistenceAdapter(); + jdbcPersistenceAdapter.setUseLock(false); // rollback (at shutdown) on derby can take a long time with file io etc + adapter = jdbcPersistenceAdapter; break; case KahaDB: adapter = new KahaDBPersistenceAdapter(); @@ -196,6 +198,7 @@ public abstract class TestSupport extends CombinationTestSupport { break; } broker.setPersistenceAdapter(adapter); + adapter.setDirectory(new File(broker.getBrokerDataDirectory(), choice.name())); return adapter; } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5266SingleDestTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5266SingleDestTest.java index cfd6534680..0d7f44bfee 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5266SingleDestTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5266SingleDestTest.java @@ -44,6 +44,7 @@ import org.apache.activemq.broker.region.policy.PolicyMap; import org.apache.activemq.command.ActiveMQQueue; import org.junit.After; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -97,6 +98,11 @@ public class AMQ5266SingleDestTest { public int consumerBatchSize = 25; + @BeforeClass + public static void derbyTestMode() throws Exception { + System.setProperty("derby.system.durability","test"); + } + @Before public void startBroker() throws Exception { brokerService = new BrokerService();