|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
MyCodeTest.java | - | 0% | 0% | 0% |
|
1 |
package example;
|
|
2 |
|
|
3 |
import java.io.File;
|
|
4 |
|
|
5 |
import junit.extensions.abbot.*;
|
|
6 |
import junit.framework.Test;
|
|
7 |
//import junit.textui.TestRunner;
|
|
8 |
//import junit.ui.TestRunner;
|
|
9 |
//import junit.swingui.TestRunner;
|
|
10 |
|
|
11 |
/** Simple example of a ScriptTestSuite. Selects all scripts of the form
|
|
12 |
* MyCode-[0-9]*.xml.
|
|
13 |
*/
|
|
14 |
public class MyCodeTest extends ScriptFixture { |
|
15 |
|
|
16 |
/** Name is the name of a script filename. */
|
|
17 | 0 |
public MyCodeTest(String name) {
|
18 | 0 |
super(name);
|
19 |
} |
|
20 |
|
|
21 |
/** Return the set of scripts we want to run. */
|
|
22 | 0 |
public static Test suite() { |
23 | 0 |
return new ScriptTestSuite(MyCodeTest.class, "src/example") { |
24 |
/** Determine whether the given script should be included. */
|
|
25 | 0 |
public boolean accept(File file) { |
26 | 0 |
String name = file.getName(); |
27 | 0 |
return name.startsWith("MyCode-") |
28 |
&& Character.isDigit(name.charAt(7)) |
|
29 |
&& name.endsWith(".xml");
|
|
30 |
} |
|
31 |
}; |
|
32 |
} |
|
33 |
|
|
34 | 0 |
public static void main(String[] args) { |
35 | 0 |
TestHelper.runTests(args, MyCodeTest.class);
|
36 |
} |
|
37 |
} |
|
38 |
|
|