@Test public void testClient() throws Exception { mockServer.reset(); deleteMontageWorkDirectory(); addRenderStackMetaDataResponse(); for (int i = 0; i < 5; i++) { addAcqNextTileResponse(getAcquisitionTileList(AcquisitionTileList.ResultType.TILE_FOUND, "tile_" + i, 1.0)); } addAcqNextTileResponse(getAcquisitionTileList(AcquisitionTileList.ResultType.SERVED_ALL_ACQ, null, null)); addRenderResolvedTilesResponse(); addAcqTileStateResponse(); final String montageScript; if (File.separatorChar == '/') { montageScript = "ls"; } else { montageScript = "dir"; } LowLatencyMontageClient.main(new String[] { "--baseDataUrl", getBaseDataUrl(), "--owner", acquireStackId.getOwner(), "--project", acquireStackId.getProject(), "--baseAcquisitionUrl", getBaseAcquisitionUrl(), "--montageScript", montageScript, "--montageParametersFile", "src/test/resources/montage-test/montage-parameters.json", "--montageWorkDirectory", montageWorkDirectory.getAbsolutePath() }); Assert.assertTrue("test failed", mockServer.isRunning()); }
public static void main(final String[] args) { final ClientRunner clientRunner = new ClientRunner(args) { @Override public void runClient(final String[] args) throws Exception { final Parameters parameters = new Parameters(); parameters.parse(args); LOG.info("runClient: entry, parameters={}", parameters); parameters.validate(); final LowLatencyMontageClient client = new LowLatencyMontageClient(parameters); if (parameters.acquisitionId == null) { while (true) { client.processAcquisitions(); } } else { client.processAcquisition(parameters.acquisitionId); } if (client.hasFailedAcquisitions()) { throw new IllegalStateException( "run completed but the following acquisitions could not be processed: " + client.getFailedAcquisitionIds()); } } }; clientRunner.run(); }
LowLatencyMontageClient { public static void main(final String[] args) { final ClientRunner clientRunner = new ClientRunner(args) { @Override public void runClient(final String[] args) throws Exception { final Parameters parameters = new Parameters(); parameters.parse(args); LOG.info("runClient: entry, parameters={}", parameters); parameters.validate(); final LowLatencyMontageClient client = new LowLatencyMontageClient(parameters); if (parameters.acquisitionId == null) { while (true) { client.processAcquisitions(); } } else { client.processAcquisition(parameters.acquisitionId); } if (client.hasFailedAcquisitions()) { throw new IllegalStateException( "run completed but the following acquisitions could not be processed: " + client.getFailedAcquisitionIds()); } } }; clientRunner.run(); } }
LowLatencyMontageClient { public static void main(final String[] args) { final ClientRunner clientRunner = new ClientRunner(args) { @Override public void runClient(final String[] args) throws Exception { final Parameters parameters = new Parameters(); parameters.parse(args); LOG.info("runClient: entry, parameters={}", parameters); parameters.validate(); final LowLatencyMontageClient client = new LowLatencyMontageClient(parameters); if (parameters.acquisitionId == null) { while (true) { client.processAcquisitions(); } } else { client.processAcquisition(parameters.acquisitionId); } if (client.hasFailedAcquisitions()) { throw new IllegalStateException( "run completed but the following acquisitions could not be processed: " + client.getFailedAcquisitionIds()); } } }; clientRunner.run(); } LowLatencyMontageClient(final Parameters parameters); }
LowLatencyMontageClient { public static void main(final String[] args) { final ClientRunner clientRunner = new ClientRunner(args) { @Override public void runClient(final String[] args) throws Exception { final Parameters parameters = new Parameters(); parameters.parse(args); LOG.info("runClient: entry, parameters={}", parameters); parameters.validate(); final LowLatencyMontageClient client = new LowLatencyMontageClient(parameters); if (parameters.acquisitionId == null) { while (true) { client.processAcquisitions(); } } else { client.processAcquisition(parameters.acquisitionId); } if (client.hasFailedAcquisitions()) { throw new IllegalStateException( "run completed but the following acquisitions could not be processed: " + client.getFailedAcquisitionIds()); } } }; clientRunner.run(); } LowLatencyMontageClient(final Parameters parameters); static void main(final String[] args); boolean hasFailedAcquisitions(); Set<Long> getFailedAcquisitionIds(); void processAcquisitions(); void processAcquisition(final Acquisition acquisition); void processAcquisition(final Long acquisitionId); void ensureAcquireStackExists(final RenderDataClient renderDataClient,
                                         final String acquireStackName,
                                         final Acquisition acquisition); Set<Double> importAcquisitionData(final RenderDataClient renderDataClient,
                                             final Long acquisitionId,
                                             final String acquireStackName); void invokeMontageProcessor(final String owner,
                                       final String project,
                                       final String acquireStack,
                                       final Set<Double> acquisitionZValues,
                                       final String montageStack); }
LowLatencyMontageClient { public static void main(final String[] args) { final ClientRunner clientRunner = new ClientRunner(args) { @Override public void runClient(final String[] args) throws Exception { final Parameters parameters = new Parameters(); parameters.parse(args); LOG.info("runClient: entry, parameters={}", parameters); parameters.validate(); final LowLatencyMontageClient client = new LowLatencyMontageClient(parameters); if (parameters.acquisitionId == null) { while (true) { client.processAcquisitions(); } } else { client.processAcquisition(parameters.acquisitionId); } if (client.hasFailedAcquisitions()) { throw new IllegalStateException( "run completed but the following acquisitions could not be processed: " + client.getFailedAcquisitionIds()); } } }; clientRunner.run(); } LowLatencyMontageClient(final Parameters parameters); static void main(final String[] args); boolean hasFailedAcquisitions(); Set<Long> getFailedAcquisitionIds(); void processAcquisitions(); void processAcquisition(final Acquisition acquisition); void processAcquisition(final Long acquisitionId); void ensureAcquireStackExists(final RenderDataClient renderDataClient,
                                         final String acquireStackName,
                                         final Acquisition acquisition); Set<Double> importAcquisitionData(final RenderDataClient renderDataClient,
                                             final Long acquisitionId,
                                             final String acquireStackName); void invokeMontageProcessor(final String owner,
                                       final String project,
                                       final String acquireStack,
                                       final Set<Double> acquisitionZValues,
                                       final String montageStack);  }