| 1 | package edu.ucsb.cs.scaffold.jobs; | |
| 2 | ||
| 3 | import edu.ucsb.cs.scaffold.utilities.Sleep; | |
| 4 | import edu.ucsb.cs156.jobs.services.JobContext; | |
| 5 | import edu.ucsb.cs156.jobs.services.JobContextConsumer; | |
| 6 | import lombok.Builder; | |
| 7 | ||
| 8 | @Builder | |
| 9 | public class TestJob implements JobContextConsumer { | |
| 10 | ||
| 11 | private boolean fail; | |
| 12 | private int sleepMs; | |
| 13 | ||
| 14 | @Override | |
| 15 | public void accept(JobContext ctx) throws Exception { | |
| 16 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Hello World! from test job!"); |
| 17 |
1
1. accept : removed call to edu/ucsb/cs/scaffold/utilities/Sleep::sleepQuietly → KILLED |
Sleep.sleepQuietly(sleepMs); |
| 18 |
1
1. accept : negated conditional → KILLED |
if (fail) { |
| 19 | throw new Exception("Fail!"); | |
| 20 | } | |
| 21 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Goodbye from test job!"); |
| 22 | } | |
| 23 | } | |
Mutations | ||
| 16 |
1.1 |
|
| 17 |
1.1 |
|
| 18 |
1.1 |
|
| 21 |
1.1 |