diff options
Diffstat (limited to 'java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/upgrade/AbstractUpgradeTestCase.java')
-rw-r--r-- | java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/upgrade/AbstractUpgradeTestCase.java | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/upgrade/AbstractUpgradeTestCase.java b/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/upgrade/AbstractUpgradeTestCase.java index cd2654f79f..b2b28b3c2d 100644 --- a/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/upgrade/AbstractUpgradeTestCase.java +++ b/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/upgrade/AbstractUpgradeTestCase.java @@ -20,7 +20,14 @@ */ package org.apache.qpid.server.store.berkeleydb.upgrade; +import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.NONEXCLUSIVE_WITH_ERRONEOUS_OWNER; +import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.NON_DURABLE_QUEUE_NAME; +import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.PRIORITY_QUEUE_NAME; +import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.QUEUE_NAME; +import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.QUEUE_WITH_DLQ_NAME; + import java.io.File; +import java.io.InputStream; import org.apache.qpid.server.logging.LogSubject; import org.apache.qpid.server.logging.subjects.TestBlankSubject; @@ -51,15 +58,15 @@ public abstract class AbstractUpgradeTestCase extends QpidTestCase } } - public static final String[] QUEUE_NAMES = { "clientid:myDurSubName", "clientid:mySelectorDurSubName", "myUpgradeQueue", - "queue-non-durable", "nonexclusive-with-erroneous-owner" }; - public static int[] QUEUE_SIZES = { 1, 1, 10, 3, 0}; - public static int TOTAL_MESSAGE_NUMBER = 15; + public static final String[] QUEUE_NAMES = { "clientid:myDurSubName", "clientid:mySelectorDurSubName", QUEUE_NAME, NON_DURABLE_QUEUE_NAME, + NONEXCLUSIVE_WITH_ERRONEOUS_OWNER, PRIORITY_QUEUE_NAME, QUEUE_WITH_DLQ_NAME, QUEUE_WITH_DLQ_NAME + "_DLQ" }; + public static int[] QUEUE_SIZES = { 1, 1, 10, 3, 0, 0, 0, 1}; + public static int TOTAL_MESSAGE_NUMBER = 16; protected static final LogSubject LOG_SUBJECT = new TestBlankSubject(); - // one binding per exchange - protected static final int TOTAL_BINDINGS = QUEUE_NAMES.length * 2; - protected static final int TOTAL_EXCHANGES = 5; + // myQueueWithDLQ_DLQ is not bound to the default exchange + protected static final int TOTAL_BINDINGS = QUEUE_NAMES.length * 2 - 1; + protected static final int TOTAL_EXCHANGES = 6; private File _storeLocation; protected Environment _environment; @@ -105,10 +112,24 @@ public abstract class AbstractUpgradeTestCase extends QpidTestCase private File copyStore(String storeDirectoryName) throws Exception { - String src = getClass().getClassLoader().getResource("upgrade/" + storeDirectoryName).toURI().getPath(); File storeLocation = new File(new File(TMP_FOLDER), "test-store"); deleteDirectoryIfExists(storeLocation); - FileUtils.copyRecursive(new File(src), new File(TMP_FOLDER)); + storeLocation.mkdirs(); + int index = 0; + String prefix = "0000000"; + String extension = ".jdb"; + InputStream is = null; + do + { + String fileName = prefix + index + extension; + is = getClass().getClassLoader().getResourceAsStream("upgrade/" + storeDirectoryName + "/test-store/" + fileName); + if (is != null) + { + FileUtils.copy(is, new File(storeLocation, fileName)); + } + index++; + } + while (is != null); return storeLocation; } |