Ergaenze fehlende Tests fuer SKIPPED-Statusdurchleitung im GUI-Adapter
Fehlende Testabdeckung fuer den SKIPPED-Pfad: Der Coordinator-Test verifiziert jetzt, dass SKIPPED-Events als row:SKIPPED:... dispatcht werden und korrekt in der Zusammenfassung gezaehlt werden. Der Smoke-Test prueft zusaetzlich, dass die ► Icon (nicht ✘) fuer SKIPPED-Zeilen in der Ergebnistabelle erscheint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+38
@@ -96,6 +96,44 @@ class GuiBatchRunCoordinatorTest {
|
|||||||
assertFalse(coordinator.isRunning());
|
assertFalse(coordinator.isRunning());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void skippedDocument_dispatchesSkippedRowAndCountsCorrectly() {
|
||||||
|
List<String> events = new ArrayList<>();
|
||||||
|
GuiBatchRunCoordinator.Listener listener = new GuiBatchRunCoordinator.Listener() {
|
||||||
|
@Override public void onRunStarted(RunId runId, int totalCandidates) {
|
||||||
|
events.add("started:" + totalCandidates);
|
||||||
|
}
|
||||||
|
@Override public void onDocumentCompleted(GuiBatchRunResultRow row) {
|
||||||
|
events.add("row:" + row.status() + ":" + row.originalFileName());
|
||||||
|
}
|
||||||
|
@Override public void onRunEnded(RunSummary summary, GuiBatchRunLaunchOutcome outcome) {
|
||||||
|
events.add("ended:started=" + outcome.successfullyStarted()
|
||||||
|
+ ",completed=" + outcome.batchCompletedNormally()
|
||||||
|
+ ",summary=" + summary.successCount() + "/" + summary.failedCount()
|
||||||
|
+ "/" + summary.skippedCount());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
GuiBatchRunLauncher launcher = (configPath, observer, token) -> {
|
||||||
|
observer.onRunStarted(new RunId("run-skip"), 1);
|
||||||
|
observer.onDocumentCompleted(new DocumentCompletionEvent(
|
||||||
|
"c.pdf", DocumentCompletionStatus.SKIPPED,
|
||||||
|
null, null, null, Duration.ofMillis(5)));
|
||||||
|
observer.onRunEnded(new RunSummary(0, 0, 1));
|
||||||
|
return GuiBatchRunLaunchOutcome.completed();
|
||||||
|
};
|
||||||
|
GuiBatchRunCoordinator coordinator = new GuiBatchRunCoordinator(
|
||||||
|
launcher, syncThreadFactory(), syncDispatcher(), listener);
|
||||||
|
|
||||||
|
boolean started = coordinator.start(ANY_CONFIG);
|
||||||
|
assertTrue(started);
|
||||||
|
|
||||||
|
assertEquals(List.of(
|
||||||
|
"started:1",
|
||||||
|
"row:SKIPPED:c.pdf",
|
||||||
|
"ended:started=true,completed=true,summary=0/0/1"), events);
|
||||||
|
assertFalse(coordinator.isRunning());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void startWhileRunning_returnsFalseWithoutDoubleDispatch() {
|
void startWhileRunning_returnsFalseWithoutDoubleDispatch() {
|
||||||
// Launcher installs a rendezvous so the first run is still "running" while we
|
// Launcher installs a rendezvous so the first run is still "running" while we
|
||||||
|
|||||||
+5
@@ -137,6 +137,11 @@ class GuiBatchRunTabSmokeTest {
|
|||||||
// Clicking a row without reasoning shows the no-reasoning placeholder.
|
// Clicking a row without reasoning shows the no-reasoning placeholder.
|
||||||
tab().resultTable().getSelectionModel().select(1);
|
tab().resultTable().getSelectionModel().select(1);
|
||||||
assertTrue(tab().detailArea().getText().contains(GuiBatchRunTab.NO_REASONING_TEXT));
|
assertTrue(tab().detailArea().getText().contains(GuiBatchRunTab.NO_REASONING_TEXT));
|
||||||
|
|
||||||
|
// SKIPPED row must carry the ► icon, not ✘.
|
||||||
|
GuiBatchRunResultRow skippedRow = tab().resultTable().getItems().get(2);
|
||||||
|
assertEquals(DocumentCompletionStatus.SKIPPED, skippedRow.status());
|
||||||
|
assertEquals("\u25BA", skippedRow.statusIcon());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user