feat(fls): export the editor model's programs
exportProject.ts, step X4a: each installed program of a PC or notebook as the FILIUS application of its class, keyed by that class name as Java keys them, with its settings: servers switched on as the model has them, a web server's port and virtual hosts, the DNS server's recursion on port 53, the echo server's port, the generic client's target (none as null, as its constructor leaves it), the peer count, the personal firewall. E-mail contents are the next step. The model lost a web server's virtual hosts switch (useVHost, on for 3 web servers in the corpus); Swift sets it off on import. The core now has WebServerConfiguration.virtualHosts (Swift's name), the import carries Java's value, and the Swift comparison names Swift's error. Checked by Java: every corpus file, imported, exported and written, loads with the programs of the original, with no new departure. In the synthetic model the PC has every program with settings away from the defaults, the notebook programs without settings (Java's defaults, 3 peers), where Java makes /peer2peer itself. 12 mutation probes, each loaded by Java, were all caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -140,7 +140,7 @@ function systemOf(project: ImportedProject, nodeId: Id) {
|
||||
const web = project.webServerConfigurations.get(nodeId);
|
||||
if (web !== undefined) {
|
||||
// Swift serves the same files from /www after moving them there.
|
||||
result.webServer = { port: web.port, documentRoot: web.documentRoot === '/webserver' ? '/www' : web.documentRoot, virtualHosts: false };
|
||||
result.webServer = { port: web.port, documentRoot: web.documentRoot === '/webserver' ? '/www' : web.documentRoot, virtualHosts: web.virtualHosts };
|
||||
}
|
||||
const gnutella = project.gnutellaConfigurations.get(nodeId);
|
||||
if (gnutella !== undefined) result.gnutella = gnutella;
|
||||
@@ -330,7 +330,15 @@ const unnumberedMailbox = (numbered: string[]) => (node: SwiftNode) => {
|
||||
},
|
||||
};
|
||||
};
|
||||
/** Swift reads a web server's useVHost as off. */
|
||||
const servesVirtualHosts = (node: SwiftNode) => ({
|
||||
...node,
|
||||
system: { ...node.system, webServer: { ...(node.system.webServer as object), virtualHosts: true } },
|
||||
});
|
||||
const SWIFT_ERRORS: Record<string, Record<number, (node: SwiftNode) => SwiftNode>> = {
|
||||
'ipad-fixtures/Public_and_Private_Networks_2_EN.fls': { 2: servesVirtualHosts },
|
||||
'java-examples/Public_and_Private_Networks_2_EN.fls': { 2: servesVirtualHosts },
|
||||
'java-examples/private_und_public_networks_mit_provider_DE.fls': { 6: servesVirtualHosts },
|
||||
'java-examples/man-in-the-middle.fls': { 5: unnumberedMailbox(['1', '2']) },
|
||||
'java-examples/multicast_server.fls': {
|
||||
// useIPAsName is `<object idref="Boolean0"/>`, the shared result of a
|
||||
@@ -894,7 +902,7 @@ describe('importProject rules', () => {
|
||||
|
||||
expect([...project.installedPrograms.get(notebook!)!].sort()).toEqual(['commandPrompt', 'echoServer', 'firewall', 'simpleClient', 'webServer']);
|
||||
expect([...project.activePrograms.get(notebook!)!]).toEqual(['webServer']);
|
||||
expect(project.webServerConfigurations.get(notebook!)).toEqual({ port: 8080, documentRoot: '/webserver' });
|
||||
expect(project.webServerConfigurations.get(notebook!)).toEqual({ port: 8080, documentRoot: '/webserver', virtualHosts: false });
|
||||
expect(project.echoServerConfigurations.get(notebook!)).toEqual({ port: 7 });
|
||||
expect(project.simpleClientConfigurations.get(notebook!)).toEqual({ targetAddress: '10.0.0.9', targetPort: 7 });
|
||||
expect(project.firewallConfigurationsByNodeId.get(notebook!)).toMatchObject({ isActive: true, defaultPolicy: 'accept' });
|
||||
|
||||
Reference in New Issue
Block a user