Search in sources :

Example 1 with CharLiteralAmplifier

use of eu.stamp_project.dspot.amplifier.amplifiers.CharLiteralAmplifier in project dspot by STAMP-project.

the class CharacterLiteralAmplifierTest method testAmplify.

@Test
public void testAmplify() {
    final String nameMethod = "methodCharacter";
    amplifier.reset(literalMutationClass);
    CtClass<Object> literalMutationClass = launcher.getFactory().Class().get("fr.inria.amp.LiteralMutation");
    RandomHelper.setSeedRandom(42L);
    Amplifier mutator = new CharLiteralAmplifier();
    mutator.reset(literalMutationClass);
    CtMethod method = literalMutationClass.getMethod(nameMethod);
    List<CtMethod> mutantMethods = amplifier.amplify(method, 0).collect(Collectors.toList());
    assertEquals(6, mutantMethods.size());
}
Also used : CharLiteralAmplifier(eu.stamp_project.dspot.amplifier.amplifiers.CharLiteralAmplifier) Amplifier(eu.stamp_project.dspot.amplifier.amplifiers.Amplifier) CharLiteralAmplifier(eu.stamp_project.dspot.amplifier.amplifiers.CharLiteralAmplifier) CtMethod(spoon.reflect.declaration.CtMethod) Test(org.junit.Test)

Example 2 with CharLiteralAmplifier

use of eu.stamp_project.dspot.amplifier.amplifiers.CharLiteralAmplifier in project dspot by STAMP-project.

the class CharacterLiteralAmplifierTest method setup.

@Before
public void setup() throws Exception {
    super.setUp();
    literalMutationClass = findClass("fr.inria.amp.LiteralMutation");
    RandomHelper.setSeedRandom(42L);
    amplifier = new CharLiteralAmplifier();
}
Also used : CharLiteralAmplifier(eu.stamp_project.dspot.amplifier.amplifiers.CharLiteralAmplifier) Before(org.junit.Before)

Aggregations

CharLiteralAmplifier (eu.stamp_project.dspot.amplifier.amplifiers.CharLiteralAmplifier)2 Amplifier (eu.stamp_project.dspot.amplifier.amplifiers.Amplifier)1 Before (org.junit.Before)1 Test (org.junit.Test)1 CtMethod (spoon.reflect.declaration.CtMethod)1