-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: refactor the way that All Literal Amplifiers are done, it is now a specific Amplifier, rather than a list * fix: remove type cast when removing assertions * test: add a test of amplification on one class two method cf #352 * test: fix oracle in test One Class Two Methods
- Loading branch information
Showing
4 changed files
with
102 additions
and
31 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
dspot/src/main/java/fr/inria/diversify/dspot/amplifier/AllLiteralAmplifiers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package fr.inria.diversify.dspot.amplifier; | ||
|
||
import spoon.reflect.declaration.CtMethod; | ||
import spoon.reflect.declaration.CtType; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* Created by Benjamin DANGLOT | ||
* benjamin.danglot@inria.fr | ||
* on 07/03/18 | ||
*/ | ||
public class AllLiteralAmplifiers implements Amplifier { | ||
|
||
private List<Amplifier> literalAmplifiers; | ||
|
||
public AllLiteralAmplifiers() { | ||
this.literalAmplifiers = Arrays.asList( | ||
new StringLiteralAmplifier(), | ||
new NumberLiteralAmplifier(), | ||
new BooleanLiteralAmplifier(), | ||
new CharLiteralAmplifier() | ||
); | ||
} | ||
|
||
@Override | ||
public List<CtMethod> apply(CtMethod testMethod) { | ||
return this.literalAmplifiers.stream() | ||
.flatMap(amplifier -> amplifier.apply(testMethod).stream()) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
@Override | ||
public void reset(CtType testClass) { | ||
this.literalAmplifiers.forEach(amplifier -> amplifier.reset(testClass)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters