Search in sources :

Example 1 with ClientNodeLocal

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()));
}
Also used : ClientNodeLocal(org.evosuite.rmi.service.ClientNodeLocal) MasterNodeLocal(org.evosuite.rmi.service.MasterNodeLocal) Test(org.junit.Test)

Example 2 with ClientNodeLocal

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);
}
Also used : CarvingManager(org.evosuite.testcarver.extraction.CarvingManager) TestCase(org.evosuite.testcase.TestCase) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) TestSuiteFitnessFunction(org.evosuite.testsuite.TestSuiteFitnessFunction) ClientNodeLocal(org.evosuite.rmi.service.ClientNodeLocal) Properties(org.evosuite.Properties)

Aggregations

ClientNodeLocal (org.evosuite.rmi.service.ClientNodeLocal)2 Properties (org.evosuite.Properties)1 MasterNodeLocal (org.evosuite.rmi.service.MasterNodeLocal)1 CarvingManager (org.evosuite.testcarver.extraction.CarvingManager)1 TestCase (org.evosuite.testcase.TestCase)1 TestSuiteChromosome (org.evosuite.testsuite.TestSuiteChromosome)1 TestSuiteFitnessFunction (org.evosuite.testsuite.TestSuiteFitnessFunction)1 Test (org.junit.Test)1