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