Search in sources :

Example 11 with StringPrimitiveStatement

use of org.evosuite.testcase.statements.StringPrimitiveStatement in project evosuite by EvoSuite.

the class NeighbourhoodTest method constructPopulation.

public void constructPopulation() {
    Properties.POPULATION = 16;
    TestSuiteChromosome[] testSuiteChromObjects = new TestSuiteChromosome[Properties.POPULATION];
    for (int i = 0; i < testSuiteChromObjects.length; i++) {
        testSuiteChromObjects[i] = new TestSuiteChromosome();
        DefaultTestCase testcase = new DefaultTestCase();
        StringPrimitiveStatement stringStatement = new StringPrimitiveStatement(testcase, "any string statatement for TS" + i);
        testcase.addStatement(stringStatement);
        testSuiteChromObjects[i].addTest(testcase);
        population.add(testSuiteChromObjects[i]);
    }
}
Also used : StringPrimitiveStatement(org.evosuite.testcase.statements.StringPrimitiveStatement) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) DefaultTestCase(org.evosuite.testcase.DefaultTestCase)

Aggregations

StringPrimitiveStatement (org.evosuite.testcase.statements.StringPrimitiveStatement)11 VariableReference (org.evosuite.testcase.variable.VariableReference)7 GenericMethod (org.evosuite.utils.generic.GenericMethod)6 DefaultTestCase (org.evosuite.testcase.DefaultTestCase)5 MethodStatement (org.evosuite.testcase.statements.MethodStatement)5 Method (java.lang.reflect.Method)4 GenericConstructor (org.evosuite.utils.generic.GenericConstructor)4 Test (org.junit.Test)4 ConstructorStatement (org.evosuite.testcase.statements.ConstructorStatement)3 Statement (org.evosuite.testcase.statements.Statement)3 TestSuiteChromosome (org.evosuite.testsuite.TestSuiteChromosome)3 DseBar (com.examples.with.different.packagename.localsearch.DseBar)2 DseFoo (com.examples.with.different.packagename.localsearch.DseFoo)2 BranchCoverageSuiteFitness (org.evosuite.coverage.branch.BranchCoverageSuiteFitness)2 DefaultLocalSearchObjective (org.evosuite.ga.localsearch.DefaultLocalSearchObjective)2 EvoServletConfig (org.evosuite.runtime.javaee.javax.servlet.EvoServletConfig)2 EvoServletState (org.evosuite.runtime.javaee.javax.servlet.EvoServletState)2 EvosuiteError (org.evosuite.testcase.execution.EvosuiteError)2 TestSuiteLocalSearch (org.evosuite.testsuite.localsearch.TestSuiteLocalSearch)2 GenericClass (org.evosuite.utils.generic.GenericClass)2