Search in sources :

Example 16 with FileBackedMessageFactory

use of com.adaptris.core.lms.FileBackedMessageFactory in project interlok by adaptris.

the class FilesystemRetryStoreTest method testBuildForRetry_FileBacked.

@Test
public void testBuildForRetry_FileBacked() throws Exception {
    FilesystemRetryStore store = new FilesystemRetryStore().withBaseUrl(BaseCase.getConfiguration(TEST_BASE_URL));
    try {
        LifecycleHelper.initAndStart(store);
        AdaptrisMessage msg = new DefaultMessageFactory().newMessage("hello");
        store.write(msg);
        Map<String, String> metadata = store.getMetadata(msg.getUniqueId());
        AdaptrisMessage retry = store.buildForRetry(msg.getUniqueId(), store.getMetadata(msg.getUniqueId()), new FileBackedMessageFactory());
        assertEquals(msg.getUniqueId(), retry.getUniqueId());
        assertEquals(msg.getMessageHeaders(), retry.getMessageHeaders());
    } finally {
        LifecycleHelper.stopAndClose(store);
    }
}
Also used : DefaultMessageFactory(com.adaptris.core.DefaultMessageFactory) FileBackedMessageFactory(com.adaptris.core.lms.FileBackedMessageFactory) AdaptrisMessage(com.adaptris.core.AdaptrisMessage) Test(org.junit.Test)

Aggregations

FileBackedMessageFactory (com.adaptris.core.lms.FileBackedMessageFactory)16 Test (org.junit.Test)16 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)4 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)4 MockMessageListener (com.adaptris.core.stubs.MockMessageListener)4 DefaultMessageFactory (com.adaptris.core.DefaultMessageFactory)2 StandaloneProducer (com.adaptris.core.StandaloneProducer)2 PtpConsumer (com.adaptris.core.jms.PtpConsumer)2 PtpProducer (com.adaptris.core.jms.PtpProducer)2 FileBackedMessage (com.adaptris.core.lms.FileBackedMessage)2 SerializableMessage (com.adaptris.interlok.types.SerializableMessage)2 File (java.io.File)2 FakeFtpServer (org.mockftpserver.fake.FakeFtpServer)2 FileFilter (java.io.FileFilter)1 RandomAccessFile (java.io.RandomAccessFile)1 DirectoryFileFilter (org.apache.commons.io.filefilter.DirectoryFileFilter)1