Search in sources :

Example 1 with GenericRecoverer

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

the class BrokerMemoryLoggerTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    _taskExecutor = new CurrentThreadTaskExecutor();
    _taskExecutor.start();
    _systemConfig = new JsonSystemConfigImpl(_taskExecutor, mock(EventLogger.class), null, new HashMap<String, Object>()) {

        {
            updateModel(BrokerModel.getInstance());
        }
    };
    when(_brokerEntry.getId()).thenReturn(_brokerId);
    when(_brokerEntry.getType()).thenReturn(Broker.class.getSimpleName());
    Map<String, Object> attributesMap = new HashMap<>();
    attributesMap.put(Broker.MODEL_VERSION, BrokerModel.MODEL_VERSION);
    attributesMap.put(Broker.NAME, getName());
    when(_brokerEntry.getAttributes()).thenReturn(attributesMap);
    when(_brokerEntry.getParents()).thenReturn(Collections.singletonMap(SystemConfig.class.getSimpleName(), _systemConfig.getId()));
    GenericRecoverer recoverer = new GenericRecoverer(_systemConfig);
    recoverer.recover(Arrays.asList(_brokerEntry), false);
}
Also used : Broker(org.apache.qpid.server.model.Broker) HashMap(java.util.HashMap) CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) GenericRecoverer(org.apache.qpid.server.store.GenericRecoverer) JsonSystemConfigImpl(org.apache.qpid.server.model.JsonSystemConfigImpl)

Aggregations

HashMap (java.util.HashMap)1 CurrentThreadTaskExecutor (org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor)1 Broker (org.apache.qpid.server.model.Broker)1 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)1 JsonSystemConfigImpl (org.apache.qpid.server.model.JsonSystemConfigImpl)1 GenericRecoverer (org.apache.qpid.server.store.GenericRecoverer)1