-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed TestReportItemOutputConsumer added incomplete test for ReportsTestPluginFactory * Completed test of ReportsTestPluginFactory * Completed test of ReportsTestPluginFactory * Documented test of ReportsTestPluginFactory --------- Co-authored-by: Shawn <[email protected]>
- Loading branch information
1 parent
0e9ae8d
commit 425b29e
Showing
3 changed files
with
44 additions
and
233 deletions.
There are no files selected for viewing
66 changes: 0 additions & 66 deletions
66
gcm4/src/main/java/plugins/reports/testsupport/TestReportItemOutputConsumer.java
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
gcm4/src/test/java/plugins/reports/testsupport/AT_ReportsTestPluginFactory.java
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,44 @@ | ||
package plugins.reports.testsupport; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.function.Consumer; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import nucleus.Plugin; | ||
import nucleus.Simulation; | ||
import tools.annotations.UnitTestMethod; | ||
import util.wrappers.MutableBoolean; | ||
|
||
public class AT_ReportsTestPluginFactory { | ||
|
||
@Test | ||
@UnitTestMethod(target = ReportsTestPluginFactory.class, name = "getPluginFromReport", args = { Consumer.class }) | ||
public void testGetPluginFromReport() { | ||
|
||
/* | ||
* Create a boolean defaulted to false. | ||
*/ | ||
MutableBoolean executed = new MutableBoolean(); | ||
|
||
/* | ||
* Create a report and get the corresponding plugin. if the report was | ||
* added then it should get executed by a simulation and the boolean | ||
* will be set to true. | ||
*/ | ||
Plugin plugin = ReportsTestPluginFactory.getPluginFromReport((c) -> executed.setValue(true)); | ||
|
||
/* | ||
* Execute a simulation with the plugin. | ||
*/ | ||
Simulation.builder().addPlugin(plugin).build().execute(); | ||
|
||
/* | ||
* Show that the report executed and thus must have been properly added | ||
* to the plugin. | ||
*/ | ||
assertTrue(executed.getValue()); | ||
} | ||
|
||
} |
167 changes: 0 additions & 167 deletions
167
gcm4/src/test/java/plugins/reports/testsupport/AT_TestReportItemOutputConsumer.java
This file was deleted.
Oops, something went wrong.