Search in sources :

Example 21 with MimeEncoder

use of com.adaptris.core.MimeEncoder in project interlok by adaptris.

the class RelaxedFtpProducerTest method testProduce_WithEncoder.

@Test
public void testProduce_WithEncoder() throws Exception {
    EmbeddedFtpServer helper = new EmbeddedFtpServer();
    FileSystem filesystem = helper.createFilesystem_DirsOnly();
    FakeFtpServer server = helper.createAndStart(filesystem);
    try {
        RelaxedFtpProducer ftpProducer = createForTests(DESTINATION_URL + SLASH + DEFAULT_WORK_DIR_NAME);
        ftpProducer.setEncoder(new MimeEncoder());
        FtpConnection produceConnection = create(server);
        StandaloneProducer sp = new StandaloneProducer(produceConnection, ftpProducer);
        AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(PAYLOAD);
        ExampleServiceCase.execute(sp, msg);
        assertEquals(1, filesystem.listFiles(DEFAULT_WORK_DIR_CANONICAL).size());
    } finally {
        server.stop();
    }
}
Also used : FakeFtpServer(org.mockftpserver.fake.FakeFtpServer) MimeEncoder(com.adaptris.core.MimeEncoder) AdaptrisMessage(com.adaptris.core.AdaptrisMessage) FileSystem(org.mockftpserver.fake.filesystem.FileSystem) StandaloneProducer(com.adaptris.core.StandaloneProducer) Test(org.junit.Test)

Aggregations

MimeEncoder (com.adaptris.core.MimeEncoder)21 Test (org.junit.Test)18 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)13 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)7 MockMessageListener (com.adaptris.core.stubs.MockMessageListener)7 StandaloneProducer (com.adaptris.core.StandaloneProducer)6 File (java.io.File)5 FakeFtpServer (org.mockftpserver.fake.FakeFtpServer)4 FileSystem (org.mockftpserver.fake.filesystem.FileSystem)4 Adapter (com.adaptris.core.Adapter)3 Channel (com.adaptris.core.Channel)3 DefaultFailedMessageRetrier (com.adaptris.core.DefaultFailedMessageRetrier)3 DefaultFailedMessageRetrierJmxMBean (com.adaptris.core.DefaultFailedMessageRetrierJmxMBean)3 StandardWorkflow (com.adaptris.core.StandardWorkflow)3 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)3 ObjectName (javax.management.ObjectName)3 CoreException (com.adaptris.core.CoreException)2 QuartzCronPoller (com.adaptris.core.QuartzCronPoller)2 TimeInterval (com.adaptris.util.TimeInterval)2 FileEntry (org.mockftpserver.fake.filesystem.FileEntry)2