feat(fls): keep a .fls's own applications through the editor model
The archive's entries besides the configuration — the project's own Java applications under projekt/anwendungen (.java, .class, EigeneAnwendungen.txt) — now go through the editor model: openProjectArchive reads a whole .fls into the model and keeps them in its archiveEntries, saveProjectArchive writes a whole .fls from the model with them unchanged. They cannot run here, but must not be lost. Checked on every corpus file: each entry comes back byte for byte (7 files carry applications of their own); a probe that drops them is caught. Installing such applications on a host is the next step; Java loads those only through its full loading path, which the oracle is to use first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,9 @@ import {
|
||||
exportProject,
|
||||
importProject,
|
||||
javaBase64,
|
||||
openProjectArchive,
|
||||
readFlsArchive,
|
||||
saveProjectArchive,
|
||||
readTopology,
|
||||
writeFlsArchive,
|
||||
type FlsFileTree,
|
||||
@@ -324,10 +326,13 @@ describe('the editor model exported, as Java loads it', () => {
|
||||
for (const file of flsFiles(corpusRoot)) {
|
||||
const name = relative(corpusRoot, file);
|
||||
it(name, () => {
|
||||
const topology = readTopology(decodeJavaBeans(readFlsArchive(new Uint8Array(readFileSync(file))).configurationXml));
|
||||
const project = importProject(topology, counter());
|
||||
const bytes = new Uint8Array(readFileSync(file));
|
||||
const topology = readTopology(decodeJavaBeans(readFlsArchive(bytes).configurationXml));
|
||||
const project = openProjectArchive(bytes, counter());
|
||||
const { topology: toWrite } = exportProject(project);
|
||||
const archive = writeFlsArchive(new TextEncoder().encode(writeTopologyXml(toWrite)));
|
||||
const { archive } = saveProjectArchive(project);
|
||||
// The project's own applications, and every other entry, byte for byte.
|
||||
expect(readFlsArchive(archive).supplementalEntries).toEqual(readFlsArchive(bytes).supplementalEntries);
|
||||
if (process.env.UPDATE_EXPORTED === '1') {
|
||||
mkdirSync(dirname(join(exportedRoot, name)), { recursive: true });
|
||||
writeFileSync(join(exportedRoot, name), archive);
|
||||
|
||||
@@ -8230,7 +8230,7 @@
|
||||
}
|
||||
],
|
||||
"documentation": [],
|
||||
"sha256": "e0f906a2f02c2fdb9b309a6fc0c5625113270ffa95a7a1ce8be11f93e146bd2c"
|
||||
"sha256": "955edc9322d1de6bae59ce05221b94ab18983c46193db034cf37fd18f0146a48"
|
||||
},
|
||||
"java-examples/dhcp_test_scenario.fls": {
|
||||
"success": true,
|
||||
@@ -8650,7 +8650,7 @@
|
||||
}
|
||||
],
|
||||
"documentation": [],
|
||||
"sha256": "76d8317e6d352e8686663957f0bbc74f1945b0c419a80ac94992e40590e75e8c"
|
||||
"sha256": "24841ef8e02136eef19247c1a53850c4644232d97a016815bd2338e8190bd357"
|
||||
},
|
||||
"java-examples/dns_server.fls": {
|
||||
"success": true,
|
||||
@@ -10024,7 +10024,7 @@
|
||||
}
|
||||
],
|
||||
"documentation": [],
|
||||
"sha256": "ebd1aad2945a178470cc22ce327460d09c456814dbcd155eacced456f242661b"
|
||||
"sha256": "bc7b13a0ada9522a211583371d9b838c4731642032efa1d49d8c217903e4b989"
|
||||
},
|
||||
"java-examples/email_komplett.fls": {
|
||||
"success": true,
|
||||
@@ -13451,7 +13451,7 @@
|
||||
}
|
||||
],
|
||||
"documentation": [],
|
||||
"sha256": "35e84042bc6b04062cb943127a85900ebbc947d5148e9fbf4978bb128a013ff3"
|
||||
"sha256": "b860d1bdf773a92b90f63ff6c7c76e9d0ee2c9b342e6042c3e39f61acf6697e3"
|
||||
},
|
||||
"java-examples/nat.fls": {
|
||||
"success": true,
|
||||
@@ -17079,7 +17079,7 @@
|
||||
}
|
||||
],
|
||||
"documentation": [],
|
||||
"sha256": "f9f829093450eda122c1a5c01d66b1492fd426769652d1f138791a56641d1fea"
|
||||
"sha256": "ff743751be0d5ecdd84d1db935a332c248e39d1f6f7d3882efdb108c419a0a38"
|
||||
},
|
||||
"java-examples/zwei_rechnernetze_komplett.fls": {
|
||||
"success": true,
|
||||
@@ -18359,14 +18359,14 @@
|
||||
}
|
||||
],
|
||||
"documentation": [],
|
||||
"sha256": "ebd1aad2945a178470cc22ce327460d09c456814dbcd155eacced456f242661b"
|
||||
"sha256": "bc7b13a0ada9522a211583371d9b838c4731642032efa1d49d8c217903e4b989"
|
||||
},
|
||||
"java-tests/empty.fls": {
|
||||
"success": true,
|
||||
"nodes": [],
|
||||
"cables": [],
|
||||
"documentation": [],
|
||||
"sha256": "49855a61d8576af64e50c211807e658d69daa924a411ced654a3452070b1722c"
|
||||
"sha256": "aec202d78dc3a05cd83471744050a102cb2cf448b273b053df6b4c640f1ac6e9"
|
||||
},
|
||||
"synthetic/model.fls": {
|
||||
"success": true,
|
||||
|
||||
Reference in New Issue
Block a user