BasicJobTestDriverDelegate delegate = new BasicJobTestDriverDelegate();
testDriver.setDelegate(delegate);
TestCompleteNotifier notifier = new TestCompleteNotifier();
JobProcessor jobProcessor = machine.getJobProcessor();
jobProcessor.addListener(new BasicJobTestProcessorListener(notifier));
jobProcessor.setDelegate(new BasicJobTestJobProcessorDelegate());
Job job = createSimpleJob();
Head h1 = machine.getHead("H1");
Nozzle n1 = h1.getNozzle("N1");
Nozzle n2 = h1.getNozzle("N2");
delegate.expectMove("Move N1 to F1", n1, new Location(LengthUnit.Millimeters, -10, 0, 0, 0), 1.0);
delegate.expectPick(n1);
delegate.expectMove("Move N2 to F1", n2, new Location(LengthUnit.Millimeters, -20, 0, 0, 0), 1.0);
delegate.expectPick(n2);
delegate.expectMove("Move N1 to R1, Safe-Z", n1, new Location(LengthUnit.Millimeters, 0, 10, 0, 45), 1.0);
delegate.expectMove("Move N1 to R1, Z", n1, new Location(LengthUnit.Millimeters, 0, 10, 0.825500, 45), 1.0);
delegate.expectPlace(n1);
delegate.expectMove("Move N1 to R1, Safe-Z", n1, new Location(LengthUnit.Millimeters, 0, 10, 0, 45), 1.0);
delegate.expectMove("Move N2 to R2, Safe-Z", n2, new Location(LengthUnit.Millimeters, 00, 20, 0, 90), 1.0);
delegate.expectMove("Move N2 to R2, Z", n2, new Location(LengthUnit.Millimeters, 00, 20, 0.825500, 90), 1.0);
delegate.expectPlace(n2);
delegate.expectMove("Move N2 to R2, Safe-Z", n2, new Location(LengthUnit.Millimeters, 00, 20, 0, 90), 1.0);
jobProcessor.load(job);
machine.setEnabled(true);
synchronized (notifier) {
jobProcessor.start();
notifier.wait();
}
if (notifier.failed) {
throw notifier.exception;
}