feat(fls): export the editor model's topology to Java's view
exportProject.ts is the counterpart of importProject.ts: from the editor model to the Java view topologyWriter.ts writes. Step X1, the topology: each node becomes the Java device of its kind with name, position and label flags; its ports become interfaces or ports; each link a cable drawn between its nodes; each documentation item a GUIDocuItem. A port's MAC is the one the simulation uses (the file's, or one derived from the port id); a router's gateway and DNS server go to every interface, as Java's own setters do (Java reads the first interface's only). A host with a wireless card joins a switch by a wireless cable, the only wireless connection Java makes. The import now enables a host's wireless by Java's card flag, also without an SSID, where Swift enables it for every SSID. Checked by Java: every corpus file, imported, exported and written, loads in Java FILIUS to the topology of the original up to named departures of the model (a derived MAC where Java rolls one at each load; documentation in render order, with the model's empty text, Dialog 12 and minimum size where Java has none or less). A synthetic model adds a label with IP and MAC, positions between pixels, a five-port switch, a wireless notebook, a three-interface router and a half-transparent bold text. 17 mutation probes, each loaded by Java, were all caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -89,12 +89,14 @@ rm -f "$beans/beans.java.json"
|
||||
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" BeansDump "$beans" "$beans/beans.java.json" 2>&1 | grep -v 'logback\|^$' || true
|
||||
test -s "$beans/beans.java.json"
|
||||
|
||||
# What Java loads from the files packages/fls writes (topologyWriter.test.ts
|
||||
# writes them with UPDATE_WRITTEN=1; the files are not checked in, their
|
||||
# SHA-256 is).
|
||||
written="$root/packages/fls/test/written"
|
||||
if [ -d "$written" ]; then
|
||||
rm -f "$written.java.json"
|
||||
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" FlsOracle "$written" "$written.java.json" --sha256 2>&1 | grep -v 'logback\|^$' || true
|
||||
test -s "$written.java.json"
|
||||
fi
|
||||
# What Java loads from the files packages/fls writes: Java's view written
|
||||
# again (topologyWriter.test.ts, UPDATE_WRITTEN=1) and the editor model
|
||||
# exported (exportProject.test.ts, UPDATE_EXPORTED=1). The files are not
|
||||
# checked in, their SHA-256 is.
|
||||
for written in "$root/packages/fls/test/written" "$root/packages/fls/test/exported"; do
|
||||
if [ -d "$written" ]; then
|
||||
rm -f "$written.java.json"
|
||||
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" FlsOracle "$written" "$written.java.json" --sha256 2>&1 | grep -v 'logback\|^$' || true
|
||||
test -s "$written.java.json"
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user