qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1775841 - in /qpid/java/trunk: bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/ broker-core/src/main/java/org/apache/qpid/server/store/preferences/
Date Fri, 23 Dec 2016 14:26:47 GMT
Author: kwall
Date: Fri Dec 23 14:26:47 2016
New Revision: 1775841

URL: http://svn.apache.org/viewvc?rev=1775841&view=rev
Log:
QPID-6028 : [Java Broker] Fix failing BDBUpgradeTest

Modified:
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBPreferenceStore.java
    qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/preferences/AbstractJDBCPreferenceStore.java

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBPreferenceStore.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBPreferenceStore.java?rev=1775841&r1=1775840&r2=1775841&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBPreferenceStore.java
(original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBPreferenceStore.java
Fri Dec 23 14:26:47 2016
@@ -72,6 +72,7 @@ abstract class AbstractBDBPreferenceStor
 
         try
         {
+            _storeState.set(StoreState.OPENED);
             ModelVersion currentVersion =
                     new ModelVersion(BrokerModel.MODEL_MAJOR_VERSION, BrokerModel.MODEL_MINOR_VERSION);
             ModelVersion storedVersion = getStoredVersion();
@@ -95,7 +96,6 @@ abstract class AbstractBDBPreferenceStor
                 replace(ids, records);
             }
 
-            _storeState.set(StoreState.OPENED);
             return records;
         }
         catch (Exception e)
@@ -158,9 +158,10 @@ abstract class AbstractBDBPreferenceStor
         _useOrCloseRWLock.readLock().lock();
         try
         {
-            if (!getStoreState().equals(StoreState.OPENED))
+            final StoreState storeState = getStoreState();
+            if (!storeState.equals(StoreState.OPENED))
             {
-                throw new IllegalStateException("PreferenceStore is not opened");
+                throw new IllegalStateException(String.format("PreferenceStore is not opened.
Actual state : %s", storeState));
             }
 
             if (preferenceRecordsToRemove.isEmpty() && preferenceRecordsToAdd.isEmpty())

Modified: qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java?rev=1775841&r1=1775840&r2=1775841&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
(original)
+++ qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
Fri Dec 23 14:26:47 2016
@@ -353,8 +353,8 @@ public class BDBUpgradeTest extends Qpid
         assertEquals(1, bindings.size());
         for(Map<String, Object> binding : bindings)
         {
-            String bindingKey = (String) binding.get("name");
-            String queueName = (String) binding.get("queue");
+            String bindingKey = (String) binding.get("bindingKey");
+            String queueName = (String) binding.get("destination");
 
             //Because its a fanout exchange, we just return a single '*' key with all bound
queues
             assertEquals("unexpected binding key", "dlq", bindingKey);

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/preferences/AbstractJDBCPreferenceStore.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/preferences/AbstractJDBCPreferenceStore.java?rev=1775841&r1=1775840&r2=1775841&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/preferences/AbstractJDBCPreferenceStore.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/preferences/AbstractJDBCPreferenceStore.java
Fri Dec 23 14:26:47 2016
@@ -79,6 +79,8 @@ public abstract class AbstractJDBCPrefer
 
         try
         {
+            _storeState.set(StoreState.OPENED);
+
             Collection<PreferenceRecord> records;
 
             try (Connection connection = getConnection())
@@ -107,7 +109,6 @@ public abstract class AbstractJDBCPrefer
                 }
             }
 
-            _storeState.set(StoreState.OPENED);
             return records;
         }
         catch (SQLException e)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message