Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
107 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package fitnesse.reporting; | ||
|
||
import fitnesse.testrunner.WikiTestPage; | ||
import fitnesse.testsystems.TestSystemListener; | ||
|
||
/** | ||
* This factory is instantiated as FitNesse component, hence can use constructor arguments. | ||
* | ||
* Optionally implement java.io.Closeable and/or fitnesse.testrunner.TestsRunnerListener. | ||
*/ | ||
public interface Formatter extends TestSystemListener<WikiTestPage> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package fitnesse.reporting; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import fitnesse.components.ComponentFactory; | ||
|
||
public class FormatterFactory implements FormatterRegistry { | ||
|
||
|
||
private final ComponentFactory componentFactory; | ||
private List<Class<? extends Formatter>> formatters; | ||
|
||
public FormatterFactory(ComponentFactory componentFactory) { | ||
this.componentFactory = componentFactory; | ||
formatters = new ArrayList<Class<? extends Formatter>>(); | ||
} | ||
|
||
@Override | ||
public void registerFormatter(Class<? extends Formatter> formatter) { | ||
formatters.add(formatter); | ||
} | ||
|
||
public Formatter[] createFormatters() { | ||
Formatter[] instances = new Formatter[formatters.size()]; | ||
for (int i = 0; i < formatters.size(); i++) { | ||
instances[i] = componentFactory.createComponent(formatters.get(i)); | ||
} | ||
return instances; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package fitnesse.reporting; | ||
|
||
public interface FormatterRegistry { | ||
void registerFormatter(Class<? extends Formatter> formatter); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters