protected void backup(TestChromosome test) { backup = (TestChromosome) test.clone(); }
return randomSolution == null ? null : (T) randomSolution.clone();
@Override public Chromosome clone() { RegressionTestChromosome copy = new RegressionTestChromosome(); copy.theClassLoader = TestGenerationContext.getInstance() .getRegressionClassLoaderForSUT(); // I don't think this should be a member of this class to be honest! copy.theTest = (TestChromosome) theTest.clone(); copy.theSameTestForTheOtherClassLoader = (TestChromosome) theSameTestForTheOtherClassLoader .clone(); copy.setFitnessValues(getFitnessValues()); copy.diversityMap.putAll(diversityMap); copy.exCommentsAdded = exCommentsAdded; return copy; }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public T getRandomSolution() { // TODO this gives higher probability to tests that cover more targets. Maybe it is not the best // way, but likely the quickest to compute. A proper way to do it would be to first call // 'getSolutions' and only then select one at random. T randomChoice = Randomness.choice(this.getSolutions()); if (randomChoice == null) { return null; } return (T) randomChoice.clone(); }
/** * Retrieve the path condition for a given test case * * @param test * a {@link org.evosuite.testcase.TestChromosome} object. * @return a {@link java.util.List} object. */ public static List<BranchCondition> getSymbolicPath(TestChromosome test) { TestChromosome dscCopy = (TestChromosome) test.clone(); DefaultTestCase defaultTestCase = (DefaultTestCase) dscCopy.getTestCase(); PathCondition pathCondition = executeConcolic(defaultTestCase); return pathCondition.getBranchConditions(); }
solutionsSampledFromArchive.add(t); T tClone = (T) t.clone(); mergedSolution.addTest(tClone);
int count = entry.getValue(); if (count == 1) { TestChromosome duplicate = (TestChromosome) testMap.get(branchId).clone(); ExecutionResult result = duplicate.executeForFitnessFunction(defaultFitness);
/** * */ protected void updateClassloader() { if (theTest.isChanged()) { theSameTestForTheOtherClassLoader = (TestChromosome) theTest.clone(); ((DefaultTestCase) theSameTestForTheOtherClassLoader.getTestCase()) .changeClassLoader(TestGenerationContext.getInstance().getRegressionClassLoaderForSUT()); } }
TestChromosome clone = (TestChromosome) tc.clone();
TestChromosome clonedTest = (TestChromosome) test.clone(); suite.addTest(clonedTest); final int lastIndex = suite.size() - 1;
int notChanged = 0; for(int i = 0; i < 10000; i++) { TestChromosome testNew = (TestChromosome) test1.clone(); testNew.mutate(); if(testNew.isChanged()) {
int notChanged = 0; for(int i = 0; i < 10000; i++) { TestChromosome testNew = (TestChromosome) test1.clone(); testNew.mutate(); if(testNew.isChanged()) {
int notChanged = 0; for(int i = 0; i < 10000; i++) { TestChromosome testNew = (TestChromosome) test1.clone(); testNew.mutate(); if(testNew.isChanged()) {
System.out.println("Original: "+test1); for(int i = 0; i < 100; i++) { TestChromosome testNew = (TestChromosome) test1.clone(); testNew.mutate(); if(testNew.isChanged()) {
int notChanged = 0; for(int i = 0; i < 10000; i++) { TestChromosome testNew = (TestChromosome) test1.clone(); testNew.mutate(); if(testNew.isChanged()) {