Qualify Archiver reader states in the IntelliJ designer
This commit is contained in:
@@ -113,6 +113,8 @@ These graphical checks require a macOS desktop session; other platforms are not
|
|||||||
|
|
||||||
In Archiver `HtmlDocument.fxml`, **Form controls** offers `HtmlMediaButton` in the palette. Select its **viewer** property, choose an earlier `HtmlViewer` with an `fx:id` and click **Set property**. **Reset property** clears the reference. **Bindings → Structure → Rename identifier** updates the reference when renaming the target. The `--viewer-import` IntelliJ qualification uses the local-image reference example and the real import dialog with a controlled file error and retry.
|
In Archiver `HtmlDocument.fxml`, **Form controls** offers `HtmlMediaButton` in the palette. Select its **viewer** property, choose an earlier `HtmlViewer` with an `fx:id` and click **Set property**. **Reset property** clears the reference. **Bindings → Structure → Rename identifier** updates the reference when renaming the target. The `--viewer-import` IntelliJ qualification uses the local-image reference example and the real import dialog with a controlled file error and retry.
|
||||||
|
|
||||||
|
Use `--reader-states` with the Archiver IntelliJ host check for the direct `DocumentTag.fxml` example, binary attachment export and HTML load error with recovery. The test saves a chip style in the disposable project and checks the styled chips in the archive window.
|
||||||
|
|
||||||
## Implementation references
|
## Implementation references
|
||||||
|
|
||||||
- [Lombok adoption](docs/lombok-adoption.md): scope, API preservation and build/host validation.
|
- [Lombok adoption](docs/lombok-adoption.md): scope, API preservation and build/host validation.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public final class DocumentTabsTargetProbe {
|
|||||||
Thread.ofPlatform().daemon().start(() -> Probe.run(Path.of(dir)));
|
Thread.ofPlatform().daemon().start(() -> Probe.run(Path.of(dir)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class Probe {
|
static final class Probe {
|
||||||
private static <T> T fx(Callable<T> task) throws Exception {
|
private static <T> T fx(Callable<T> task) throws Exception {
|
||||||
var future = new FutureTask<>(task);
|
var future = new FutureTask<>(task);
|
||||||
Platform.runLater(future);
|
Platform.runLater(future);
|
||||||
@@ -181,7 +181,7 @@ public final class DocumentTabsTargetProbe {
|
|||||||
popup(input, "Beleg geprüft", dir.resolve("rechnung-tab-tags.png"));
|
popup(input, "Beleg geprüft", dir.resolve("rechnung-tab-tags.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Node select(TabPane group, String name) throws Exception {
|
static Node select(TabPane group, String name) throws Exception {
|
||||||
var tab =
|
var tab =
|
||||||
fx(
|
fx(
|
||||||
() -> {
|
() -> {
|
||||||
@@ -199,7 +199,7 @@ public final class DocumentTabsTargetProbe {
|
|||||||
return fx(tab::getContent);
|
return fx(tab::getContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkHtml(Node root, String heading, String text) throws Exception {
|
static void checkHtml(Node root, String heading, String text) throws Exception {
|
||||||
await(
|
await(
|
||||||
heading,
|
heading,
|
||||||
() -> {
|
() -> {
|
||||||
@@ -243,13 +243,13 @@ public final class DocumentTabsTargetProbe {
|
|||||||
return named;
|
return named;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void requireChips(Node root, String... expected) throws Exception {
|
static void requireChips(Node root, String... expected) throws Exception {
|
||||||
var actual = chips(root).keySet();
|
var actual = chips(root).keySet();
|
||||||
if (!actual.equals(Set.of(expected)))
|
if (!actual.equals(Set.of(expected)))
|
||||||
throw new AssertionError("Assigned tags " + actual + " vs " + Arrays.toString(expected));
|
throw new AssertionError("Assigned tags " + actual + " vs " + Arrays.toString(expected));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Button removeButton(Node root, String text) throws Exception {
|
static Button removeButton(Node root, String text) throws Exception {
|
||||||
return (Button)
|
return (Button)
|
||||||
Objects.requireNonNull(chips(root).get(text), text).lookup(".tag-chip-remove");
|
Objects.requireNonNull(chips(root).get(text), text).lookup(".tag-chip-remove");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,278 @@
|
|||||||
|
package qualification;
|
||||||
|
|
||||||
|
import static qualification.DocumentTabsTargetProbe.Probe.*;
|
||||||
|
import static qualification.FolderActionsTargetProbe.Worker.*;
|
||||||
|
|
||||||
|
import java.nio.file.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javafx.scene.*;
|
||||||
|
import javafx.scene.control.*;
|
||||||
|
import javafx.scene.layout.Region;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
|
||||||
|
public final class ReaderStatesTargetProbe {
|
||||||
|
public static void premain(String dir) {
|
||||||
|
if (System.getProperty("sun.java.command", "")
|
||||||
|
.startsWith("de.neitzel.fxdesigner.target.WorkerMain "))
|
||||||
|
Thread.ofPlatform().daemon().start(() -> Check.run(Path.of(dir)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class Check {
|
||||||
|
static void run(Path dir) {
|
||||||
|
try {
|
||||||
|
var stage = previewStage();
|
||||||
|
var root =
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
stage.setWidth(1100);
|
||||||
|
stage.setHeight(750);
|
||||||
|
var content = stage.getScene().getRoot();
|
||||||
|
content.applyCss();
|
||||||
|
content.layout();
|
||||||
|
return content;
|
||||||
|
});
|
||||||
|
var scenario = Files.readString(dir.resolve("layout-case"));
|
||||||
|
var result =
|
||||||
|
switch (scenario) {
|
||||||
|
case "tag" -> fx(() -> tag(root, dir));
|
||||||
|
case "attachment-save" -> fx(() -> attachment(root, dir));
|
||||||
|
case "archive-error" -> archive(root, dir);
|
||||||
|
default -> throw new AssertionError(scenario);
|
||||||
|
};
|
||||||
|
Files.writeString(dir.resolve("result-" + scenario), result);
|
||||||
|
} catch (Throwable failure) {
|
||||||
|
var trace = new java.io.StringWriter();
|
||||||
|
failure.printStackTrace(new java.io.PrintWriter(trace));
|
||||||
|
try {
|
||||||
|
Files.writeString(dir.resolve("target-error.txt"), trace.toString());
|
||||||
|
} catch (Exception logging) {
|
||||||
|
logging.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Button button(Node root, String id) {
|
||||||
|
return (Button) Objects.requireNonNull(root.lookup("#" + id), id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Label label(Node root, String id) {
|
||||||
|
return (Label) Objects.requireNonNull(root.lookup("#" + id), id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String tag(Parent root, Path dir) throws Exception {
|
||||||
|
var chip = (Region) root.lookup(".tag-chip");
|
||||||
|
var remove = (Button) chip.lookup(".tag-chip-remove");
|
||||||
|
var readonly = (CheckBox) root.lookup("#example-tag-readonly");
|
||||||
|
var busy = (CheckBox) root.lookup("#example-tag-busy");
|
||||||
|
var status = label(root, "example-tag-status");
|
||||||
|
require(
|
||||||
|
chip.getClass().getMethod("getText").invoke(chip).equals("Beleg offen"), "Model text");
|
||||||
|
require(
|
||||||
|
chip.getBackground().getFills().stream()
|
||||||
|
.anyMatch(fill -> Color.web("#f2d58a").equals(fill.getFill())),
|
||||||
|
"Reopened style");
|
||||||
|
require(remove.isVisible() && !remove.isDisabled(), "Initial removal enabled");
|
||||||
|
image(root, dir.resolve("tag-editable.png"));
|
||||||
|
readonly.fire();
|
||||||
|
require(!remove.isVisible() && !remove.isManaged() && !chip.isDisabled(), "Read-only");
|
||||||
|
remove.fire();
|
||||||
|
require(status.getText().equals("Beleg offen · zugewiesen"), "Read-only action rejected");
|
||||||
|
image(root, dir.resolve("tag-readonly.png"));
|
||||||
|
readonly.fire();
|
||||||
|
busy.fire();
|
||||||
|
require(chip.isDisabled() && remove.isVisible() && remove.isDisabled(), "Busy");
|
||||||
|
remove.fire();
|
||||||
|
require(status.getText().equals("Beleg offen · zugewiesen"), "Busy action rejected");
|
||||||
|
image(root, dir.resolve("tag-busy.png"));
|
||||||
|
busy.fire();
|
||||||
|
remove.fire();
|
||||||
|
require(
|
||||||
|
status.getText().equals("Beleg offen · entfernt") && !chip.getParent().isVisible(),
|
||||||
|
"Removed");
|
||||||
|
return "DocumentTag · Reopened style and bound text; editable removed the assigned tag."
|
||||||
|
+ " Read-only and busy retained it.";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String attachment(Parent root, Path dir) throws Exception {
|
||||||
|
var pick = (ComboBox<?>) root.lookup("#example-attachments");
|
||||||
|
var open = button(root, "open-attachment");
|
||||||
|
var save = button(root, "save-attachment");
|
||||||
|
var result = label(root, "attachment-result");
|
||||||
|
require(
|
||||||
|
open.isDisabled() && save.isDisabled() && result.getUserData() == null, "No selection");
|
||||||
|
pick.getSelectionModel().selectFirst();
|
||||||
|
require(!open.isDisabled() && !save.isDisabled(), "Text attachment");
|
||||||
|
save.fire();
|
||||||
|
require(
|
||||||
|
result.getText().equals("Gespeichert · Lieferschein.txt · LS-018 · Drei Archivkartons"),
|
||||||
|
"Supported attachment can still be saved");
|
||||||
|
var previous = result.getUserData();
|
||||||
|
pick.getSelectionModel().select(1);
|
||||||
|
require(open.isDisabled() && !save.isDisabled(), "Unknown attachment can only be saved");
|
||||||
|
open.fire();
|
||||||
|
require(Objects.equals(result.getUserData(), previous), "Open cannot run");
|
||||||
|
save.fire();
|
||||||
|
require(result.getUserData() instanceof Path, result.getText());
|
||||||
|
var saved = (Path) result.getUserData();
|
||||||
|
require(
|
||||||
|
saved.getFileName().toString().equals("Messdaten.bin")
|
||||||
|
&& Arrays.equals(Files.readAllBytes(saved), new byte[] {16, 0, 127, -1}),
|
||||||
|
"Byte-for-byte export");
|
||||||
|
image(root, dir.resolve("unknown-attachment.png"));
|
||||||
|
pick.getSelectionModel().selectFirst();
|
||||||
|
require(!open.isDisabled() && !save.isDisabled(), "Back to text attachment");
|
||||||
|
open.fire();
|
||||||
|
var opened = (Path) result.getUserData();
|
||||||
|
require(
|
||||||
|
opened.getFileName().toString().equals("Lieferschein.txt")
|
||||||
|
&& Files.readString(opened).equals("LS-018 · Drei Archivkartons")
|
||||||
|
&& result.getText().startsWith("Geöffnet"),
|
||||||
|
"Correct text attachment opened: " + result.getText());
|
||||||
|
return "AttachmentToolbar · No selection −/−, text +/+, binary −/+ (Open/Save). Saved"
|
||||||
|
+ " Messdaten.bin with bytes 10 00 7F FF, then opened Lieferschein.txt (LS-018 ·"
|
||||||
|
+ " Drei Archivkartons).";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Object read(Node node, String method) throws Exception {
|
||||||
|
return node.getClass().getMethod(method).invoke(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean failureLabel(Node viewer, Throwable cause) {
|
||||||
|
return viewer.lookupAll(".label").stream()
|
||||||
|
.anyMatch(
|
||||||
|
n ->
|
||||||
|
n instanceof Label l
|
||||||
|
&& l.isVisible()
|
||||||
|
&& Objects.equals(l.getText(), cause.getMessage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void fail(Node invoice, Node viewer, Path dir, boolean first) throws Exception {
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
button(invoice, "example-html-fail").fire();
|
||||||
|
require(
|
||||||
|
(boolean) read(viewer, "isLoading")
|
||||||
|
&& read(viewer, "getError") == null
|
||||||
|
&& label(invoice, "example-html-state").getText().equals("HTML wird geladen …")
|
||||||
|
&& viewer.lookupAll(".progress-indicator").stream().anyMatch(Node::isVisible),
|
||||||
|
"Loading state visible before completion");
|
||||||
|
if (first) image(invoice, dir.resolve("html-load-started.png"));
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
await(
|
||||||
|
"Viewer error property and visible error",
|
||||||
|
() -> {
|
||||||
|
var error = read(viewer, "getError");
|
||||||
|
return !(Boolean) read(viewer, "isLoading")
|
||||||
|
&& error instanceof Throwable cause
|
||||||
|
&& cause.getMessage().contains("32 MiB")
|
||||||
|
&& failureLabel(viewer, cause)
|
||||||
|
&& label(invoice, "example-html-state").getText().equals("Laden fehlgeschlagen");
|
||||||
|
});
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
require(
|
||||||
|
button(invoice, "external-media-load").isDisabled(),
|
||||||
|
"Failed viewer cannot load media");
|
||||||
|
if (first) image(invoice, dir.resolve("html-load-error.png"));
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String archive(Parent root, Path dir) throws Exception {
|
||||||
|
var group =
|
||||||
|
fx(
|
||||||
|
() ->
|
||||||
|
root.lookupAll(".tab-pane").stream()
|
||||||
|
.filter(
|
||||||
|
n ->
|
||||||
|
n instanceof TabPane t
|
||||||
|
&& t.getTabs().stream()
|
||||||
|
.anyMatch(tab -> tab.getText().equals("Rechnung.html")))
|
||||||
|
.map(TabPane.class::cast)
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow());
|
||||||
|
var invoice = select(group, "Rechnung.html");
|
||||||
|
checkHtml(invoice, "Rechnung RE-042", "Büromaterial · 48,00 €");
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
requireChips(invoice, "Beleg offen");
|
||||||
|
((TextField) invoice.lookup("#tag-input")).setText("Beleg geprüft");
|
||||||
|
button(invoice, "add").fire();
|
||||||
|
requireChips(invoice, "Beleg offen", "Beleg geprüft");
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
var other = select(group, "Lieferschein.html");
|
||||||
|
checkHtml(other, "Lieferschein LS-018", "Wareneingang · 3 Archivkartons");
|
||||||
|
var deliveryViewer = fx(() -> other.lookup("#html-document"));
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
requireChips(other, "Beleg geprüft");
|
||||||
|
require(
|
||||||
|
!(Boolean) read(deliveryViewer, "isExternalImagesAllowed"),
|
||||||
|
"Delivery initially offline");
|
||||||
|
button(other, "external-media-load").fire();
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
await(
|
||||||
|
"Delivery media requested",
|
||||||
|
() -> label(root, "status").getText().matches("Lokale Bildanfragen · [1-9][0-9]*"));
|
||||||
|
select(group, "Rechnung.html");
|
||||||
|
var viewer = fx(() -> invoice.lookup("#html-document"));
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
requireChips(invoice, "Beleg offen", "Beleg geprüft");
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
fail(invoice, viewer, dir, true);
|
||||||
|
select(group, "Lieferschein.html");
|
||||||
|
checkHtml(other, "Lieferschein LS-018", "Wareneingang · 3 Archivkartons");
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
require(
|
||||||
|
(Boolean) read(deliveryViewer, "isExternalImagesAllowed")
|
||||||
|
&& read(deliveryViewer, "getError") == null,
|
||||||
|
"Other tab unaffected by error");
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
select(group, "Rechnung.html");
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
button(invoice, "example-html-recover").fire();
|
||||||
|
require(read(viewer, "getError") == null, "Recovery clears previous error");
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
checkHtml(invoice, "Rechnung RE-042", "Büromaterial · 48,00 €");
|
||||||
|
await(
|
||||||
|
"Valid document ready",
|
||||||
|
() ->
|
||||||
|
!(Boolean) read(viewer, "isLoading")
|
||||||
|
&& read(viewer, "getError") == null
|
||||||
|
&& label(invoice, "example-html-state").getText().equals("HTML bereit")
|
||||||
|
&& viewer.lookupAll(".label").stream()
|
||||||
|
.noneMatch(
|
||||||
|
n ->
|
||||||
|
n instanceof Label l
|
||||||
|
&& l.isVisible()
|
||||||
|
&& Objects.toString(l.getText(), "").contains("32 MiB")));
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
image(invoice, dir.resolve("html-load-recovered.png"));
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
fail(invoice, viewer, dir, false);
|
||||||
|
select(group, "Lieferschein.html");
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
require(
|
||||||
|
(Boolean) read(deliveryViewer, "isExternalImagesAllowed")
|
||||||
|
&& read(deliveryViewer, "getError") == null,
|
||||||
|
"Other tab kept permission across second failure");
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
return "Rechnung → Lieferschein → Rechnung retained two/one/two chips. HTML viewer reported"
|
||||||
|
+ " loading → 32 MiB error → valid receipt → repeated error. Delivery kept its own"
|
||||||
|
+ " media permission.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package qualification;
|
||||||
|
|
||||||
|
import static qualification.WorkflowProbe.*;
|
||||||
|
|
||||||
|
import com.intellij.openapi.project.Project;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import javafx.embed.swing.SwingFXUtils;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
|
public final class ReaderStatesWorkflowProbe extends DeclarationWorkflowProbe {
|
||||||
|
@Override
|
||||||
|
void verify(Project project) throws Exception {
|
||||||
|
this.project = project;
|
||||||
|
open("DocumentTag");
|
||||||
|
controls(true);
|
||||||
|
choose("form-control", "TagChip #chip");
|
||||||
|
String style = "-fx-background-color: #f2d58a;";
|
||||||
|
set("style", style, style);
|
||||||
|
reopen("DocumentTag", style);
|
||||||
|
controls(true);
|
||||||
|
choose("form-control", "TagChip #chip");
|
||||||
|
choose("form-property", "style");
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
ImageIO.write(
|
||||||
|
SwingFXUtils.fromFXImage(pane.snapshot(null, null), null),
|
||||||
|
"png",
|
||||||
|
output.resolve("intellij.png").toFile());
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
controls(false);
|
||||||
|
build("document-tag");
|
||||||
|
interactive("document-tag", "tag");
|
||||||
|
open("AttachmentToolbar");
|
||||||
|
build("reader-attachment");
|
||||||
|
interactive("reader-attachment", "attachment-save");
|
||||||
|
open("ArchiveWindow");
|
||||||
|
build("archive-window-html-error");
|
||||||
|
interactive("archive-window-html-error", "archive-error");
|
||||||
|
Files.writeString(output.resolve("SUCCESS.txt"), Files.readString(output.resolve("steps.txt")));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,6 +29,7 @@ forms.add_argument("--grid-docking", type=Path, metavar="REFERENCE_FXML", help="
|
|||||||
forms.add_argument("--dock-rules", action="store_true", help="Verify group minima, split directions and persistence in the Archiver")
|
forms.add_argument("--dock-rules", action="store_true", help="Verify group minima, split directions and persistence in the Archiver")
|
||||||
forms.add_argument("--media-layout-grid", action="store_true", help="Verify media permissions, form destinations and grid setups in the Archiver")
|
forms.add_argument("--media-layout-grid", action="store_true", help="Verify media permissions, form destinations and grid setups in the Archiver")
|
||||||
forms.add_argument("--management-readers", action="store_true", help="Verify account and trash commands and the five reader toolbars")
|
forms.add_argument("--management-readers", action="store_true", help="Verify account and trash commands and the five reader toolbars")
|
||||||
|
forms.add_argument("--reader-states", action="store_true", help="Verify the Archiver tag template, attachment export and HTML recovery")
|
||||||
forms.add_argument("--viewer-import", action="store_true", help="Verify HtmlViewer references and retry in the Archiver import dialog")
|
forms.add_argument("--viewer-import", action="store_true", help="Verify HtmlViewer references and retry in the Archiver import dialog")
|
||||||
forms.add_argument("--row-menus", action="store_true", help="Edit Archiver row menu bindings and literal grid group labels")
|
forms.add_argument("--row-menus", action="store_true", help="Edit Archiver row menu bindings and literal grid group labels")
|
||||||
forms.add_argument("--folder-profiles", action="store_true", help="Check the Archiver profile commands and metadata columns")
|
forms.add_argument("--folder-profiles", action="store_true", help="Check the Archiver profile commands and metadata columns")
|
||||||
@@ -37,7 +38,7 @@ forms.add_argument("--import-form", action="store_true", help="Check generic bin
|
|||||||
forms.add_argument("--document-tabs", action="store_true", help="Qualify the production Archiver HTML document tabs")
|
forms.add_argument("--document-tabs", action="store_true", help="Qualify the production Archiver HTML document tabs")
|
||||||
forms.add_argument("--saved-document", action="store_true", help="Open the Archiver saved HTML and tag example")
|
forms.add_argument("--saved-document", action="store_true", help="Open the Archiver saved HTML and tag example")
|
||||||
args = p.parse_args()
|
args = p.parse_args()
|
||||||
if (args.connection_form or args.grid_docking or args.saved_document or args.document_tabs or args.import_form or args.folder_actions or args.viewer_import or args.row_menus or args.folder_profiles or args.management_readers or args.media_layout_grid or args.dock_rules) and not args.archiver:
|
if (args.connection_form or args.grid_docking or args.saved_document or args.document_tabs or args.import_form or args.folder_actions or args.reader_states or args.viewer_import or args.row_menus or args.folder_profiles or args.management_readers or args.media_layout_grid or args.dock_rules) and not args.archiver:
|
||||||
p.error("Selecting an Archiver view requires --archiver")
|
p.error("Selecting an Archiver view requires --archiver")
|
||||||
if args.repeat < 1:
|
if args.repeat < 1:
|
||||||
p.error("--repeat must be positive")
|
p.error("--repeat must be positive")
|
||||||
@@ -49,7 +50,7 @@ modes = ("classpath",) if args.archiver else (("classpath", "modulepath") if arg
|
|||||||
for run_number, mode in ((n, mode) for n in range(1, args.repeat + 1) for mode in modes):
|
for run_number, mode in ((n, mode) for n in range(1, args.repeat + 1) for mode in modes):
|
||||||
crashes = NativeCrashGuard(ROOT)
|
crashes = NativeCrashGuard(ROOT)
|
||||||
launch = subprocess.run([sys.executable, ROOT / "scripts/run-fixture-host.py", "intellij",
|
launch = subprocess.run([sys.executable, ROOT / "scripts/run-fixture-host.py", "intellij",
|
||||||
"--check", *(["--viewer-import"] if args.viewer_import else []), *(["--row-menus"] if args.row_menus else []), *(["--folder-profiles"] if args.folder_profiles else []), *(["--dock-rules"] if args.dock_rules else []), *(["--media-layout-grid"] if args.media_layout_grid else []), *(["--management-readers"] if args.management_readers else []), *(["--folder-actions"] if args.folder_actions else []), *(["--import-form"] if args.import_form else []), *(["--document-tabs"] if args.document_tabs else []), *(["--saved-document"] if args.saved_document else []), *(["--grid-docking", str(args.grid_docking.resolve())] if args.grid_docking else []), *(["--connection-form"] if args.connection_form else []), *(["--archiver", str(args.archiver.resolve())] if args.archiver else []), "--mode", mode, "--java-home", args.java_home,
|
"--check", *(["--reader-states"] if args.reader_states else []), *(["--viewer-import"] if args.viewer_import else []), *(["--row-menus"] if args.row_menus else []), *(["--folder-profiles"] if args.folder_profiles else []), *(["--dock-rules"] if args.dock_rules else []), *(["--media-layout-grid"] if args.media_layout_grid else []), *(["--management-readers"] if args.management_readers else []), *(["--folder-actions"] if args.folder_actions else []), *(["--import-form"] if args.import_form else []), *(["--document-tabs"] if args.document_tabs else []), *(["--saved-document"] if args.saved_document else []), *(["--grid-docking", str(args.grid_docking.resolve())] if args.grid_docking else []), *(["--connection-form"] if args.connection_form else []), *(["--archiver", str(args.archiver.resolve())] if args.archiver else []), "--mode", mode, "--java-home", args.java_home,
|
||||||
"--target-java-home", args.target_java_home, "--idea-home", args.idea_home],
|
"--target-java-home", args.target_java_home, "--idea-home", args.idea_home],
|
||||||
cwd=ROOT, text=True, capture_output=True, timeout=60)
|
cwd=ROOT, text=True, capture_output=True, timeout=60)
|
||||||
if launch.returncode:
|
if launch.returncode:
|
||||||
@@ -93,7 +94,7 @@ for run_number, mode in ((n, mode) for n in range(1, args.repeat + 1) for mode i
|
|||||||
shutil.copyfile(base / "intellij.png", output / (mode + ".png"))
|
shutil.copyfile(base / "intellij.png", output / (mode + ".png"))
|
||||||
(evidence / "proof.json").write_text(json.dumps(proof, indent=2) + "\n")
|
(evidence / "proof.json").write_text(json.dumps(proof, indent=2) + "\n")
|
||||||
finally:
|
finally:
|
||||||
for name in ("viewer-target.png", "import-pending.png", "import-failed.png", "import-retried.png", "import-new-session.png", "row-folders.png", "row-types.png", "folder-metadata.png", "dock-horizontal.png", "dock-vertical.png", "dock-empty-kept.png", "dock-empty-removed.png", "media-granted.png", "details-moved.png", "trash-split.png", "grid-group.png", "reader-pdf.png", "reader-epub.png", "reader-slides.png", "reader-attachment.png", "management-accounts.png", "management-trash.png", "reader-icon.png", "folder-events.png", "folder-search.png", "folder-profile.png", "result-folder-actions", "result-detail-action", "details-invoice-tags.png", "details-delivery-tags.png", "details-invoice.png", "details-delivery.png", "details-readonly.png", "details-busy.png", "html-invoice.png", "html-delivery.png", "rechnung-zwei-tags.png", "import-collision.png", "import-accepted.png", "result-import-free", "result-import-busy", "result-import-collision", "result-import-grid", "SUCCESS.txt", "FAILURE.txt", "ui-state.txt", "launcher.log", "steps.txt", "target-error.txt", "preview-restored.png", "imap.png", "jmap.png", "invoice.png", "delivery.png", "saved-document-result", "saved-bindings.fxml", "binding-article.png", "binding-dynamic.png", "tags-Pr.png", "tags-Re.png", "tags-Li.png", "document-tabs-result", "rechnung-tab.png", "lieferschein-tab.png", "rechnung-tab-tags.png", "lieferschein-tab-tags.png", "folder.png", "right.png", "bottom.png", "result-folder", "result-right", "result-bottom", "intellij.png"):
|
for name in ("tag-editable.png", "tag-readonly.png", "tag-busy.png", "unknown-attachment.png", "html-load-error.png", "html-load-recovered.png", "html-load-started.png", "viewer-target.png", "import-pending.png", "import-failed.png", "import-retried.png", "import-new-session.png", "row-folders.png", "row-types.png", "folder-metadata.png", "dock-horizontal.png", "dock-vertical.png", "dock-empty-kept.png", "dock-empty-removed.png", "media-granted.png", "details-moved.png", "trash-split.png", "grid-group.png", "reader-pdf.png", "reader-epub.png", "reader-slides.png", "reader-attachment.png", "management-accounts.png", "management-trash.png", "reader-icon.png", "folder-events.png", "folder-search.png", "folder-profile.png", "result-folder-actions", "result-detail-action", "details-invoice-tags.png", "details-delivery-tags.png", "details-invoice.png", "details-delivery.png", "details-readonly.png", "details-busy.png", "html-invoice.png", "html-delivery.png", "rechnung-zwei-tags.png", "import-collision.png", "import-accepted.png", "result-import-free", "result-import-busy", "result-import-collision", "result-import-grid", "SUCCESS.txt", "FAILURE.txt", "ui-state.txt", "launcher.log", "steps.txt", "target-error.txt", "preview-restored.png", "imap.png", "jmap.png", "invoice.png", "delivery.png", "saved-document-result", "saved-bindings.fxml", "binding-article.png", "binding-dynamic.png", "tags-Pr.png", "tags-Re.png", "tags-Li.png", "document-tabs-result", "rechnung-tab.png", "lieferschein-tab.png", "rechnung-tab-tags.png", "lieferschein-tab-tags.png", "folder.png", "right.png", "bottom.png", "result-folder", "result-right", "result-bottom", "intellij.png"):
|
||||||
if (base / name).exists():
|
if (base / name).exists():
|
||||||
shutil.copyfile(base / name, evidence / name)
|
shutil.copyfile(base / name, evidence / name)
|
||||||
workers = descendant_workers(pid)
|
workers = descendant_workers(pid)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ forms.add_argument("--grid-docking", type=Path, metavar="REFERENCE_FXML", help="
|
|||||||
forms.add_argument("--dock-rules", action="store_true", help="Verify group minima, split directions and persistence in the Archiver")
|
forms.add_argument("--dock-rules", action="store_true", help="Verify group minima, split directions and persistence in the Archiver")
|
||||||
forms.add_argument("--media-layout-grid", action="store_true", help="Verify media permissions, form destinations and grid setups in the Archiver")
|
forms.add_argument("--media-layout-grid", action="store_true", help="Verify media permissions, form destinations and grid setups in the Archiver")
|
||||||
forms.add_argument("--management-readers", action="store_true", help="Verify account and trash commands and the five reader toolbars")
|
forms.add_argument("--management-readers", action="store_true", help="Verify account and trash commands and the five reader toolbars")
|
||||||
|
forms.add_argument("--reader-states", action="store_true", help="Verify the Archiver tag template, attachment export and HTML recovery")
|
||||||
forms.add_argument("--viewer-import", action="store_true", help="Verify HtmlViewer references and retry in the Archiver import dialog")
|
forms.add_argument("--viewer-import", action="store_true", help="Verify HtmlViewer references and retry in the Archiver import dialog")
|
||||||
forms.add_argument("--row-menus", action="store_true", help="Edit Archiver row menu bindings and literal grid group labels")
|
forms.add_argument("--row-menus", action="store_true", help="Edit Archiver row menu bindings and literal grid group labels")
|
||||||
forms.add_argument("--folder-profiles", action="store_true", help="Check the Archiver profile commands and metadata columns")
|
forms.add_argument("--folder-profiles", action="store_true", help="Check the Archiver profile commands and metadata columns")
|
||||||
@@ -33,7 +34,7 @@ forms.add_argument("--import-form", action="store_true", help="Check generic bin
|
|||||||
forms.add_argument("--document-tabs", action="store_true", help="Qualify the production Archiver HTML document tabs")
|
forms.add_argument("--document-tabs", action="store_true", help="Qualify the production Archiver HTML document tabs")
|
||||||
forms.add_argument("--saved-document", action="store_true", help="Open the Archiver saved HTML and tag example")
|
forms.add_argument("--saved-document", action="store_true", help="Open the Archiver saved HTML and tag example")
|
||||||
args = p.parse_args()
|
args = p.parse_args()
|
||||||
if (args.connection_form or args.grid_docking or args.saved_document or args.document_tabs or args.import_form or args.folder_actions or args.viewer_import or args.row_menus or args.folder_profiles or args.management_readers or args.media_layout_grid or args.dock_rules) and not args.archiver:
|
if (args.connection_form or args.grid_docking or args.saved_document or args.document_tabs or args.import_form or args.folder_actions or args.reader_states or args.viewer_import or args.row_menus or args.folder_profiles or args.management_readers or args.media_layout_grid or args.dock_rules) and not args.archiver:
|
||||||
p.error("Selecting an Archiver view requires --archiver")
|
p.error("Selecting an Archiver view requires --archiver")
|
||||||
base = Path(tempfile.mkdtemp(prefix="neitzel-designer-host-")).resolve()
|
base = Path(tempfile.mkdtemp(prefix="neitzel-designer-host-")).resolve()
|
||||||
project = base / "project"
|
project = base / "project"
|
||||||
@@ -44,10 +45,12 @@ if args.archiver:
|
|||||||
subprocess.run([sys.executable, ROOT / "scripts/configure-library-example.py", "--project", project,
|
subprocess.run([sys.executable, ROOT / "scripts/configure-library-example.py", "--project", project,
|
||||||
"--target-java-home", args.target_java_home], check=True)
|
"--target-java-home", args.target_java_home], check=True)
|
||||||
view = "ConnectionForm" if args.connection_form else "ArchiveWindow"
|
view = "ConnectionForm" if args.connection_form else "ArchiveWindow"
|
||||||
if args.media_layout_grid or args.viewer_import:
|
if args.media_layout_grid or args.reader_states or args.viewer_import:
|
||||||
view = "HtmlDocument"
|
view = "HtmlDocument"
|
||||||
if args.management_readers:
|
if args.management_readers:
|
||||||
view = "MailControls"
|
view = "MailControls"
|
||||||
|
if args.reader_states:
|
||||||
|
view = "DocumentTag"
|
||||||
if args.folder_profiles or args.row_menus:
|
if args.folder_profiles or args.row_menus:
|
||||||
view = "FolderTab"
|
view = "FolderTab"
|
||||||
if args.folder_actions:
|
if args.folder_actions:
|
||||||
@@ -121,6 +124,8 @@ else:
|
|||||||
suite = "MediaLayoutGrid"
|
suite = "MediaLayoutGrid"
|
||||||
elif args.management_readers:
|
elif args.management_readers:
|
||||||
suite = "ManagementReaders"
|
suite = "ManagementReaders"
|
||||||
|
elif args.reader_states:
|
||||||
|
suite = "ReaderStates"
|
||||||
elif args.viewer_import:
|
elif args.viewer_import:
|
||||||
suite = "ViewerImport"
|
suite = "ViewerImport"
|
||||||
elif args.row_menus:
|
elif args.row_menus:
|
||||||
@@ -137,9 +142,9 @@ else:
|
|||||||
suite = "SavedDocument"
|
suite = "SavedDocument"
|
||||||
probe = f"{suite}WorkflowProbe" if args.archiver else "WorkflowProbe"
|
probe = f"{suite}WorkflowProbe" if args.archiver else "WorkflowProbe"
|
||||||
files = [sources / "WorkflowProbe.java"]
|
files = [sources / "WorkflowProbe.java"]
|
||||||
if args.connection_form or args.saved_document or args.document_tabs or args.import_form or args.folder_actions or args.viewer_import or args.row_menus or args.folder_profiles or args.management_readers or args.media_layout_grid or args.dock_rules:
|
if args.connection_form or args.saved_document or args.document_tabs or args.import_form or args.folder_actions or args.reader_states or args.viewer_import or args.row_menus or args.folder_profiles or args.management_readers or args.media_layout_grid or args.dock_rules:
|
||||||
files.append(sources / "FormWorkflowProbe.java")
|
files.append(sources / "FormWorkflowProbe.java")
|
||||||
if args.media_layout_grid or args.dock_rules or args.viewer_import or args.row_menus or args.folder_profiles:
|
if args.media_layout_grid or args.dock_rules or args.reader_states or args.viewer_import or args.row_menus or args.folder_profiles:
|
||||||
files.append(sources / "DeclarationWorkflowProbe.java")
|
files.append(sources / "DeclarationWorkflowProbe.java")
|
||||||
if args.archiver:
|
if args.archiver:
|
||||||
files.append(sources / f"{probe}.java")
|
files.append(sources / f"{probe}.java")
|
||||||
@@ -147,7 +152,7 @@ else:
|
|||||||
agent_classes = base / "agent-classes"
|
agent_classes = base / "agent-classes"
|
||||||
agent_classes.mkdir()
|
agent_classes.mkdir()
|
||||||
subprocess.run([args.java_home / "bin/javac", "-cp", os.pathsep.join(map(str,jars)), "-d", agent_classes,
|
subprocess.run([args.java_home / "bin/javac", "-cp", os.pathsep.join(map(str,jars)), "-d", agent_classes,
|
||||||
sources / f"{target_probe}.java", *([sources / "FolderActionsTargetProbe.java"] if args.folder_profiles or args.viewer_import or args.row_menus else [])], check=True)
|
sources / f"{target_probe}.java", *([sources / "DocumentTabsTargetProbe.java"] if args.reader_states else []), *([sources / "FolderActionsTargetProbe.java"] if args.folder_profiles or args.reader_states or args.viewer_import or args.row_menus else [])], check=True)
|
||||||
agent = base / "archiver-ui-check.jar"
|
agent = base / "archiver-ui-check.jar"
|
||||||
with zipfile.ZipFile(agent, "w") as archive:
|
with zipfile.ZipFile(agent, "w") as archive:
|
||||||
archive.writestr("META-INF/MANIFEST.MF", f"Manifest-Version: 1.0\nPremain-Class: qualification.{target_probe}\n\n")
|
archive.writestr("META-INF/MANIFEST.MF", f"Manifest-Version: 1.0\nPremain-Class: qualification.{target_probe}\n\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user