01: package test.convert;
02:
03: import java.io.File;
04:
05: import org.testng.junit.JUnitDirectoryConverter;
06:
07: /**
08: * Test unit for JUnitDirectoryConverter
09: *
10: * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
11: */
12: public class JUnitConverterTest {
13: private File m_output;
14:
15: /**
16: * @testng.test parameters="inputDir"
17: */
18: public void convert(String inputDir) {
19: File inputDirFile = new File(inputDir);
20: m_output = new File(inputDir, "generated");
21: m_output.mkdirs();
22:
23: JUnitDirectoryConverter convertor = new JUnitDirectoryConverter(
24: inputDirFile, m_output, "1.4", false, null);
25:
26: int result = convertor.convert();
27: assert 2 == result : "Expected number of tests 2, found "
28: + result;
29: }
30:
31: /**
32: * @testng.after-method
33: */
34: public void clean() {
35: File[] files = m_output.listFiles();
36:
37: for (int i = 0; i < files.length; i++) {
38: files[i].delete();
39: }
40:
41: m_output.delete();
42: }
43: }
|