1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.transport.file;
12
13 import org.mule.api.transport.DispatchException;
14 import org.mule.module.client.MuleClient;
15 import org.mule.util.FileUtils;
16
17 import java.io.File;
18 import java.io.FileInputStream;
19
20 public class FileAppendEndpointTestCase extends FileAppendConnectorTestCase
21 {
22 public void testBasic() throws Exception
23 {
24 String myDirName = "myout";
25 String myFileName = "out.txt";
26 FileInputStream myFileStream = null;
27
28
29 File myDir = FileUtils.newFile(myDirName);
30 if (myDir.isDirectory())
31 {
32
33 File[] files = myDir.listFiles();
34 for (int i = 0; i < files.length; i++)
35 {
36 assertTrue(files[i].delete());
37 }
38
39 assertTrue(myDir.delete());
40 }
41 try
42 {
43 assertFalse(FileUtils.newFile(myDir, myFileName).exists());
44
45 MuleClient client = new MuleClient();
46 client.send("vm://fileappend", "Hello1", null);
47 fail("Expected exception: java.lang.IllegalArgumentException: configuring outputAppend on the file endpoint is no longer support. You can configure a the File connector instead.");
48 }
49 catch (Exception e)
50 {
51
52
53
54 assertEquals(DispatchException.class, e.getClass());
55 }
56
57 }
58
59 protected String getConfigResources()
60 {
61 return "org/mule/test/integration/providers/file/mule-fileappend-endpoint-config.xml";
62 }
63 }