assertNotNull(queuedMessages);
assertEquals("Should have found 10 messages", 10, queuedMessages.size());
}
protected List<Message> dumpMessages() throws Exception {
WireFormat wireFormat = new OpenWireFormat();
java.sql.Connection conn = ((JDBCPersistenceAdapter) service.getPersistenceAdapter()).getDataSource().getConnection();
PreparedStatement statement = conn.prepareStatement("SELECT ID, MSG FROM MYPREFIX_ACTIVEMQ_MSGS");
ResultSet result = statement.executeQuery();
ArrayList<Message> results = new ArrayList<Message>();
while(result.next()) {
long id = result.getLong(1);
Message message = (Message)wireFormat.unmarshal(new ByteSequence(result.getBytes(2)));
LOG.info("id: " + id + ", message SeqId: " + message.getMessageId().getBrokerSequenceId() + ", MSG: " + message);
results.add(message);
}
statement.close();
conn.close();