-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1271 from hcoles/feature/cleanup_process_code
Double check thread status before reporting dead minion
- Loading branch information
Showing
9 changed files
with
113 additions
and
230 deletions.
There are no files selected for viewing
19 changes: 0 additions & 19 deletions
19
pitest-entry/src/main/java/org/pitest/coverage/execute/CoverageCommunicationThread.java
This file was deleted.
Oops, something went wrong.
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
99 changes: 0 additions & 99 deletions
99
...-entry/src/main/java/org/pitest/mutationtest/execute/MutationTestCommunicationThread.java
This file was deleted.
Oops, something went wrong.
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
51 changes: 51 additions & 0 deletions
51
pitest-entry/src/main/java/org/pitest/mutationtest/execute/Receive.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,51 @@ | ||
package org.pitest.mutationtest.execute; | ||
|
||
import org.pitest.mutationtest.DetectionStatus; | ||
import org.pitest.mutationtest.MutationStatusTestPair; | ||
import org.pitest.mutationtest.engine.MutationIdentifier; | ||
import org.pitest.util.Id; | ||
import org.pitest.util.Log; | ||
import org.pitest.util.ReceiveStrategy; | ||
import org.pitest.util.SafeDataInputStream; | ||
|
||
import java.util.Map; | ||
import java.util.logging.Logger; | ||
|
||
class Receive implements ReceiveStrategy { | ||
private static final Logger LOG = Log.getLogger(); | ||
|
||
private final Map<MutationIdentifier, MutationStatusTestPair> idMap; | ||
|
||
Receive(final Map<MutationIdentifier, MutationStatusTestPair> idMap) { | ||
this.idMap = idMap; | ||
} | ||
|
||
@Override | ||
public void apply(final byte control, final SafeDataInputStream is) { | ||
switch (control) { | ||
case Id.DESCRIBE: | ||
handleDescribe(is); | ||
break; | ||
case Id.REPORT: | ||
handleReport(is); | ||
break; | ||
default: | ||
LOG.severe("Unknown control byte " + control); | ||
} | ||
} | ||
|
||
private void handleReport(final SafeDataInputStream is) { | ||
final MutationIdentifier mutation = is.read(MutationIdentifier.class); | ||
final MutationStatusTestPair value = is | ||
.read(MutationStatusTestPair.class); | ||
this.idMap.put(mutation, value); | ||
LOG.fine(mutation + " " + value); | ||
} | ||
|
||
private void handleDescribe(final SafeDataInputStream is) { | ||
final MutationIdentifier mutation = is.read(MutationIdentifier.class); | ||
this.idMap.put(mutation, MutationStatusTestPair.notAnalysed(1, | ||
DetectionStatus.STARTED)); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
pitest-entry/src/main/java/org/pitest/mutationtest/execute/SendData.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.execute; | ||
|
||
import org.pitest.util.SafeDataOutputStream; | ||
|
||
import java.util.function.Consumer; | ||
|
||
class SendData implements Consumer<SafeDataOutputStream> { | ||
private final MinionArguments arguments; | ||
|
||
SendData(final MinionArguments arguments) { | ||
this.arguments = arguments; | ||
} | ||
|
||
@Override | ||
public void accept(final SafeDataOutputStream dos) { | ||
dos.write(this.arguments); | ||
dos.flush(); | ||
} | ||
} |
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
Oops, something went wrong.