-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: rename MethodAdd to MethodDuplicationAmplifier and MethodGenerator to MethodAdderOnExistingObjectsAmplifier * doc: update documentation with new values
- Loading branch information
Showing
12 changed files
with
62 additions
and
50 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,19 +24,19 @@ | |
* [email protected] | ||
* on 19/07/18 | ||
*/ | ||
public class MethodGeneratorAmplifierTest extends AbstractTest { | ||
public class MethodAdderOnExistingObjectsAmplifierTest extends AbstractTest { | ||
|
||
@Test | ||
public void testInLoop() throws Exception { | ||
|
||
/* | ||
Test that MethodGeneratorAmplifier amplifier is able to add statement inside a loop if this loop has not brackets | ||
Test that MethodAdderOnExistingObjectsAmplifier amplifier is able to add statement inside a loop if this loop has not brackets | ||
*/ | ||
|
||
final String packageName = "fr.inria.statementadd"; | ||
final Factory factory = Utils.getFactory(); | ||
RandomHelper.setSeedRandom(32L); | ||
MethodGeneratorAmplifier amplifier = new MethodGeneratorAmplifier(); | ||
MethodAdderOnExistingObjectsAmplifier amplifier = new MethodAdderOnExistingObjectsAmplifier(); | ||
amplifier.reset(factory.Class().get(packageName + ".ClassTarget")); | ||
|
||
CtMethod<?> ctMethod = Utils.findMethod(factory.Class().get(packageName + ".TestClassTarget"), "testWithLoop"); | ||
|
@@ -61,13 +61,13 @@ public void testInLoop() throws Exception { | |
public void testOnClassWithJavaObjects() throws Exception { | ||
|
||
/* | ||
Test that the MethodGeneratorAmplifier amplifier is able to generate, and manage Collection and Map from java.util | ||
Test that the MethodAdderOnExistingObjectsAmplifier amplifier is able to generate, and manage Collection and Map from java.util | ||
*/ | ||
|
||
final String packageName = "fr.inria.statementadd"; | ||
final Factory factory = Utils.getFactory(); | ||
RandomHelper.setSeedRandom(32L); | ||
MethodGeneratorAmplifier amplifier = new MethodGeneratorAmplifier(); | ||
MethodAdderOnExistingObjectsAmplifier amplifier = new MethodAdderOnExistingObjectsAmplifier(); | ||
amplifier.reset(factory.Class().get(packageName + ".ClassTarget")); | ||
|
||
CtMethod<?> ctMethod = Utils.findMethod(factory.Class().get(packageName + ".TestClassTarget"), "test"); | ||
|
@@ -97,7 +97,7 @@ public void testStatementAddOnArrayObjects() throws Exception { | |
final String packageName = "fr.inria.statementaddarray"; | ||
final Factory factory = Utils.getFactory(); | ||
RandomHelper.setSeedRandom(32L); | ||
MethodGeneratorAmplifier amplifier = new MethodGeneratorAmplifier(); | ||
MethodAdderOnExistingObjectsAmplifier amplifier = new MethodAdderOnExistingObjectsAmplifier(); | ||
amplifier.reset(factory.Class().get(packageName + ".ClassTargetAmplify")); | ||
|
||
CtMethod<?> ctMethod = Utils.findMethod(factory.Class().get(packageName + ".TestClassTargetAmplify"), "test"); | ||
|
@@ -128,7 +128,7 @@ public void testStatementAddOnUnderTest() throws Exception { | |
CtClass<Object> ctClass = factory.Class().get("fr.inria.mutation.ClassUnderTestTest"); | ||
RandomHelper.setSeedRandom(23L); | ||
|
||
MethodGeneratorAmplifier amplifier = new MethodGeneratorAmplifier(); | ||
MethodAdderOnExistingObjectsAmplifier amplifier = new MethodAdderOnExistingObjectsAmplifier(); | ||
amplifier.reset(ctClass); | ||
|
||
CtMethod originalMethod = Utils.findMethod(ctClass, "testLit"); | ||
|
@@ -166,7 +166,7 @@ public void testStatementAdd() throws Exception { | |
final String packageName = "fr.inria.statementadd"; | ||
final Factory factory = Utils.getFactory(); | ||
RandomHelper.setSeedRandom(42L); | ||
MethodGeneratorAmplifier amplifier = new MethodGeneratorAmplifier(); | ||
MethodAdderOnExistingObjectsAmplifier amplifier = new MethodAdderOnExistingObjectsAmplifier(); | ||
amplifier.reset(factory.Class().get(packageName + ".TestClassTargetAmplify")); | ||
|
||
CtMethod<?> ctMethod = Utils.findMethod(factory.Class().get(packageName + ".TestClassTargetAmplify"), "test"); | ||
|
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
* [email protected] | ||
* on 12/7/16 | ||
*/ | ||
public class TestMethodCallAdderTest extends AbstractTest { | ||
public class TestMethodCallAdder extends AbstractTest { | ||
|
||
@Test | ||
public void testMethodCallAddOnInvocationWithCast() { | ||
|
@@ -30,7 +30,7 @@ In case of the invocation has type cast(s), we need to remove them. | |
|
||
CtClass<Object> testClass = Utils.getFactory().Class().get("fr.inria.mutation.ClassUnderTestTest"); | ||
|
||
TestMethodCallAdder methodCallAdder = new TestMethodCallAdder(); | ||
MethodDuplicationAmplifier methodCallAdder = new MethodDuplicationAmplifier(); | ||
methodCallAdder.reset(testClass); | ||
|
||
final CtMethod<?> originalMethod = testClass.getMethods().stream().filter(m -> "testWithCast".equals(m.getSimpleName())).findFirst().get(); | ||
|
@@ -48,7 +48,7 @@ public void testMethodCallAddAll() throws Exception { | |
|
||
CtClass<Object> testClass = Utils.getFactory().Class().get("fr.inria.mutation.ClassUnderTestTest"); | ||
|
||
TestMethodCallAdder methodCallAdder = new TestMethodCallAdder(); | ||
MethodDuplicationAmplifier methodCallAdder = new MethodDuplicationAmplifier(); | ||
methodCallAdder.reset(testClass); | ||
|
||
final CtMethod<?> originalMethod = testClass.getMethods().stream().filter(m -> "testAddCall".equals(m.getSimpleName())).findFirst().get(); | ||
|
@@ -70,7 +70,7 @@ public void testMethodCallAddAll() throws Exception { | |
@Test | ||
public void testAddInIf() throws Exception { | ||
CtClass<Object> testClass = Utils.getFactory().Class().get("fr.inria.mutation.ClassUnderTestTest"); | ||
TestMethodCallAdder methodCallAdder = new TestMethodCallAdder(); | ||
MethodDuplicationAmplifier methodCallAdder = new MethodDuplicationAmplifier(); | ||
methodCallAdder.reset(testClass); | ||
final CtMethod<?> originalMethod = Utils.findMethod(testClass, "testWithIf"); | ||
final Stream<CtMethod<?>> amplify = methodCallAdder.amplify(originalMethod, 0); | ||
|
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