1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.file;
12
13 import org.mule.api.endpoint.InboundEndpoint;
14 import org.mule.api.service.Service;
15 import org.mule.api.transport.MessageReceiver;
16 import org.mule.tck.MuleTestUtils;
17 import org.mule.transport.AbstractMessageReceiverTestCase;
18 import org.mule.util.FileUtils;
19
20 import com.mockobjects.dynamic.Mock;
21
22 import java.io.File;
23
24 public class FileMessageReceiverTestCase extends AbstractMessageReceiverTestCase
25 {
26 File read = FileUtils.newFile("testcasedata/read");
27 File move = FileUtils.newFile("testcasedata/move");
28 Mock session = MuleTestUtils.getMockSession();
29
30 public void testReceiver() throws Exception
31 {
32
33
34
35 }
36
37
38
39
40
41
42 public MessageReceiver getMessageReceiver() throws Exception
43 {
44 endpoint.getConnector().start();
45 Mock mockComponent = new Mock(Service.class);
46 mockComponent.expectAndReturn("getResponseRouter", null);
47 read.deleteOnExit();
48 move.deleteOnExit();
49
50 return new FileMessageReceiver(endpoint.getConnector(), (Service)mockComponent.proxy(),
51 endpoint, read.getAbsolutePath(), move.getAbsolutePath(), null, 1000);
52 }
53
54 public InboundEndpoint getEndpoint() throws Exception
55 {
56 return muleContext.getRegistry().lookupEndpointFactory().getInboundEndpoint("file://./simple");
57 }
58 }