use of org.evosuite.rmi.service.ClientNodeLocal in project evosuite by EvoSuite.
the class ServicesTest method testMasterClientCommunication.
@Test
public void testMasterClientCommunication() throws Exception {
MasterServices master = new MasterServices();
master.startRegistry();
master.registerServices();
Properties.PROCESS_COMMUNICATION_PORT = master.getRegistryPort();
ClientServices clients = new ClientServices();
clients.registerServices();
ClientNodeLocal clientNode = clients.getClientNode();
clientNode.changeState(ClientState.STARTED);
MasterNodeLocal masterNode = master.getMasterNode();
String summary = masterNode.getSummaryOfClientStatuses();
Assert.assertNotNull(summary);
Assert.assertTrue("summary=" + summary, summary.contains(ClientState.STARTED.toString()));
}
use of org.evosuite.rmi.service.ClientNodeLocal in project evosuite by EvoSuite.
the class JUnitTestCarvedChromosomeFactory method readTestCases.
private void readTestCases() throws IllegalStateException {
CarvingManager manager = CarvingManager.getInstance();
final Class<?> targetClass = Properties.getTargetClassAndDontInitialise();
List<TestCase> tests = manager.getTestsForClass(targetClass);
junitTests.addAll(tests);
if (junitTests.size() > 0) {
totalNumberOfTestsCarved = junitTests.size();
LoggingUtils.getEvoLogger().info("* Using {} carved tests from existing JUnit tests for seeding", junitTests.size());
if (logger.isDebugEnabled()) {
for (TestCase test : junitTests) {
logger.debug("Carved Test: {}", test.toCode());
}
}
TestSuiteChromosome suite = new TestSuiteChromosome();
for (TestCase test : junitTests) {
suite.addTest(test);
}
for (Properties.Criterion pc : Properties.CRITERION) {
TestSuiteFitnessFunction f = FitnessFunctions.getFitnessFunction(pc);
f.getFitness(suite);
}
carvedCoverage = suite.getCoverage();
}
ClientNodeLocal client = ClientServices.getInstance().getClientNode();
client.trackOutputVariable(RuntimeVariable.CarvedTests, totalNumberOfTestsCarved);
client.trackOutputVariable(RuntimeVariable.CarvedCoverage, carvedCoverage);
}
Aggregations