diff options
Diffstat (limited to 'qpid/java')
28 files changed, 169 insertions, 41 deletions
diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreConfigurationTest.java b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreConfigurationTest.java index 6c6145fabb..da1038284e 100644 --- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreConfigurationTest.java +++ b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreConfigurationTest.java @@ -20,26 +20,40 @@ */ package org.apache.qpid.server.store.berkeleydb; +import org.apache.qpid.server.store.AbstractDurableConfigurationStoreTestCase; import org.apache.qpid.server.store.DurableConfigurationStore; -import org.apache.qpid.server.store.DurableConfigurationStoreTest; -import org.apache.qpid.server.store.MessageStore; -public class BDBMessageStoreConfigurationTest extends DurableConfigurationStoreTest +public class BDBMessageStoreConfigurationTest extends AbstractDurableConfigurationStoreTestCase { private BDBMessageStore _bdbMessageStore; @Override + protected void onReopenStore() + { + _bdbMessageStore = null; + } + + @Override protected BDBMessageStore createMessageStore() throws Exception { - _bdbMessageStore = new BDBMessageStore(); + createStoreIfNecessary(); return _bdbMessageStore; } - // TODO - this only works so long as createConfigStore is called after createMessageStore + private void createStoreIfNecessary() + { + if(_bdbMessageStore == null) + { + _bdbMessageStore = new BDBMessageStore(); + } + } + @Override protected DurableConfigurationStore createConfigStore() throws Exception { + createStoreIfNecessary(); + return _bdbMessageStore; } } diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/MessageStoreCreatorTest.java b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/MessageStoreCreatorTest.java index 8564199009..730001d849 100644 --- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/MessageStoreCreatorTest.java +++ b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/MessageStoreCreatorTest.java @@ -20,16 +20,14 @@ */ package org.apache.qpid.server.store.berkeleydb; -import org.apache.qpid.server.store.MemoryMessageStore; import org.apache.qpid.server.store.MessageStore; import org.apache.qpid.server.store.MessageStoreCreator; import org.apache.qpid.server.store.berkeleydb.BDBMessageStore; -import org.apache.qpid.server.store.derby.DerbyMessageStore; import org.apache.qpid.test.utils.QpidTestCase; public class MessageStoreCreatorTest extends QpidTestCase { - private static final String[] STORE_TYPES = {MemoryMessageStore.TYPE, DerbyMessageStore.TYPE, BDBMessageStore.TYPE}; + private static final String[] STORE_TYPES = {BDBMessageStore.TYPE}; public void testMessageStoreCreator() { diff --git a/qpid/java/broker-plugins/derby-store/build.xml b/qpid/java/broker-plugins/derby-store/build.xml new file mode 100644 index 0000000000..e93b81aad7 --- /dev/null +++ b/qpid/java/broker-plugins/derby-store/build.xml @@ -0,0 +1,32 @@ +<!-- + - 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. + --> +<project name="Qpid Broker-Plugins Derby Store" default="build"> + <property name="module.depends" value="common broker" /> + <property name="module.test.depends" value="common/tests broker/tests" /> + + <property name="module.genpom" value="true"/> + <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/> + + <property name="broker.plugin" value="true"/> + + <import file="../../module.xml" /> + + <target name="bundle" depends="bundle-tasks"/> + +</project> diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java index ac310d02c9..ac310d02c9 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java +++ b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java index 1b111ad65e..1b111ad65e 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java +++ b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js index 04016b5fae..04016b5fae 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js +++ b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/derby/add.html b/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhost/store/derby/add.html index 2ed5b35c10..2ed5b35c10 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/derby/add.html +++ b/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhost/store/derby/add.html diff --git a/qpid/java/broker-plugins/derby-store/src/main/resources/services/org.apache.qpid.server.plugin.MessageStoreFactory b/qpid/java/broker-plugins/derby-store/src/main/resources/services/org.apache.qpid.server.plugin.MessageStoreFactory new file mode 100644 index 0000000000..88ca1fed5e --- /dev/null +++ b/qpid/java/broker-plugins/derby-store/src/main/resources/services/org.apache.qpid.server.plugin.MessageStoreFactory @@ -0,0 +1,19 @@ +# +# 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. +# +org.apache.qpid.server.store.derby.DerbyMessageStoreFactory diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreCreatorTest.java b/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreConfigurationTest.java index e74937dd1c..ffb6ac479a 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreCreatorTest.java +++ b/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreConfigurationTest.java @@ -18,22 +18,41 @@ * under the License. * */ -package org.apache.qpid.server.store; +package org.apache.qpid.server.store.derby; -import org.apache.qpid.server.store.derby.DerbyMessageStore; -import org.apache.qpid.test.utils.QpidTestCase; +import org.apache.qpid.server.store.AbstractDurableConfigurationStoreTestCase; -public class MessageStoreCreatorTest extends QpidTestCase +public class DerbyMessageStoreConfigurationTest extends AbstractDurableConfigurationStoreTestCase { - private static final String[] STORE_TYPES = {MemoryMessageStore.TYPE, DerbyMessageStore.TYPE}; - public void testMessageStoreCreator() + private DerbyMessageStore _derbyMessageStore; + + @Override + protected void onReopenStore() + { + _derbyMessageStore = null; + } + + @Override + protected DerbyMessageStore createMessageStore() throws Exception { - MessageStoreCreator messageStoreCreator = new MessageStoreCreator(); - for (String type : STORE_TYPES) + createStoreIfNecessary(); + return _derbyMessageStore; + } + + + private void createStoreIfNecessary() + { + if(_derbyMessageStore == null) { - MessageStore store = messageStoreCreator.createMessageStore(type); - assertNotNull("Store of type " + type + " is not created", store); + _derbyMessageStore = new DerbyMessageStore(); } } + + @Override + protected DerbyMessageStore createConfigStore() throws Exception + { + createStoreIfNecessary(); + return _derbyMessageStore; + } } diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreQuotaEventsTest.java b/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreQuotaEventsTest.java index 479675dac1..479675dac1 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreQuotaEventsTest.java +++ b/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreQuotaEventsTest.java diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreTest.java b/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreTest.java index 859fad629b..859fad629b 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreTest.java +++ b/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreTest.java diff --git a/qpid/java/broker-plugins/jdbc-store/build.xml b/qpid/java/broker-plugins/jdbc-store/build.xml new file mode 100644 index 0000000000..de6ec59845 --- /dev/null +++ b/qpid/java/broker-plugins/jdbc-store/build.xml @@ -0,0 +1,31 @@ +<!-- + - 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. + --> +<project name="Qpid Broker-Plugins JDBC Store" default="build"> + <property name="module.depends" value="common broker" /> + <property name="module.test.depends" value="common/tests broker/tests" /> + + <property name="module.genpom" value="true"/> + <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/> + + <property name="broker.plugin" value="true"/> + + <import file="../../module.xml" /> + + <target name="bundle" depends="bundle-tasks"/> +</project> diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProvider.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProvider.java index 7945ae3b46..7945ae3b46 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProvider.java +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProvider.java diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java index 8fc7de12d0..8fc7de12d0 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java index f8d93536bb..f8d93536bb 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java index 82d2275156..82d2275156 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js index dd79aae2fa..dd79aae2fa 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/pool/none/add.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/pool/none/add.js index 7276737873..7276737873 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/pool/none/add.js +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/pool/none/add.js diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/jdbc/add.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html index 966b4fcc06..966b4fcc06 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/jdbc/add.html +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/resources/services/org.apache.qpid.server.plugin.MessageStoreFactory b/qpid/java/broker-plugins/jdbc-store/src/main/resources/services/org.apache.qpid.server.plugin.MessageStoreFactory new file mode 100644 index 0000000000..a77458f27d --- /dev/null +++ b/qpid/java/broker-plugins/jdbc-store/src/main/resources/services/org.apache.qpid.server.plugin.MessageStoreFactory @@ -0,0 +1,19 @@ +# +# 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. +# +org.apache.qpid.server.store.jdbc.JDBCMessageStoreFactory diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java b/qpid/java/broker-plugins/jdbc-store/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java index a8e0460cea..9c348383c6 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java +++ b/qpid/java/broker-plugins/jdbc-store/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java @@ -31,7 +31,6 @@ import java.util.Set; import org.apache.qpid.server.model.VirtualHost; import org.apache.qpid.server.store.MessageStore; import org.apache.qpid.server.store.MessageStoreTestCase; -import org.apache.qpid.server.store.derby.DerbyMessageStore; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.when; @@ -133,7 +132,7 @@ public class JDBCMessageStoreTest extends MessageStoreTestCase } catch(SQLException e) { - if (e.getSQLState().equalsIgnoreCase(DerbyMessageStore.DERBY_SINGLE_DB_SHUTDOWN_CODE)) + if (e.getSQLState().equalsIgnoreCase("08006")) { //expected and represents a clean shutdown of this database only, do nothing. } diff --git a/qpid/java/broker/build.xml b/qpid/java/broker/build.xml index dbb2ee8aee..3c83715305 100644 --- a/qpid/java/broker/build.xml +++ b/qpid/java/broker/build.xml @@ -25,9 +25,9 @@ <property name="module.genpom" value="true"/> <!-- Add dependencies to the broker pom for the broker-plugins and bdbstore modules --> - <property name="module.maven.depends" value="broker-plugins/management-http broker-plugins/management-jmx broker-plugins/access-control broker-plugins/jdbc-provider-bone bdbstore bdbstore/jmx"/> + <property name="module.maven.depends" value="broker-plugins/management-http broker-plugins/management-jmx broker-plugins/access-control broker-plugins/jdbc-provider-bone bdbstore bdbstore/jmx broker-plugins/jdbc-store broker-plugins/derby-store"/> <!-- Make them runtime dependencies, make bdbstore modules optional --> - <property name="module.genpom.args" value="-Sqpid-broker-plugins-management-http=runtime -Sqpid-broker-plugins-management-jmx=runtime -Sqpid-broker-plugins-access-control=runtime -Sqpid-bdbstore=runtime -Oqpid-bdbstore -Sqpid-bdbstore-jmx=runtime -Oqpid-bdbstore-jmx -Sqpid-broker-plugins-jdbc-provider-bone=runtime -Oqpid-broker-plugins-jdbc-provider-bone"/> + <property name="module.genpom.args" value="-Sqpid-broker-plugins-management-http=runtime -Sqpid-broker-plugins-management-jmx=runtime -Sqpid-broker-plugins-access-control=runtime -Sqpid-bdbstore=runtime -Oqpid-bdbstore -Sqpid-bdbstore-jmx=runtime -Oqpid-bdbstore-jmx -Sqpid-broker-plugins-jdbc-provider-bone=runtime -Oqpid-broker-plugins-jdbc-provider-bone -Sqpid-broker-plugins-jdbc-store=runtime -Sqpid-broker-plugins-derby-store=runtime"/> <import file="../module.xml"/> diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java index c66fa4e869..54978776e7 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java @@ -29,3 +29,4 @@ public interface ConnectionProvider void close() throws SQLException; } + diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory b/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory index 0edd44f5a5..02f22eb21a 100644 --- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory +++ b/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory @@ -16,6 +16,4 @@ # specific language governing permissions and limitations # under the License. # -org.apache.qpid.server.store.derby.DerbyMessageStoreFactory org.apache.qpid.server.store.MemoryMessageStoreFactory -org.apache.qpid.server.store.jdbc.JDBCMessageStoreFactory diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java index c6473d9520..042abca9c4 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java @@ -78,8 +78,7 @@ public class VirtualHostRecovererTest extends TestCase attributes.put(VirtualHost.NAME, getName()); attributes.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE); - attributes.put(VirtualHost.STORE_PATH, "/path/to/virtualhost/store"); - attributes.put(VirtualHost.STORE_TYPE, "DERBY"); + attributes.put(VirtualHost.STORE_TYPE, "MEMORY"); when(entry.getAttributes()).thenReturn(attributes); VirtualHost host = recoverer.create(null, entry, parent); @@ -99,8 +98,7 @@ public class VirtualHostRecovererTest extends TestCase attributes = new HashMap<String, Object>(); attributes.put(VirtualHost.NAME, getName()); - attributes.put(VirtualHost.STORE_PATH, "/path/to/store"); - attributes.put(VirtualHost.STORE_TYPE, "DERBY"); + attributes.put(VirtualHost.STORE_TYPE, "MEMORY"); mandatoryAttributes = new String[]{VirtualHost.NAME, VirtualHost.STORE_TYPE}; checkMandatoryAttributesAreValidated(mandatoryAttributes, attributes); diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/DurableConfigurationStoreTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java index 4a6b3f2cad..c6d166bc4c 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/DurableConfigurationStoreTest.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java @@ -42,9 +42,6 @@ import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.framing.FieldTable; import org.apache.qpid.server.binding.Binding; import org.apache.qpid.server.exchange.Exchange; -import org.apache.qpid.server.logging.SystemOutMessageLogger; -import org.apache.qpid.server.logging.actors.CurrentActor; -import org.apache.qpid.server.logging.actors.TestLogActor; import org.apache.qpid.server.message.EnqueableMessage; import org.apache.qpid.server.model.LifetimePolicy; import org.apache.qpid.server.model.Queue; @@ -54,11 +51,10 @@ import org.apache.qpid.server.queue.AMQQueue; import org.apache.qpid.server.queue.MockStoredMessage; import org.apache.qpid.server.store.MessageStoreRecoveryHandler.StoredMessageRecoveryHandler; import org.apache.qpid.server.store.Transaction.Record; -import org.apache.qpid.server.store.derby.DerbyMessageStore; import org.apache.qpid.test.utils.QpidTestCase; import org.apache.qpid.util.FileUtils; -public class DurableConfigurationStoreTest extends QpidTestCase +public abstract class AbstractDurableConfigurationStoreTestCase extends QpidTestCase { private static final String EXCHANGE_NAME = "exchangeName"; private String _storePath; @@ -371,6 +367,7 @@ public class DurableConfigurationStoreTest extends QpidTestCase private void reopenStore() throws Exception { + onReopenStore(); if (_messageStore != null) { _messageStore.close(); @@ -383,8 +380,10 @@ public class DurableConfigurationStoreTest extends QpidTestCase _messageStore.activate(); } - protected MessageStore createMessageStore() throws Exception - { + protected abstract void onReopenStore(); + + abstract protected MessageStore createMessageStore() throws Exception; + /*{ String storeClass = System.getProperty(MESSAGE_STORE_CLASS_NAME_KEY); if (storeClass == null) { @@ -394,9 +393,9 @@ public class DurableConfigurationStoreTest extends QpidTestCase MessageStore messageStore = (MessageStore) Class.forName(storeClass).newInstance(); return messageStore; } - - protected DurableConfigurationStore createConfigStore() throws Exception - { +*/ + abstract protected DurableConfigurationStore createConfigStore() throws Exception; + /*{ String storeClass = System.getProperty(CONFIGURATION_STORE_CLASS_NAME_KEY); if (storeClass == null) { @@ -414,7 +413,7 @@ public class DurableConfigurationStoreTest extends QpidTestCase } return configurationStore; } - +*/ public void testRecordXid() throws Exception { Record enqueueRecord = getTestRecord(1); diff --git a/qpid/java/build.deps b/qpid/java/build.deps index e8c56f19af..630932638a 100644 --- a/qpid/java/build.deps +++ b/qpid/java/build.deps @@ -96,6 +96,8 @@ perftests.test.libs=${test.libs} broker-plugins-access-control.test.libs=${test.libs} broker-plugins-management-http.test.libs=${test.libs} broker-plugins-management-jmx.test.libs=${test.libs} +broker-plugins-jdbc-store.test.libs=${test.libs} +broker-plugins-derby-store.test.libs=${test.libs} management-common.test.libs=${test.libs} diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java index 67e3e3b8f1..cf05cc0304 100755 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java @@ -69,7 +69,6 @@ import org.apache.qpid.server.protocol.AmqpProtocolVersion; import org.apache.qpid.server.store.MemoryMessageStore; import org.apache.qpid.server.store.MessageStoreConstants; import org.apache.qpid.server.store.MessageStoreCreator; -import org.apache.qpid.server.store.derby.DerbyMessageStore; import org.apache.qpid.url.URLSyntaxException; import org.apache.qpid.util.FileUtils; @@ -839,7 +838,7 @@ public class QpidBrokerTestCase extends QpidTestCase if (System.getProperty("profile", "").startsWith("java-dby-mem")) { - storeDir = DerbyMessageStore.MEMORY_STORE_LOCATION; + storeDir = ":memory:"; } else if (!MEMORY_STORE_CLASS_NAME.equals(storeClassName)) { |