aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/junit/AllTests.java
blob: fb38787b0b51290a994c2de602cf8029550d2a05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package uk.ac.ox.cs.pagoda.junit;

import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({ PagodaUOBM.class
	})
public class AllTests {

	public static void copy(String source, String dest) {
	    InputStream is = null;
	    OutputStream os = null;
	    try {
	        is = new FileInputStream(source);
	        os = new FileOutputStream(dest);
	        byte[] buffer = new byte[1024];
	        int length;
	        while ((length = is.read(buffer)) > 0) {
	            os.write(buffer, 0, length);
	        }
	        is.close();
	        os.close();
	        
		    BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(source))); 
		    writer.write("");
		    writer.close();
	    } catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}	
	    
//	    File src = new File(source);
//	    src.delete(); 
	}
	
}