Qualify Archiver management commands and reader actions in IntelliJ
This commit is contained in:
@@ -89,6 +89,8 @@ Add `--saved-document` to the Archiver launcher or host check to open the design
|
||||
|
||||
Use `--import-form` with `scripts/check-ide-host.py --archiver ../Archiver` and the same JDK and IDEA options to verify seven generic binding targets. The check saves and reopens bindings on the folder grid and import selector, then exercises the free, conflicting and busy import examples in the registered editor.
|
||||
|
||||
Use `--management-readers` with the Archiver host check to exercise the two account states, the empty and populated trash, and all five reader toolbars. The check saves and reopens CommandBinding changes in both management forms and an icon and accessible text change in the picture toolbar.
|
||||
|
||||
Use `--folder-actions` with the Archiver host check to edit a text field’s column count, accessible name and controller action, then exercise the folder toolbar’s dismiss handler, full-text search, multiple selection and saved display profiles.
|
||||
|
||||
Use `--document-tabs` with the Archiver host check to open the production archive window and select **Archiver · HTML-Dokumenttabs**. The check also opens the production HTML and details FXML files directly, edits the assigned-tag Component and the input prompt through the visual inspector, and reopens the saved files. In the archive window it adds a second tag to the invoice, switches to the delivery note and back, removes the selected tag, and checks each WebView and suggestion popup. Direct examples cover read-only and busy states.
|
||||
|
||||
@@ -0,0 +1,388 @@
|
||||
package qualification;
|
||||
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import javafx.application.Platform;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.shape.SVGPath;
|
||||
import javafx.stage.*;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
/** Acts on the actual controls in the interactive Archiver worker. */
|
||||
public final class ManagementReadersTargetProbe {
|
||||
public static void premain(String dir) {
|
||||
if (System.getProperty("sun.java.command", "")
|
||||
.startsWith("de.neitzel.fxdesigner.target.WorkerMain "))
|
||||
Thread.ofPlatform().daemon().start(() -> Worker.run(Path.of(dir)));
|
||||
}
|
||||
|
||||
private static final class Worker {
|
||||
private static <T> T fx(Callable<T> action) throws Exception {
|
||||
var task = new FutureTask<>(action);
|
||||
Platform.runLater(task);
|
||||
return task.get(10, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
private static void require(boolean value, String message) {
|
||||
if (!value) throw new AssertionError(message);
|
||||
}
|
||||
|
||||
private static void run(Path dir) {
|
||||
try {
|
||||
Stage stage = null;
|
||||
while (stage == null) {
|
||||
Thread.sleep(120);
|
||||
try {
|
||||
stage =
|
||||
fx(
|
||||
() ->
|
||||
Window.getWindows().stream()
|
||||
.filter(
|
||||
w ->
|
||||
w instanceof Stage s
|
||||
&& s.isShowing()
|
||||
&& s.getOpacity() > 0
|
||||
&& s.getTitle() != null
|
||||
&& s.getTitle().startsWith("Neitzel preview"))
|
||||
.map(Stage.class::cast)
|
||||
.findFirst()
|
||||
.orElse(null));
|
||||
} catch (IllegalStateException starting) {
|
||||
}
|
||||
}
|
||||
Stage shown = stage;
|
||||
var attempt = Files.readString(dir.resolve("management-case"));
|
||||
boolean management = attempt.startsWith("accounts-") || attempt.startsWith("trash-");
|
||||
var root =
|
||||
fx(
|
||||
() -> {
|
||||
shown.setWidth(management ? 900 : 920);
|
||||
shown.setHeight(management ? 600 : 135);
|
||||
var r = shown.getScene().getRoot();
|
||||
r.applyCss();
|
||||
r.layout();
|
||||
return r;
|
||||
});
|
||||
String result =
|
||||
fx(
|
||||
() ->
|
||||
switch (attempt) {
|
||||
case "accounts-idle", "accounts-busy", "accounts-idle-edited" ->
|
||||
accounts(root, attempt, dir);
|
||||
case "trash-full", "trash-empty", "trash-full-edited" ->
|
||||
trash(root, attempt, dir);
|
||||
default -> reader(root, attempt, dir);
|
||||
});
|
||||
if (attempt.equals("accounts-idle")) {
|
||||
fx(
|
||||
() -> {
|
||||
root.applyCss();
|
||||
root.layout();
|
||||
var display = (javafx.scene.text.Text) root.lookup("#details").lookup(".text");
|
||||
require(
|
||||
display.getText().contains("mail.example.invalid"),
|
||||
"Account endpoint clipped: " + display.getText());
|
||||
image(root, dir.resolve("management-accounts.png"));
|
||||
return null;
|
||||
});
|
||||
}
|
||||
if (attempt.equals("slides")) {
|
||||
verifyPlayback(root);
|
||||
result += " · automatischer Bildwechsel und Stillstand nach Pause";
|
||||
}
|
||||
Files.writeString(dir.resolve("result-" + attempt), 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 ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void verifyPlayback(Node root) throws Exception {
|
||||
// Begin on the last slide so one advance also exercises automatic wraparound.
|
||||
fx(
|
||||
() -> {
|
||||
button(root, "next").fire();
|
||||
button(root, "next").fire();
|
||||
button(root, "playback").fire();
|
||||
return null;
|
||||
});
|
||||
long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(12);
|
||||
while (!fx(() -> label(root, "reader-sample").startsWith("1 / 3"))) {
|
||||
if (System.nanoTime() > deadline) throw new AssertionError("No automatic advance");
|
||||
Thread.sleep(80);
|
||||
}
|
||||
fx(
|
||||
() -> {
|
||||
button(root, "playback").fire();
|
||||
return null;
|
||||
});
|
||||
Thread.sleep(4500);
|
||||
require(
|
||||
fx(
|
||||
() ->
|
||||
label(root, "reader-sample").startsWith("1 / 3")
|
||||
&& button(root, "playback").getAccessibleText().equals("Abspielen")),
|
||||
"Advanced during pause");
|
||||
}
|
||||
|
||||
private static Button button(Node root, String id) {
|
||||
return (Button) Objects.requireNonNull(root.lookup("#" + id), id);
|
||||
}
|
||||
|
||||
private static String label(Node root, String id) {
|
||||
return ((Label) root.lookup("#" + id)).getText();
|
||||
}
|
||||
|
||||
private static void enabled(Node root, String id, boolean expected) {
|
||||
require(!button(root, id).isDisabled() == expected, id + " enabled=" + expected);
|
||||
}
|
||||
|
||||
private static String accounts(Node root, String attempt, Path dir) throws Exception {
|
||||
var list = (ListView<?>) root.lookup("#accounts");
|
||||
require(
|
||||
list.getItems().stream().map(Object::toString).toList().equals(List.of("Privat", "Büro")),
|
||||
"Accounts");
|
||||
if (attempt.endsWith("busy")) {
|
||||
require(list.isDisabled() && label(root, "status").contains("läuft"), "Busy list/status");
|
||||
for (var id :
|
||||
List.of(
|
||||
"create",
|
||||
"configure",
|
||||
"activate",
|
||||
"fetch",
|
||||
"verify",
|
||||
"release",
|
||||
"revoke",
|
||||
"expire",
|
||||
"close")) {
|
||||
enabled(root, id, false);
|
||||
button(root, id).fire();
|
||||
}
|
||||
require(label(root, "status").contains("läuft"), "Busy action ran");
|
||||
return "Abruf läuft · alle neun Commands und Kontenauswahl gesperrt";
|
||||
}
|
||||
require(label(root, "details").contains("kein Serverprofil"), "Local details");
|
||||
enabled(root, "configure", true);
|
||||
enabled(root, "fetch", false);
|
||||
list.getSelectionModel().select(1);
|
||||
require(
|
||||
label(root, "details").contains("mail.example.invalid")
|
||||
&& label(root, "details").contains("30 Tage"),
|
||||
"Office details");
|
||||
if (attempt.endsWith("edited")) {
|
||||
button(root, "configure").fire();
|
||||
require(
|
||||
label(root, "status").equals("Beispielaktion · CREATE · Büro"), "Remapped configure");
|
||||
return "configure → create nach Wiederöffnen am Konto Büro ausgelöst";
|
||||
}
|
||||
button(root, "configure").fire();
|
||||
require(label(root, "status").contains("CONFIGURE · Büro"), "Configure office");
|
||||
button(root, "fetch").fire();
|
||||
require(label(root, "status").contains("CONFIGURE · Büro"), "Disabled fetch executed");
|
||||
for (var action :
|
||||
List.of(
|
||||
"activate", "fetch", "verify", "release", "expire", "revoke", "create", "close")) {
|
||||
enabled(root, action, true);
|
||||
button(root, action).fire();
|
||||
require(
|
||||
label(root, "status").contains(action.toUpperCase(Locale.ROOT) + " · Büro"), action);
|
||||
}
|
||||
enabled(root, "expire", false);
|
||||
return "Privat ohne Serverprofil, Büro mit IMAP · Aktivierung, Abruf, Prüflauf, Freigabe,"
|
||||
+ " Löschlauf und Widerruf geprüft";
|
||||
}
|
||||
|
||||
private static String trash(Node root, String attempt, Path dir) throws Exception {
|
||||
var items = (TableView<?>) root.lookup("#trash-items");
|
||||
var files = (TableView<?>) root.lookup("#trash-files");
|
||||
if (attempt.endsWith("empty")) {
|
||||
require(
|
||||
items.getItems().isEmpty()
|
||||
&& files.getItems().isEmpty()
|
||||
&& label(root, "summary").equals("0 Einträge · 0 Dateien"),
|
||||
"Empty trash");
|
||||
enabled(root, "trash-delete", false);
|
||||
enabled(root, "trash-empty", false);
|
||||
return "Leerer Papierkorb · beide Commands gesperrt";
|
||||
}
|
||||
require(label(root, "summary").equals("2 Einträge · 3 Dateien"), "Initial summary");
|
||||
items.getSelectionModel().clearSelection();
|
||||
require(files.getItems().isEmpty(), "Files without selection");
|
||||
enabled(root, "trash-delete", false);
|
||||
enabled(root, "trash-empty", true);
|
||||
items.getSelectionModel().select(0);
|
||||
require(
|
||||
files.getItems().size() == 2
|
||||
&& files.getItems().getFirst().toString().contains("Rechnung.pdf")
|
||||
&& files.getItems().getLast().toString().contains("Lieferschein.md"),
|
||||
"Folder file list");
|
||||
enabled(root, "trash-delete", true);
|
||||
items.getSelectionModel().select(1);
|
||||
require(
|
||||
files.getItems().size() == 3
|
||||
&& files.getItems().getLast().toString().contains("Notiz.txt"),
|
||||
"Multiple file list");
|
||||
if (attempt.endsWith("edited")) {
|
||||
button(root, "trash-delete").fire();
|
||||
require(
|
||||
label(root, "example-trash-action").equals("Wiederherstellen · Belege, Notiz.txt"),
|
||||
"Restore selection");
|
||||
require(
|
||||
items.getItems().isEmpty() && files.getItems().isEmpty(), "Restored items retained");
|
||||
return "delete → restoreSelection nach Wiederöffnen · Belege und Notiz.txt"
|
||||
+ " wiederhergestellt";
|
||||
}
|
||||
image(root, dir.resolve("management-trash.png"));
|
||||
items.getSelectionModel().clearAndSelect(1);
|
||||
button(root, "trash-delete").fire();
|
||||
require(
|
||||
label(root, "example-trash-action").equals("Löschen · Notiz.txt")
|
||||
&& label(root, "summary").equals("1 Einträge · 2 Dateien"),
|
||||
"Delete selection");
|
||||
button(root, "trash-empty").fire();
|
||||
require(
|
||||
label(root, "example-trash-action").equals("Leeren · Belege")
|
||||
&& items.getItems().isEmpty()
|
||||
&& files.getItems().isEmpty()
|
||||
&& label(root, "summary").equals("0 Einträge · 0 Dateien"),
|
||||
"Empty action");
|
||||
enabled(root, "trash-empty", false);
|
||||
enabled(root, "trash-delete", false);
|
||||
return "0/1/2 ausgewählte Einträge · Dateilisten und Summary geprüft · Notiz gelöscht und"
|
||||
+ " Ordner geleert";
|
||||
}
|
||||
|
||||
private static String reader(Node root, String attempt, Path dir) throws Exception {
|
||||
if (attempt.equals("attachment")) {
|
||||
var pick = (ComboBox<?>) root.lookup("#example-attachments");
|
||||
for (var id : List.of("open-attachment", "save-attachment")) enabled(root, id, false);
|
||||
pick.getSelectionModel().selectFirst();
|
||||
for (var id : List.of("open-attachment", "save-attachment")) {
|
||||
enabled(root, id, true);
|
||||
button(root, id).fire();
|
||||
String verb = id.startsWith("open") ? "Geöffnet" : "Gespeichert";
|
||||
require(
|
||||
label(root, "attachment-result")
|
||||
.equals(verb + " · Lieferschein.txt · LS-018 · Drei Archivkartons"),
|
||||
id);
|
||||
}
|
||||
image(root, dir.resolve("reader-attachment.png"));
|
||||
pick.getSelectionModel().clearSelection();
|
||||
for (var id : List.of("open-attachment", "save-attachment")) enabled(root, id, false);
|
||||
return "Ohne Auswahl gesperrt · Lieferschein.txt geöffnet und Sitzungskopie mit gleichem"
|
||||
+ " Inhalt gespeichert";
|
||||
}
|
||||
var suffix =
|
||||
switch (attempt) {
|
||||
case "pdf" -> "-page";
|
||||
case "epub" -> "-chapter";
|
||||
case "images" -> "-image";
|
||||
default -> "";
|
||||
};
|
||||
var back = button(root, "previous" + suffix);
|
||||
var next = button(root, "next" + suffix);
|
||||
var state = attempt.equals("images") ? "image-position" : "reader-sample";
|
||||
var names =
|
||||
switch (attempt) {
|
||||
case "pdf" -> List.of("Deckblatt", "Rechnungspositionen", "Zahlungsziel");
|
||||
case "epub" -> List.of("Ankunft", "Im Archiv", "Heimweg");
|
||||
default -> List.of("Eingang.jpg", "Regal.jpg", "Ausgang.jpg");
|
||||
};
|
||||
for (int i = 0; i < 3; i++) {
|
||||
require(
|
||||
back.isDisabled() == (i == 0) && next.isDisabled() == (i == 2), "Boundaries at " + i);
|
||||
require(label(root, state).equals((i + 1) + " / 3 · " + names.get(i)), label(root, state));
|
||||
if (i == 2) break;
|
||||
next.fire();
|
||||
}
|
||||
next.fire();
|
||||
for (int i = 2; i >= 0; i--) {
|
||||
require(
|
||||
label(root, state).startsWith((i + 1) + " / 3") && back.isDisabled() == (i == 0),
|
||||
"Return " + i);
|
||||
back.fire();
|
||||
}
|
||||
switch (attempt) {
|
||||
case "images" -> {
|
||||
var svg = (SVGPath) back.getGraphic().lookup("SVGPath");
|
||||
require(
|
||||
"Bild zurück".equals(back.getAccessibleText())
|
||||
&& "Bild zurück".equals(back.getTooltip().getText())
|
||||
&& svg.getContent().startsWith("M1 8 Q8"),
|
||||
"Saved accessible text / VIEW graphic");
|
||||
image(root, dir.resolve("reader-icon.png"));
|
||||
}
|
||||
case "pdf" -> {
|
||||
var page = (TextField) root.lookup("#page-number");
|
||||
page.setText("3");
|
||||
page.fireEvent(new ActionEvent());
|
||||
require(
|
||||
next.isDisabled()
|
||||
&& page.getText().equals("3")
|
||||
&& label(root, state).contains("Zahlungsziel"),
|
||||
"Page entry");
|
||||
page.setText("99");
|
||||
page.fireEvent(new ActionEvent());
|
||||
require(page.getText().equals("3"), "Out-of-range page");
|
||||
((ChoiceBox<?>) root.lookup("#page-zoom")).getSelectionModel().select(3);
|
||||
require(
|
||||
((Label) root.lookup("#reader-sample")).getFont().getSize() == 24, "150 % page zoom");
|
||||
}
|
||||
case "epub" -> {
|
||||
((ChoiceBox<?>) root.lookup("#chapters")).getSelectionModel().select(1);
|
||||
require(label(root, state).contains("Im Archiv"), "Chapter choice");
|
||||
var sample = (Label) root.lookup("#reader-sample");
|
||||
button(root, "larger").fire();
|
||||
require(sample.getFont().getSize() == 20, "Larger font");
|
||||
button(root, "smaller").fire();
|
||||
require(sample.getFont().getSize() == 18, "Smaller font");
|
||||
}
|
||||
case "slides" -> {
|
||||
var play = button(root, "playback");
|
||||
var playPath = ((SVGPath) play.getGraphic().lookup("SVGPath")).getContent();
|
||||
require("Abspielen".equals(play.getAccessibleText()), "Play action");
|
||||
play.fire();
|
||||
require(
|
||||
"Pause".equals(play.getAccessibleText())
|
||||
&& !playPath.equals(((SVGPath) play.getGraphic().lookup("SVGPath")).getContent()),
|
||||
"Pause action");
|
||||
play.fire();
|
||||
require(
|
||||
"Abspielen".equals(play.getAccessibleText())
|
||||
&& playPath.equals(((SVGPath) play.getGraphic().lookup("SVGPath")).getContent()),
|
||||
"Restored Play");
|
||||
}
|
||||
}
|
||||
if (!attempt.equals("images")) image(root, dir.resolve("reader-" + attempt + ".png"));
|
||||
return switch (attempt) {
|
||||
case "images" ->
|
||||
"1 → 2 → 3 → 2 → 1 · Bildnamen, Grenzsperren, gespeichertes VIEW-Symbol und"
|
||||
+ " Beschreibung geprüft";
|
||||
case "pdf" -> "Seitennavigation und Grenzsperren · Eingabe Seite 3 · Zoom 150 %";
|
||||
case "epub" ->
|
||||
"Kapitelnavigation und Grenzsperren · Kapitel Im Archiv · Schrift 18 → 20 → 18";
|
||||
default ->
|
||||
"Bildnavigation und Grenzsperren · Abspielen → Pause → Abspielen mit wechselnder"
|
||||
+ " Grafik";
|
||||
};
|
||||
}
|
||||
|
||||
private static void image(Node node, Path path) throws Exception {
|
||||
var img = node.snapshot(null, null);
|
||||
int w = (int) img.getWidth(), h = (int) img.getHeight();
|
||||
var out = new java.awt.image.BufferedImage(w, h, java.awt.image.BufferedImage.TYPE_INT_ARGB);
|
||||
int[] pixels = new int[w * h];
|
||||
img.getPixelReader()
|
||||
.getPixels(0, 0, w, h, javafx.scene.image.PixelFormat.getIntArgbInstance(), pixels, 0, w);
|
||||
out.setRGB(0, 0, w, h, pixels, 0, w);
|
||||
ImageIO.write(out, "png", path.toFile());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package qualification;
|
||||
|
||||
import static qualification.WorkflowProbe.*;
|
||||
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.oracle.javafx.scenebuilder.kit.fxom.FXOMFxIdIndex;
|
||||
import de.neitzel.fxdesigner.workflow.DesignerWorkflow.Example;
|
||||
import java.nio.file.*;
|
||||
import javafx.embed.swing.SwingFXUtils;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
/** Changes the draft via the registered inspector, then exercises its managed worker. */
|
||||
public final class ManagementReadersWorkflowProbe extends FormWorkflowProbe {
|
||||
private Project project;
|
||||
|
||||
void verify(Project project) throws Exception {
|
||||
this.project = project;
|
||||
management(
|
||||
"MailControls", "accounts-idle", "accounts-busy", "configure", "configure", "create", 9);
|
||||
management(
|
||||
"TrashPane",
|
||||
"trash-full",
|
||||
"trash-empty",
|
||||
"delete",
|
||||
"deleteSelection",
|
||||
"restoreSelection",
|
||||
2);
|
||||
open("ReaderNavigation");
|
||||
attribute("symbol", "VIEW");
|
||||
attribute("accessibleText", "Bild zurück");
|
||||
reopen("ReaderNavigation", "accessibleText=\"Bild zurück\"");
|
||||
build("reader-images");
|
||||
interactive("reader-images", "images");
|
||||
for (String[] reader :
|
||||
new String[][] {
|
||||
{"PdfToolbar", "pdf"},
|
||||
{"EpubToolbar", "epub"},
|
||||
{"SlideshowToolbar", "slides"},
|
||||
{"AttachmentToolbar", "attachment"}
|
||||
}) {
|
||||
open(reader[0]);
|
||||
String id = "reader-" + reader[1];
|
||||
build(id);
|
||||
interactive(id, reader[1]);
|
||||
}
|
||||
Files.writeString(output.resolve("SUCCESS.txt"), Files.readString(output.resolve("steps.txt")));
|
||||
}
|
||||
|
||||
private void open(String name) throws Exception {
|
||||
var path =
|
||||
Path.of(project.getBasePath(), "src/main/resources/de/neitzel/archiver/ui", name + ".fxml");
|
||||
file = edt(() -> LocalFileSystem.getInstance().refreshAndFindFileByNioFile(path));
|
||||
pane = openDesigner(project, file);
|
||||
if (!source().contains("<?neitzel-model de.neitzel.archiver.ui."))
|
||||
throw new AssertionError(name);
|
||||
}
|
||||
|
||||
private void build(String id) throws Exception {
|
||||
click(pane, "Form preview");
|
||||
click(pane, "Build and Refresh");
|
||||
await(
|
||||
() ->
|
||||
fx(
|
||||
() ->
|
||||
((ComboBox<?>) pane.lookup("#preview-example"))
|
||||
.getItems().stream().anyMatch(item -> item.toString().contains(id))));
|
||||
}
|
||||
|
||||
private void interactive(String id, String attempt) throws Exception {
|
||||
choose("preview-example", id);
|
||||
await(
|
||||
() ->
|
||||
fx(
|
||||
() -> {
|
||||
var state = ((Label) pane.lookup("#preview-state")).getText();
|
||||
if (state.startsWith("Preview failed")
|
||||
|| state.startsWith("Preview blocked")
|
||||
|| state.startsWith("Preview unavailable"))
|
||||
throw new AssertionError(id + " · " + state);
|
||||
var choice = (Example) ((ComboBox<?>) pane.lookup("#preview-example")).getValue();
|
||||
return ((ImageView) pane.lookup("#full-preview-image")).getImage() != null
|
||||
&& state.contains(choice.label());
|
||||
}));
|
||||
Files.writeString(output.resolve("management-case"), attempt);
|
||||
click(pane, "Interactive preview");
|
||||
String name = "result-" + attempt;
|
||||
awaitTarget(name);
|
||||
step(id + " · " + Files.readString(output.resolve(name)));
|
||||
click(pane, "Stop preview");
|
||||
}
|
||||
|
||||
private void reopen(String form, String saved) throws Exception {
|
||||
click(pane, "Save");
|
||||
await(() -> Files.readString(Path.of(file.getPath())).contains(saved));
|
||||
edt(
|
||||
() -> {
|
||||
FileEditorManager.getInstance(project).closeFile(file);
|
||||
return null;
|
||||
});
|
||||
open(form);
|
||||
if (!source().contains(saved)) throw new AssertionError("Reopened " + form);
|
||||
}
|
||||
|
||||
private void commands(String control, String path, int count) throws Exception {
|
||||
fx(
|
||||
() -> {
|
||||
var group =
|
||||
(TitledPane)
|
||||
pane.lookupAll(".titled-pane").stream()
|
||||
.filter(n -> n instanceof TitledPane t && "Bindings".equals(t.getText()))
|
||||
.findFirst()
|
||||
.orElseThrow();
|
||||
group.setExpanded(true);
|
||||
var tabs = (TabPane) group.getContent();
|
||||
tabs.getSelectionModel()
|
||||
.select(
|
||||
tabs.getTabs().stream()
|
||||
.filter(t -> t.getText().equals("Command bindings"))
|
||||
.findFirst()
|
||||
.orElseThrow());
|
||||
pane.applyCss();
|
||||
pane.layout();
|
||||
var list = (ListView<?>) pane.lookup("#command-bindings");
|
||||
if (list.getItems().size() != count) throw new AssertionError(list.getItems());
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (list.getItems().get(i).toString().startsWith(control + " ←"))
|
||||
list.getSelectionModel().select(i);
|
||||
}
|
||||
if (!control.equals(((TextField) pane.lookup("#command-control")).getText())
|
||||
|| !path.equals(((TextField) pane.lookup("#command-path")).getText()))
|
||||
throw new AssertionError(control + " → " + path);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
private void management(
|
||||
String form,
|
||||
String data,
|
||||
String other,
|
||||
String control,
|
||||
String path,
|
||||
String replacement,
|
||||
int count)
|
||||
throws Exception {
|
||||
open(form);
|
||||
build(data);
|
||||
interactive(data, data);
|
||||
interactive(other, other);
|
||||
commands(control, path, count);
|
||||
fx(
|
||||
() -> {
|
||||
((TextField) pane.lookup("#command-path")).setText(replacement);
|
||||
return null;
|
||||
});
|
||||
click(pane, "Apply Command binding");
|
||||
String edited = "control=\"" + control + "\" path=\"" + replacement + "\"";
|
||||
await(() -> source().contains(edited));
|
||||
reopen(form, edited);
|
||||
commands(control, replacement, count);
|
||||
if (form.equals("MailControls")) {
|
||||
fx(
|
||||
() -> {
|
||||
ImageIO.write(
|
||||
SwingFXUtils.fromFXImage(pane.snapshot(null, null), null),
|
||||
"png",
|
||||
output.resolve("intellij.png").toFile());
|
||||
return null;
|
||||
});
|
||||
}
|
||||
build(data);
|
||||
interactive(data, data + "-edited");
|
||||
}
|
||||
|
||||
private void attribute(String name, String value) throws Exception {
|
||||
fx(
|
||||
() -> {
|
||||
var kit = pane.kit().editor();
|
||||
kit.getSelection().select(new FXOMFxIdIndex(kit.getFxomDocument()).lookup("previous"));
|
||||
return null;
|
||||
});
|
||||
await(() -> fx(() -> pane.lookup("#component-property-" + name) != null));
|
||||
fx(
|
||||
() -> {
|
||||
var field = (TextField) pane.lookup("#component-property-" + name);
|
||||
field.setText(value);
|
||||
field.fireEvent(new ActionEvent());
|
||||
return null;
|
||||
});
|
||||
await(() -> source().contains(name + "=\"" + value + "\""));
|
||||
}
|
||||
}
|
||||
@@ -26,12 +26,13 @@ p.add_argument("--archiver", type=Path, help="Qualify ArchiveWindow.fxml in a di
|
||||
forms = p.add_mutually_exclusive_group()
|
||||
forms.add_argument("--connection-form", action="store_true", help="Qualify the Archiver connection form")
|
||||
forms.add_argument("--grid-docking", type=Path, metavar="REFERENCE_FXML", help="Qualify the Archiver grid, dock layout and the supplied reference workspace")
|
||||
forms.add_argument("--management-readers", action="store_true", help="Verify account and trash commands and the five reader toolbars")
|
||||
forms.add_argument("--folder-actions", action="store_true", help="Check visual event references, folder search, selection and display profiles")
|
||||
forms.add_argument("--import-form", action="store_true", help="Check generic binding types and the Archiver import collision")
|
||||
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")
|
||||
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) 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.management_readers) and not args.archiver:
|
||||
p.error("Selecting an Archiver view requires --archiver")
|
||||
if args.repeat < 1:
|
||||
p.error("--repeat must be positive")
|
||||
@@ -43,7 +44,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):
|
||||
crashes = NativeCrashGuard(ROOT)
|
||||
launch = subprocess.run([sys.executable, ROOT / "scripts/run-fixture-host.py", "intellij",
|
||||
"--check", *(["--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", *(["--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],
|
||||
cwd=ROOT, text=True, capture_output=True, timeout=60)
|
||||
if launch.returncode:
|
||||
@@ -87,7 +88,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"))
|
||||
(evidence / "proof.json").write_text(json.dumps(proof, indent=2) + "\n")
|
||||
finally:
|
||||
for name in ("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 ("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():
|
||||
shutil.copyfile(base / name, evidence / name)
|
||||
workers = descendant_workers(pid)
|
||||
|
||||
@@ -22,12 +22,13 @@ p.add_argument("--archiver", type=Path, help="Use a disposable copy of the Archi
|
||||
forms = p.add_mutually_exclusive_group()
|
||||
forms.add_argument("--connection-form", action="store_true", help="Open and qualify the Archiver connection form")
|
||||
forms.add_argument("--grid-docking", type=Path, metavar="REFERENCE_FXML", help="Qualify the Archiver grid, dock layout and the supplied reference workspace")
|
||||
forms.add_argument("--management-readers", action="store_true", help="Verify account and trash commands and the five reader toolbars")
|
||||
forms.add_argument("--folder-actions", action="store_true", help="Check visual event references, folder search, selection and display profiles")
|
||||
forms.add_argument("--import-form", action="store_true", help="Check generic binding types and the Archiver import collision")
|
||||
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")
|
||||
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) 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.management_readers) and not args.archiver:
|
||||
p.error("Selecting an Archiver view requires --archiver")
|
||||
base = Path(tempfile.mkdtemp(prefix="neitzel-designer-host-")).resolve()
|
||||
project = base / "project"
|
||||
@@ -38,6 +39,8 @@ if args.archiver:
|
||||
subprocess.run([sys.executable, ROOT / "scripts/configure-library-example.py", "--project", project,
|
||||
"--target-java-home", args.target_java_home], check=True)
|
||||
view = "ConnectionForm" if args.connection_form else "ArchiveWindow"
|
||||
if args.management_readers:
|
||||
view = "MailControls"
|
||||
if args.folder_actions:
|
||||
view = "DocumentDetails" if args.check else "FolderTab"
|
||||
if args.document_tabs and args.check:
|
||||
@@ -103,6 +106,8 @@ else:
|
||||
suite = "Connection"
|
||||
elif args.grid_docking:
|
||||
suite = "GridDock"
|
||||
elif args.management_readers:
|
||||
suite = "ManagementReaders"
|
||||
elif args.folder_actions:
|
||||
suite = "FolderActions"
|
||||
elif args.import_form:
|
||||
@@ -113,7 +118,7 @@ else:
|
||||
suite = "SavedDocument"
|
||||
probe = f"{suite}WorkflowProbe" if args.archiver else "WorkflowProbe"
|
||||
files = [sources / "WorkflowProbe.java"]
|
||||
if args.connection_form or args.saved_document or args.document_tabs or args.import_form or args.folder_actions:
|
||||
if args.connection_form or args.saved_document or args.document_tabs or args.import_form or args.folder_actions or args.management_readers:
|
||||
files.append(sources / "FormWorkflowProbe.java")
|
||||
if args.archiver:
|
||||
files.append(sources / f"{probe}.java")
|
||||
|
||||
Reference in New Issue
Block a user