Search in sources :

Example 1 with SimpleInputAmplDistributor

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

the class SimpleInputAmplDistributorTest method test.

@Test
public void test() throws Exception {
    /*
            Test the simple input_ampl_distributor with different amplifier.
            The SimpleBudget should always provide a specific number of test Methods
         */
    final CtClass<?> testClass = findClass("fr.inria.statementadd.TestClassTargetAmplify");
    List<CtMethod<?>> ctMethods = TestFramework.getAllTest(testClass);
    final SimpleInputAmplDistributor simpleBudgetizer = new SimpleInputAmplDistributor(6, Arrays.asList(new IterationDecoratorAmplifier(new ReturnValueAmplifier(), 3), new IterationDecoratorAmplifier(new MethodAdderOnExistingObjectsAmplifier(), 2), new NumberLiteralAmplifier()));
    for (int i = 0; i < 3; i++) {
        // !
        ctMethods = simpleBudgetizer.inputAmplify(ctMethods, i);
    }
    assertEquals(6, ctMethods.size());
}
Also used : MethodAdderOnExistingObjectsAmplifier(eu.stamp_project.dspot.amplifier.amplifiers.MethodAdderOnExistingObjectsAmplifier) SimpleInputAmplDistributor(eu.stamp_project.dspot.amplifier.SimpleInputAmplDistributor) CtMethod(spoon.reflect.declaration.CtMethod) IterationDecoratorAmplifier(eu.stamp_project.dspot.amplifier.amplifiers.IterationDecoratorAmplifier) ReturnValueAmplifier(eu.stamp_project.dspot.amplifier.amplifiers.ReturnValueAmplifier) NumberLiteralAmplifier(eu.stamp_project.dspot.amplifier.amplifiers.NumberLiteralAmplifier) Test(org.junit.Test)

Aggregations

SimpleInputAmplDistributor (eu.stamp_project.dspot.amplifier.SimpleInputAmplDistributor)1 IterationDecoratorAmplifier (eu.stamp_project.dspot.amplifier.amplifiers.IterationDecoratorAmplifier)1 MethodAdderOnExistingObjectsAmplifier (eu.stamp_project.dspot.amplifier.amplifiers.MethodAdderOnExistingObjectsAmplifier)1 NumberLiteralAmplifier (eu.stamp_project.dspot.amplifier.amplifiers.NumberLiteralAmplifier)1 ReturnValueAmplifier (eu.stamp_project.dspot.amplifier.amplifiers.ReturnValueAmplifier)1 Test (org.junit.Test)1 CtMethod (spoon.reflect.declaration.CtMethod)1