Search in sources :

Example 16 with PreferenceRecord

use of org.apache.qpid.server.store.preferences.PreferenceRecord in project qpid-broker-j by apache.

the class PreferenceTestHelper method assertRecords.

public static void assertRecords(final Collection<PreferenceRecord> expected, final Collection<PreferenceRecord> actual) {
    assertEquals("Unexpected number of records", expected.size(), actual.size());
    for (PreferenceRecord expectedRecord : expected) {
        PreferenceRecord actualRecord = null;
        for (PreferenceRecord record : actual) {
            if (record.getId().equals(expectedRecord.getId())) {
                actualRecord = record;
                break;
            }
        }
        assertNotNull(String.format("No actual record found for expected record '%s'", expectedRecord.getId()), actualRecord);
        assertEquals(String.format("Expected attributes are different from actual: %s vs %s", expectedRecord.getAttributes().toString(), actualRecord.getAttributes().toString()), new HashMap<>(expectedRecord.getAttributes()), new HashMap<>(actualRecord.getAttributes()));
    }
}
Also used : PreferenceRecord(org.apache.qpid.server.store.preferences.PreferenceRecord)

Aggregations

PreferenceRecord (org.apache.qpid.server.store.preferences.PreferenceRecord)16 PreferenceRecordImpl (org.apache.qpid.server.store.preferences.PreferenceRecordImpl)6 UUID (java.util.UUID)5 PreparedStatement (java.sql.PreparedStatement)4 ResultSet (java.sql.ResultSet)4 ArrayList (java.util.ArrayList)4 LinkedHashSet (java.util.LinkedHashSet)4 StoreException (org.apache.qpid.server.store.StoreException)4 DatabaseEntry (com.sleepycat.je.DatabaseEntry)3 HashSet (java.util.HashSet)3 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)3 MapBinding (org.apache.qpid.server.store.berkeleydb.tuple.MapBinding)3 UUIDTupleBinding (org.apache.qpid.server.store.berkeleydb.tuple.UUIDTupleBinding)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 Database (com.sleepycat.je.Database)2 TaskExecutorImpl (org.apache.qpid.server.configuration.updater.TaskExecutorImpl)2 ModelVersion (org.apache.qpid.server.model.ModelVersion)2 PreferenceStoreUpdaterImpl (org.apache.qpid.server.store.preferences.PreferenceStoreUpdaterImpl)2 PreferencesRecoverer (org.apache.qpid.server.store.preferences.PreferencesRecoverer)2 Cursor (com.sleepycat.je.Cursor)1