use of org.apache.activemq.artemis.core.postoffice.PostOffice in project activemq-artemis by apache.
the class RemoveDestinationTest method destinationPresentInAdminView.
private boolean destinationPresentInAdminView(ActiveMQTopic amqTopic) throws Exception {
boolean found = false;
ArtemisBrokerWrapper wrapper = (ArtemisBrokerWrapper) broker.getBroker();
PostOffice po = wrapper.getServer().getPostOffice();
Set<SimpleString> addressSet = po.getAddresses();
Iterator<SimpleString> iter = addressSet.iterator();
String addressToFind = amqTopic.getPhysicalName();
while (iter.hasNext()) {
if (addressToFind.equals(iter.next().toString())) {
found = true;
break;
}
}
return found;
}
use of org.apache.activemq.artemis.core.postoffice.PostOffice in project activemq-artemis by apache.
the class RestartSMTest method testRestartStorageManager.
@Test
public void testRestartStorageManager() throws Exception {
File testdir = new File(getTestDir());
deleteDirectory(testdir);
PostOffice postOffice = new FakePostOffice();
final JournalStorageManager journal = new JournalStorageManager(createDefaultInVMConfig(), EmptyCriticalAnalyzer.getInstance(), execFactory, execFactory);
try {
journal.start();
List<QueueBindingInfo> queueBindingInfos = new ArrayList<>();
journal.loadBindingJournal(queueBindingInfos, new ArrayList<GroupingInfo>(), new ArrayList<AddressBindingInfo>());
journal.loadMessageJournal(postOffice, null, null, null, null, null, null, new FakeJournalLoader());
journal.stop();
deleteDirectory(testdir);
journal.start();
journal.loadMessageJournal(postOffice, null, null, null, null, null, null, new FakeJournalLoader());
queueBindingInfos = new ArrayList<>();
journal.loadBindingJournal(queueBindingInfos, new ArrayList<GroupingInfo>(), new ArrayList<AddressBindingInfo>());
journal.start();
} finally {
try {
journal.stop();
} catch (Exception ex) {
RestartSMTest.log.warn(ex.getMessage(), ex);
}
}
}
Aggregations