-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
138 additions
and
23 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
19 changes: 19 additions & 0 deletions
19
pitest/src/main/java/org/pitest/mutationtest/engine/gregor/AnnotationInfo.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,19 @@ | ||
package org.pitest.mutationtest.engine.gregor; | ||
|
||
public class AnnotationInfo { | ||
private final String descriptor; | ||
private final boolean visible; | ||
|
||
public AnnotationInfo(String descriptor, boolean visible) { | ||
this.descriptor = descriptor; | ||
this.visible = visible; | ||
} | ||
|
||
public String descriptor() { | ||
return descriptor; | ||
} | ||
|
||
public boolean isVisible() { | ||
return visible; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
pitest/src/main/java/org/pitest/mutationtest/engine/gregor/BasicContext.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,12 @@ | ||
package org.pitest.mutationtest.engine.gregor; | ||
|
||
import org.pitest.mutationtest.engine.MutationIdentifier; | ||
|
||
public interface BasicContext { | ||
|
||
ClassInfo getClassInfo(); | ||
|
||
void registerMutation(MutationIdentifier id, String description); | ||
|
||
boolean shouldMutate(MutationIdentifier newId); | ||
} |
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
32 changes: 32 additions & 0 deletions
32
pitest/src/main/java/org/pitest/mutationtest/engine/gregor/NoMethodContext.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,32 @@ | ||
package org.pitest.mutationtest.engine.gregor; | ||
|
||
import org.pitest.mutationtest.engine.MutationDetails; | ||
import org.pitest.mutationtest.engine.MutationIdentifier; | ||
|
||
public class NoMethodContext implements BasicContext { | ||
|
||
private final ClassContext context; | ||
|
||
public NoMethodContext(ClassContext context) { | ||
this.context = context; | ||
} | ||
|
||
@Override | ||
public ClassInfo getClassInfo() { | ||
return context.getClassInfo(); | ||
} | ||
|
||
@Override | ||
public void registerMutation(MutationIdentifier id, String description) { | ||
registerMutation(new MutationDetails(id, context.getFileName(), description,0, 1)); | ||
} | ||
|
||
@Override | ||
public boolean shouldMutate(MutationIdentifier id) { | ||
return this.context.shouldMutate(id); | ||
} | ||
|
||
private void registerMutation(MutationDetails details) { | ||
this.context.addMutation(details); | ||
} | ||
} |