View Javadoc

1   /*
2    * $Id: AbstractFileMuleMessageFactoryTestCase.java 22447 2011-07-19 06:52:00Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.file;
12  
13  import org.mule.transport.AbstractMuleMessageFactoryTestCase;
14  
15  import java.io.File;
16  
17  import org.junit.Rule;
18  import org.junit.rules.TemporaryFolder;
19  
20  public abstract class AbstractFileMuleMessageFactoryTestCase extends AbstractMuleMessageFactoryTestCase
21  {
22      @Rule
23      public TemporaryFolder tempFolder = new TemporaryFolder();
24      
25      protected File tempFile;
26  
27      @Override
28      protected void doSetUp() throws Exception
29      {
30          super.doSetUp();
31          tempFile = tempFolder.newFile("simple.mule");
32      }
33      
34      @Override
35      protected Object getValidTransportMessage()
36      {
37          return tempFile;
38      }
39  
40      @Override
41      protected Object getUnsupportedTransportMessage()
42      {
43          return "this is an invalid payload for " + getClass().getSimpleName();
44      }
45  }