use of org.eclipse.scanning.api.points.models.StaticModel in project gda-core by openGDA.
the class MScanSubmitterTest method willAllowStaticScanWithDetectorAndNoScannable.
@Test
public void willAllowStaticScanWithDetectorAndNoScannable() throws Exception {
final int size = 5;
Object[] arr = { Scanpath.STATIC, size, detectorRunnableDevice, EXPOSURE };
when(resolver.resolveScanClauses()).thenReturn(Arrays.asList(Arrays.asList(new ScanpathElementProcessor(Scanpath.STATIC), new NumberElementProcessor(size)), Arrays.asList(new IRunnableDeviceDetectorElementProcessor(detectorRunnableDevice), new NumberElementProcessor(EXPOSURE))));
builder.buildAndSubmitBlockingScanRequest(arr);
verify(submitter).blockingSubmit(beanCaptor.capture());
verify(eventSubscriber).addListener(any(IScanListener.class));
ScanBean bean = beanCaptor.getValue();
assertThat(bean.getScanRequest().getCompoundModel(), is(equalTo(new CompoundModel(new StaticModel(size)))));
assertThat(bean.getScanRequest().getDetectors().values(), contains(detectorRunnableDevice.getModel()));
}
use of org.eclipse.scanning.api.points.models.StaticModel in project gda-core by openGDA.
the class MScanSubmitterTest method willAllowStaticScanWithDefaultSize.
@Test
public void willAllowStaticScanWithDefaultSize() throws Exception {
// > 1 exposure time to ensure number not stolen by previous clause
Object[] arr = { Scanpath.STATIC, detectorRunnableDevice, 2.7 };
when(resolver.resolveScanClauses()).thenReturn(Arrays.asList(Arrays.asList(new ScanpathElementProcessor(Scanpath.STATIC)), Arrays.asList(new IRunnableDeviceDetectorElementProcessor(detectorRunnableDevice), new NumberElementProcessor(1.7))));
builder.buildAndSubmitBlockingScanRequest(arr);
verify(submitter).blockingSubmit(beanCaptor.capture());
verify(eventSubscriber).addListener(any(IScanListener.class));
ScanBean bean = beanCaptor.getValue();
assertThat(bean.getScanRequest().getCompoundModel(), is(equalTo(new CompoundModel(new StaticModel()))));
assertThat(bean.getScanRequest().getDetectors().values(), contains(detectorRunnableDevice.getModel()));
}
Aggregations