public void testUpgradeOnlyRemovesSelectorBindings() throws Exception
{
_durableConfigurationRecoverer.beginConfigurationRecovery(_store, 0);
_durableConfigurationRecoverer.configuredObject(new UUID(1, 0),
"org.apache.qpid.server.model.Binding",
createBinding("key",
DIRECT_EXCHANGE_ID,
QUEUE_ID,
"x-filter-jms-selector",
"wibble",
"not-a-selector",
"moo"));
final UUID customExchangeId = new UUID(3,0);
_durableConfigurationRecoverer.configuredObject(new UUID(2, 0),
"org.apache.qpid.server.model.Binding",
createBinding("key",
customExchangeId,
QUEUE_ID,
"x-filter-jms-selector",
"wibble",
"not-a-selector",
"moo"));
_durableConfigurationRecoverer.configuredObject(customExchangeId,
"org.apache.qpid.server.model.Exchange",
createExchange(CUSTOM_EXCHANGE_NAME, HeadersExchange.TYPE));
final Exchange customExchange = mock(Exchange.class);
when(_exchangeFactory.restoreExchange(eq(customExchangeId),
eq(CUSTOM_EXCHANGE_NAME),
eq(HeadersExchange.TYPE.getType()),
anyBoolean())).thenReturn(customExchange);
final ConfiguredObjectRecord[] expected = {
new ConfiguredObjectRecord(new UUID(1, 0), "org.apache.qpid.server.model.Binding",
createBinding("key", DIRECT_EXCHANGE_ID, QUEUE_ID, "not-a-selector", "moo")),
new ConfiguredObjectRecord(new UUID(2, 0), "org.apache.qpid.server.model.Binding",
createBinding("key", customExchangeId, QUEUE_ID, "not-a-selector", "moo"))
};
verifyCorrectUpdates(expected);