Make configuration and compatibility contracts executable

This commit is contained in:
2026-11-12 08:27:53 +01:00
parent 306266ae40
commit 85a75383a0
28 changed files with 2284 additions and 8 deletions
@@ -0,0 +1,26 @@
package de.neitzel.fxdesigner.intellij;
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
import com.intellij.testFramework.fixtures.BasePlatformTestCase;
import de.neitzel.fxdesigner.config.*;
import de.neitzel.fxdesigner.host.*;
import java.nio.file.*;
import java.util.*;
public final class ConfigurationIntegrationTest extends BasePlatformTestCase {
public void testConfigurationFailureKeepsRealIdeDocumentEditable() throws Exception {
Path root = Files.createTempDirectory("designer-config-").toRealPath();
VfsRootAccess.allowRootAccess(getTestRootDisposable(), root.toString());
var catalog = ConfigurationHostContract.fixture(root);
var diagnostics = new ArrayList<HostServices.Diagnostic>();
try (var host =
new IntellijHost(getProject(), new ConfiguredRuntimes(Map.of()), diagnostics::add)) {
ConfigurationHostContract.exercise(host.services(), catalog);
assertFalse(diagnostics.isEmpty());
} finally {
try (var files = Files.walk(root)) {
for (Path p : files.sorted(Comparator.reverseOrder()).toList()) Files.delete(p);
}
}
}
}