~ubuntu-branches/ubuntu/precise/surefire/precise

« back to all changes in this revision

Viewing changes to surefire-integration-tests/src/test/resources/junit4-runlistener/src/test/java/runListener/FileHelper.java

  • Committer: Bazaar Package Importer
  • Author(s): Miguel Landaeta
  • Date: 2011-10-10 20:42:16 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20111010204216-cemva69wkagf4fay
Tags: 2.10-1
* Team upload.
* New upstream release.
* Refresh and remove unneccesary patches.
* Add Build-Depends on libsurefire-java and
  libmaven-common-artifact-filters-java.
* Drop outdated Maven artifact surefire-junit.
* Provide new Maven artifacts: surefire-junit3, maven-surefire-common,
  common-junit3, common-junit4, surefire-junit47 and surefire-testng-utils.
* Fix clean target to allow "two in a row" builds.
* Update Vcs-Browser field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package runListener;
 
2
 
 
3
import java.io.File;
 
4
import java.io.FileWriter;
 
5
import java.io.IOException;
 
6
 
 
7
public class FileHelper
 
8
{
 
9
    public static void writeFile( String fileName, String content )
 
10
    {
 
11
        try
 
12
        {
 
13
            File target = new File( "target" ).getAbsoluteFile();
 
14
            File listenerOutput = new File( target, fileName );
 
15
            FileWriter out = new FileWriter( listenerOutput );
 
16
            out.write( content );
 
17
            out.flush();
 
18
            out.close();
 
19
        }
 
20
        catch ( IOException e )
 
21
        {
 
22
            throw new RuntimeException( e );
 
23
        }
 
24
    }
 
25
}