Skip to content

Commit d6d0ba2

Browse files
committed
cleanup
1 parent f579dd5 commit d6d0ba2

File tree

14 files changed

+57
-219
lines changed

14 files changed

+57
-219
lines changed

bundles/org.pitest.pitclipse.core/src/org/pitest/pitclipse/core/Mutators.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ public enum Mutators {
5555
REMOVE_INCREMENTS("Remove Increments", "Removes local variable increments"),
5656
EXPERIMENTAL_ARGUMENT_PROPAGATION("Experimentation Argument Propagation", "Replaces method call with one of its parameters of matching type"),
5757
EXPERIMENTAL_BIG_INTEGER("Experimental Big Integer", "Swaps big integer methods"),
58-
EXPERIMENTAL_BIG_DECIMAL("Experimental Big Integer", "Swaps big decimal methods"),
58+
EXPERIMENTAL_BIG_DECIMAL("Experimental Big Decimal", "Swaps big decimal methods"),
5959
EXPERIMENTAL_NAKED_RECEIVER("Experimental Naked Receiver", "Replaces method call with a naked receiver"),
6060
EXPERIMENTAL_MEMBER_VARIABLE("Experimental Member Variable", "Removes assignments to member variables. Can even remove assignments to final members. The members will be initialized with their Java Default Value"),
6161
EXPERIMENTAL_SWITCH("Experimental Switch", "Finds the first label within a switch statement that differs from the default label. Mutates the switch statement by replacing the default label (wherever it is used) with this label. All the other labels are replaced by the default one"),
62-
REMOVE_SWITCH("Remove Switch","Finds the first switch label that differs from the default label, then replaces the default label with this label, and all other labels are replaced with the default one");
62+
REMOVE_SWITCH("Remove Switch", "Finds the first switch label that differs from the default label, then replaces the default label with this label, and all other labels are replaced with the default one");
6363

6464
/**
6565
* Descriptor which is used to display the name of this mutator in a table

bundles/org.pitest.pitclipse.runner/src/org/pitest/pitclipse/runner/results/summary/ClassSummary.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import java.util.Collection;
2121
import java.util.Objects;
2222

23-
import org.pitest.classinfo.ClassInfo;
24-
import org.pitest.coverage.CoverageData;
2523
import org.pitest.mutationtest.ClassMutationResults;
2624
import org.pitest.mutationtest.MutationResult;
2725

@@ -50,7 +48,6 @@ public static ClassSummary from(ClassMutationResults results, int numberOfCodeLi
5048
int survivedMutations = (int) mutations.stream()
5149
.filter(m -> !m.getStatus().isDetected())
5250
.count();
53-
CoverageData data;
5451
Coverage lineCoverage = Coverage.from(linesCovered, numberOfCodeLines);
5552
Coverage mutationCoverage = Coverage.from(totalMutations - survivedMutations, totalMutations);
5653

bundles/org.pitest.pitclipse.runner/src/org/pitest/pitclipse/runner/results/summary/SummaryResultListener.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,12 @@ public void runStart() {
6060
public void handleMutationResult(ClassMutationResults results) {
6161
List<ClassName> classesUnderTest = Collections.singletonList(results.getMutatedClass());
6262

63-
// long totalNumberOfCoveredLines = classesUnderTest.stream().map(coverage::getCoveredLines).flatMap(Collection::stream).count();
64-
65-
// int coveredLines = coverage.getNumberOfCoveredLines(classUnderTest);
6663
for (ClassName classUnderTest : classesUnderTest) {
6764
int numberOfCoveredLines = coverage.getCoveredLines(classUnderTest).size();
6865
int numberOfLines = coverage.getCodeLinesForClass(classUnderTest).getNumberOfCodeLines();
6966
ClassSummary classSummary = ClassSummary.from(results, numberOfLines, numberOfCoveredLines);
7067
result = result.update(classSummary);
7168
}
72-
// for (ClassInfo info : coverage.getClassInfo(classesUnderTest)) {
73-
// ClassSummary classSummary = ClassSummary.from(results, info, totalNumberOfCoveredLines);
74-
// }
7569
}
7670

7771
@Override

bundles/org.pitest.pitest-junit5-plugin/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: pitest-junit5-plugin
44
Bundle-SymbolicName: org.pitest.pitest-junit5-plugin
5-
Bundle-Version: 1.2.1
5+
Bundle-Version: 1.2.1.qualifier
66
Bundle-ClassPath: lib/pitest-junit5-plugin-sources.jar,
77
lib/pitest-junit5-plugin-javadoc.jar,
88
lib/pitest-junit5-plugin.jar,

bundles/org.pitest.pitest-junit5-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010

1111
<artifactId>org.pitest.pitest-junit5-plugin</artifactId>
12-
<version>1.2.1</version>
12+
<version>1.2.1-SNAPSHOT</version>
1313
<packaging>eclipse-plugin</packaging>
1414
<description>Wraps Pitest JUnit 5 Plugin's JAR as an Eclipse plug-in</description>
1515

tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/MutatorApiOfPitTest.java

Lines changed: 30 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -41,100 +41,35 @@ private String getPitMutatorsAsString() {
4141
}
4242

4343
private String getExpectedMutatorsAsString() {
44-
return "REMOVE_CONDITIONALS_ORDER_IF\n" +
45-
"REMOVE_CONDITIONALS\n" +
46-
"REMOVE_CONDITIONALS_EQUAL_IF\n" +
47-
"TRUE_RETURNS\n" +
48-
"REMOVE_CONDITIONALS_EQUAL_ELSE\n" +
49-
"VOID_METHOD_CALLS\n" +
50-
"PRIMITIVE_RETURNS\n" +
51-
"FALSE_RETURNS\n" +
52-
"NON_VOID_METHOD_CALLS\n" +
53-
"INVERT_NEGS\n" +
54-
"CONDITIONALS_BOUNDARY\n" +
55-
"REMOVE_CONDITIONALS_ORDER_ELSE\n" +
56-
"DEFAULTS\n" +
57-
"EXPERIMENTAL_SWITCH\n" +
58-
"RETURNS\n" +
59-
"EXPERIMENTAL_MEMBER_VARIABLE\n" +
60-
"NULL_RETURNS\n" +
61-
"EXPERIMENTAL_BIG_DECIMAL\n" +
62-
"MATH\n" +
63-
"EXPERIMENTAL_BIG_INTEGER\n" +
64-
"INCREMENTS\n" +
65-
"EXPERIMENTAL_ARGUMENT_PROPAGATION\n" +
66-
"EXPERIMENTAL_NAKED_RECEIVER\n" +
67-
"CONSTRUCTOR_CALLS\n" +
68-
"REMOVE_SWITCH\n" +
69-
"INLINE_CONSTS\n" +
70-
"STRONGER\n" +
71-
"REMOVE_INCREMENTS\n" +
72-
"NEGATE_CONDITIONALS\n" +
73-
"EMPTY_RETURNS\n";
74-
75-
76-
// return "INVERT_NEGS\n"
77-
// + "RETURN_VALS\n"
78-
// + "INLINE_CONSTS\n"
79-
// + "MATH\n"
80-
// + "VOID_METHOD_CALLS\n"
81-
// + "NEGATE_CONDITIONALS\n"
82-
// + "CONDITIONALS_BOUNDARY\n"
83-
// + "INCREMENTS\n"
84-
// + "REMOVE_INCREMENTS\n"
85-
// + "NON_VOID_METHOD_CALLS\n"
86-
// + "CONSTRUCTOR_CALLS\n"
87-
// + "REMOVE_CONDITIONALS_EQ_IF\n"
88-
// + "REMOVE_CONDITIONALS_EQ_ELSE\n"
89-
// + "REMOVE_CONDITIONALS_ORD_IF\n"
90-
// + "REMOVE_CONDITIONALS_ORD_ELSE\n"
91-
// + "REMOVE_CONDITIONALS\n"
92-
// + "TRUE_RETURNS\n"
93-
// + "FALSE_RETURNS\n"
94-
// + "PRIMITIVE_RETURNS\n"
95-
// + "EMPTY_RETURNS\n"
96-
// + "NULL_RETURNS\n"
97-
// + "RETURNS\n"
98-
// + "EXPERIMENTAL_MEMBER_VARIABLE\n"
99-
// + "EXPERIMENTAL_SWITCH\n"
100-
// + "EXPERIMENTAL_ARGUMENT_PROPAGATION\n"
101-
// + "EXPERIMENTAL_NAKED_RECEIVER\n"
102-
// + "EXPERIMENTAL_BIG_INTEGER\n"
103-
// + "AOR_1\n"
104-
// + "AOR_2\n"
105-
// + "AOR_3\n"
106-
// + "AOR_4\n"
107-
// + "ABS\n"
108-
// + "AOD1\n"
109-
// + "AOD2\n"
110-
// + "CRCR1\n"
111-
// + "CRCR2\n"
112-
// + "CRCR3\n"
113-
// + "CRCR4\n"
114-
// + "CRCR5\n"
115-
// + "CRCR6\n"
116-
// + "OBBN1\n"
117-
// + "OBBN2\n"
118-
// + "OBBN3\n"
119-
// + "ROR1\n"
120-
// + "ROR2\n"
121-
// + "ROR3\n"
122-
// + "ROR4\n"
123-
// + "ROR5\n"
124-
// + "UOI1\n"
125-
// + "UOI2\n"
126-
// + "UOI3\n"
127-
// + "UOI4\n"
128-
// + "REMOVE_SWITCH\n"
129-
// + "OLD_DEFAULTS\n"
130-
// + "STRONGER\n"
131-
// + "ALL\n"
132-
// + "DEFAULTS\n"
133-
// + "AOR\n"
134-
// + "AOD\n"
135-
// + "CRCR\n"
136-
// + "OBBN\n"
137-
// + "ROR\n"
138-
// + "UOI\n";
44+
return "REMOVE_CONDITIONALS_ORDER_IF\n"
45+
+ "REMOVE_CONDITIONALS\n"
46+
+ "REMOVE_CONDITIONALS_EQUAL_IF\n"
47+
+ "TRUE_RETURNS\n"
48+
+ "REMOVE_CONDITIONALS_EQUAL_ELSE\n"
49+
+ "VOID_METHOD_CALLS\n"
50+
+ "PRIMITIVE_RETURNS\n"
51+
+ "FALSE_RETURNS\n"
52+
+ "NON_VOID_METHOD_CALLS\n"
53+
+ "INVERT_NEGS\n"
54+
+ "CONDITIONALS_BOUNDARY\n"
55+
+ "REMOVE_CONDITIONALS_ORDER_ELSE\n"
56+
+ "DEFAULTS\n"
57+
+ "EXPERIMENTAL_SWITCH\n"
58+
+ "RETURNS\n"
59+
+ "EXPERIMENTAL_MEMBER_VARIABLE\n"
60+
+ "NULL_RETURNS\n"
61+
+ "EXPERIMENTAL_BIG_DECIMAL\n"
62+
+ "MATH\n"
63+
+ "EXPERIMENTAL_BIG_INTEGER\n"
64+
+ "INCREMENTS\n"
65+
+ "EXPERIMENTAL_ARGUMENT_PROPAGATION\n"
66+
+ "EXPERIMENTAL_NAKED_RECEIVER\n"
67+
+ "CONSTRUCTOR_CALLS\n"
68+
+ "REMOVE_SWITCH\n"
69+
+ "INLINE_CONSTS\n"
70+
+ "STRONGER\n"
71+
+ "REMOVE_INCREMENTS\n"
72+
+ "NEGATE_CONDITIONALS\n"
73+
+ "EMPTY_RETURNS\n";
13974
}
14075
}

tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/results/summary/SummaryResultListenerTestData.java

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.HashSet;
2727
import java.util.Map;
2828
import java.util.Set;
29+
import java.util.stream.IntStream;
2930
import java.util.stream.Stream;
3031

3132
import org.pitest.classinfo.ClassName;
@@ -127,9 +128,9 @@ public ClassLines getCodeLinesForClass(ClassName clazz) {
127128

128129
@Override
129130
public Set<ClassLine> getCoveredLines(ClassName clazz) {
130-
Set<ClassLine> lines = new HashSet<>();
131131
int expectedNbOfLinesCovered = classCoverage.getOrDefault(clazz, -1);
132132

133+
Set<ClassLine> lines = new HashSet<>();
133134
for (int i = 0; i < expectedNbOfLinesCovered; ++i) {
134135
lines.add(new ClassLine(clazz, i));
135136
}
@@ -141,24 +142,6 @@ public Collection<TestInfo> getTestsForBlockLocation(BlockLocation location) {
141142
throw new UnsupportedOperationException("the stub does not implement getTestsForBlockLocation");
142143
}
143144

144-
// @Override
145-
// public Collection<ClassInfo> getClassInfo(Collection<ClassName> classes) {
146-
// return filter(transform(classes, classInfoLookup()), notNull());
147-
// }
148-
//
149-
// @Override
150-
// public int getNumberOfCoveredLines(Collection<ClassName> classes) {
151-
// int total = 0;
152-
// for (ClassName className : classes) {
153-
// total += coverageFor(className);
154-
// }
155-
// return total;
156-
// }
157-
158-
// private int coverageFor(ClassName className) {
159-
// return classCoverage.getOrDefault(className, 0);
160-
// }
161-
162145
@Override
163146
public Collection<TestInfo> getTestsForClass(ClassName clazz) {
164147
return ImmutableList.of();
@@ -174,14 +157,5 @@ public Collection<ClassLines> getClassesForFile(String sourceFile, String packag
174157
return ImmutableList.of();
175158
}
176159

177-
// private Function<ClassName, ClassInfo> classInfoLookup() {
178-
// return new Function<ClassName, ClassInfo>() {
179-
// @Override
180-
// public ClassInfo apply(ClassName input) {
181-
// return classInfo.get(input);
182-
// }
183-
// };
184-
// }
185-
186160
}
187161
}

tests/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/DurationElapsed.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/PitMutationsViewPageObject.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ public SWTBotView getView() {
6767
SWTBotView mutationsView = bot.viewByTitle("PIT Mutations");
6868
mutationsView.show();
6969
mutationsView.setFocus();
70-
//
71-
// Make sure the 'PIT Mutations' view is opened
72-
//
73-
bot.waitUntil(new ViewOpenedCondition(bot, "PIT Mutations"));
7470
return mutationsView;
7571
}
7672

@@ -158,13 +154,13 @@ private MutationsTree(ImmutableList<StatusTree> statuses) {
158154
this.statuses = statuses;
159155
}
160156

161-
public boolean select(PitMutation mutation) {
157+
public void select(PitMutation mutation) {
162158
String status = mutation.getStatus().toString();
163159
for (StatusTree statusTree : statuses) {
164160
if (status.equals(statusTree.statusName)) {
165-
if (statusTree.select(mutation)) {
166-
return true;
167-
}
161+
statusTree.select(mutation);
162+
return;
163+
168164
}
169165
}
170166
throw new AssertionFailedError(
@@ -189,12 +185,14 @@ private StatusTree(String statusName, ImmutableList<ProjectTree> projects) {
189185
this.projects = projects;
190186
}
191187

192-
public boolean select(PitMutation mutation) {
188+
/**
189+
* @return
190+
*/
191+
public void select(PitMutation mutation) {
193192
for (ProjectTree projectTree : projects) {
194193
if (mutation.getProject().equals(projectTree.projectName)) {
195-
if (projectTree.select(mutation)) {
196-
return true;
197-
}
194+
projectTree.select(mutation);
195+
return;
198196
}
199197
}
200198
throw new AssertionFailedError(
@@ -221,12 +219,11 @@ private ProjectTree(String projectName, ImmutableList<PackageTree> packages) {
221219
this.packages = packages;
222220
}
223221

224-
public boolean select(PitMutation mutation) {
222+
public void select(PitMutation mutation) {
225223
for (PackageTree packageTree : packages) {
226224
if (mutation.getPkg().equals(packageTree.packageName)) {
227-
if (packageTree.select(mutation)) {
228-
return true;
229-
}
225+
packageTree.select(mutation);
226+
return;
230227
}
231228
}
232229
throw new AssertionFailedError(
@@ -253,12 +250,11 @@ private PackageTree(String packageName, ImmutableList<ClassTree> classes) {
253250
this.classes = classes;
254251
}
255252

256-
public boolean select(PitMutation mutation) {
253+
public void select(PitMutation mutation) {
257254
for (ClassTree classTree : classes) {
258255
if (mutation.getClassName().equals(classTree.className)) {
259-
if (classTree.select(mutation)) {
260-
return true;
261-
}
256+
classTree.select(mutation);
257+
return;
262258
}
263259
}
264260
throw new AssertionFailedError(
@@ -285,12 +281,15 @@ private ClassTree(String className, ImmutableList<MutationTree> projects) {
285281
this.mutations = projects;
286282
}
287283

288-
public boolean select(PitMutation mutation) {
284+
/**
285+
* @return
286+
*/
287+
public void select(PitMutation mutation) {
289288
for (MutationTree mutationTree : mutations) {
290289
if (mutation.getLineNumber() == mutationTree.lineNumber &&
291290
mutation.getMutation().equals(mutationTree.mutation)) {
292291
mutationTree.select();
293-
return true;
292+
return;
294293
}
295294
}
296295
throw new AssertionFailedError(

tests/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/RunConfigurationSelector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ private void activateConfigurationTab(String configurationName, String name) {
145145
}
146146

147147
public void createRunConfiguration(String configurationName, String projectName, String className) {
148-
System.out.println("RunConfigurationSelector.createRunConfiguration()");
149148
getPitConfigurationItem().contextMenu("New Configuration").click();
150149
bot.textWithLabel("Name:").setText(configurationName);
151150
PitRunConfiguration config = new Builder().withName(configurationName).withProjects(projectName)

0 commit comments

Comments
 (0)