Unit test for CVotingAgentGenerator.
More...
Inherits TestCase.
org.lightvoting.simulation.agent.CVotingAgentGeneratorTest.CVotingAgentGeneratorTest |
( |
final String |
p_testName | ) |
|
static Test org.lightvoting.simulation.agent.CVotingAgentGeneratorTest.suite |
( |
| ) |
|
|
static |
- Returns
- the suite of tests being tested
Definition at line 60 of file CVotingAgentGeneratorTest.java.
CVotingAgentGeneratorTest(final String p_testName)
Create the test case.
void org.lightvoting.simulation.agent.CVotingAgentGeneratorTest.testCVotingAgent |
( |
| ) |
|
Definition at line 68 of file CVotingAgentGeneratorTest.java.
72 final InputStream l_aslstream =
new ByteArrayInputStream(
73 "!main.\n+!main.".getBytes(
"UTF-8" )
76 final CSend l_sendaction =
new CSend();
79 final Set<CVotingAgent> l_agents =
new
81 CVotingAgent.CVotingAgentGenerator( l_sendaction, l_aslstream,
new CEnvironment( 23,
"foo.h5" ), 10,
"RANDOM",
"foo.h5" )
82 .generatemultiple( 23,
new CChairAgent.CChairAgentGenerator( l_aslstream,
new CEnvironment( 23,
"foo.h5" ),
"RANDOM",
"BASIC",
85 .collect( Collectors.toSet() );
87 assertEquals( 23, l_agents.size() );
89 l_agents.forEach( i ->
91 assertTrue( i instanceof CVotingAgent );
92 assertTrue( i instanceof IAgent );
95 catch (
final Exception l_exception )
97 l_exception.printStackTrace();