|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.specrunner.junit.SpecRunnerParametrized
public abstract class SpecRunnerParametrized
JUnit parametrized test helper. Example of use:
public class TestParametrized extends SpecRunnerParametrized {
public TestParametrized(Entry entry) {
super(entry);
}
// JUnit annotation
@SuppressWarnings("unchecked")
@Parameters
public static Collection<Object[]> getTestFiles() {
File inDir = new File("src/test/resources/sources"); // input directory
File outDir = new File("src/test/resources/out"); // output directory
// files ending with 'e.html' OR starting with 'cust' OR containing 'st'
return merge(endsWith(inDir, "e.html", outDir), startsWith(inDir, "cust", outDir), contains(inDir, "st", outDir));
}
}
| Nested Class Summary | |
|---|---|
protected static class |
SpecRunnerParametrized.Entry
A execution mapping. |
| Constructor Summary | |
|---|---|
protected |
SpecRunnerParametrized(SpecRunnerParametrized.Entry entry)
Creates a instance by entry. |
| Method Summary | |
|---|---|
protected static Collection<Object[]> |
contains(File inDir,
String suffix,
File outDir)
Filter files containing a string. |
protected static Collection<Object[]> |
contains(File inDir,
String suffix,
File outDir,
IConfiguration cfg)
Filter files containing a string. |
protected static Collection<Object[]> |
endsWith(File inDir,
String suffix,
File outDir)
Filter files ending with. |
protected static Collection<Object[]> |
endsWith(File inDir,
String suffix,
File outDir,
IConfiguration cfg)
Filter files ending with. |
protected static Collection<Object[]> |
filter(File inDir,
String str,
org.specrunner.junit.SpecRunnerParametrized.Filter filter,
File outDir,
IConfiguration cfg)
Generic filter method. |
protected static Collection<Object[]> |
merge(Collection<Object[]>... lists)
Merge to different collections. |
void |
run()
Runs a specification. |
protected static Collection<Object[]> |
startsWith(File inDir,
String prefix,
File outDir)
Filter files starting with. |
protected static Collection<Object[]> |
startsWith(File inDir,
String prefix,
File outDir,
IConfiguration cfg)
Filter files starting with. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SpecRunnerParametrized(SpecRunnerParametrized.Entry entry)
entry - The entry.| Method Detail |
|---|
public void run()
protected static Collection<Object[]> startsWith(File inDir,
String prefix,
File outDir)
inDir - Base directory.prefix - Prefix.outDir - The output directory.
protected static Collection<Object[]> startsWith(File inDir,
String prefix,
File outDir,
IConfiguration cfg)
inDir - Base directory.prefix - Prefix.outDir - The output directory.cfg - A configuration.
protected static Collection<Object[]> contains(File inDir,
String suffix,
File outDir)
inDir - The base directory.suffix - The suffix.outDir - The output directory.
protected static Collection<Object[]> contains(File inDir,
String suffix,
File outDir,
IConfiguration cfg)
inDir - The base directory.suffix - The suffix.outDir - The output directory.cfg - A configuration.
protected static Collection<Object[]> endsWith(File inDir,
String suffix,
File outDir)
inDir - The base directory.suffix - The suffix.outDir - The output directory.
protected static Collection<Object[]> endsWith(File inDir,
String suffix,
File outDir,
IConfiguration cfg)
inDir - The base directory.suffix - The suffix.outDir - The output directory.cfg - A configuration.
protected static Collection<Object[]> filter(File inDir,
String str,
org.specrunner.junit.SpecRunnerParametrized.Filter filter,
File outDir,
IConfiguration cfg)
inDir - Base directory.str - String.filter - The filter type.outDir - The output directory.cfg - A configuration.
protected static Collection<Object[]> merge(Collection<Object[]>... lists)
lists - The lists.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||