public abstract class SpecRunnerParametrized extends Object
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));
}
}
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SpecRunnerParametrized.Entry
A execution mapping.
|
| Modifier and Type | Field and Description |
|---|---|
protected SpecRunnerParametrized.Entry |
entry
File entry.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SpecRunnerParametrized(SpecRunnerParametrized.Entry entry)
Creates a instance by entry.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected final SpecRunnerParametrized.Entry entry
protected SpecRunnerParametrized(SpecRunnerParametrized.Entry entry)
entry - The entry.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.Copyright © 2016. All rights reserved.