1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.transport.file;
12
13 import org.mule.tck.FunctionalTestCase;
14 import org.mule.util.FileUtils;
15
16 import java.io.File;
17
18 public class FileRuntimeExceptionStrategyFunctionalTestCase extends FunctionalTestCase
19 {
20 protected String getConfigResources()
21 {
22 return "org/mule/test/integration/providers/file/file-runtime-exception-strategy.xml";
23 }
24
25 public void testExceptionInTransformer() throws Exception
26 {
27 File f = FileUtils.newFile("./.mule/in/test.txt");
28 f.createNewFile();
29
30
31 File errorFile = FileUtils.newFile("./.mule/errors/test-0.out");
32 boolean testSucceded = false;
33 int timesTried = 0;
34 while (timesTried <= 3)
35 {
36 Thread.sleep(500 * ++timesTried);
37 if (errorFile.exists())
38 {
39 testSucceded = true;
40 break;
41 }
42 }
43
44 if (!testSucceded)
45 {
46 fail("Exception strategy hasn't moved the file to the error folder.");
47 }
48 }
49
50 }