Launch the JavaFX 2 project shell on Java 25 with an interactive viewport, managed Play lifecycle and project mutation guards. Preserve headless/MCP and save compatibility, and qualify exact runtime executable bundles. Separate unit JaCoCo gates from opt-in integration suites and use the internal Pong fixture for the headless visual pilot. Move maintenance and native conformance tools into tooling; retain the VS Code extension and update current navigation links. Validation: tooling make verify passed, including 1064 Studio unit tests, JaCoCo thresholds and 22 headless integration tests.
54 lines
4.7 KiB
Java
54 lines
4.7 KiB
Java
package p.studio.app.runtime;
|
|
|
|
import org.junit.jupiter.api.*;
|
|
import org.junit.jupiter.api.io.TempDir;
|
|
import p.studio.api.automation.*;
|
|
import p.studio.app.assets.SmallAssetProject;
|
|
import java.nio.file.*;
|
|
import java.util.*;
|
|
import java.util.concurrent.TimeUnit;
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
/** Provider qualification precedes publication of a consumer capacity profile. No managed-guard bypass in production. */
|
|
@org.junit.jupiter.api.Tag("integration")
|
|
class AssetCapacityInstalledRuntimeTest {
|
|
@TempDir Path root;
|
|
@Test void actualInstalledPoolsAcceptSixteenAndRejectSeventeenGlyphAndScenePreloads()throws Exception {
|
|
Path installation=Path.of(System.getProperty("studio.test.runtimeInstall","")).toRealPath();
|
|
assertTrue(Files.isExecutable(installation.resolve("prometeu-headless")));
|
|
var json=new com.fasterxml.jackson.databind.ObjectMapper();var observations=new ArrayList<Map<String,Object>>();
|
|
for(String type:List.of("glyph","scene"))for(int count:List.of(16,17)) {
|
|
try(var fixture=new SmallAssetProject(root.resolve(type+count))) {
|
|
var source=type.equals("scene")?fixture.glyph("source",false):null;
|
|
for(int i=0;i<count;i++)if(type.equals("glyph"))fixture.glyph("bank"+i,true);else fixture.scene("bank"+i,source,true);
|
|
var build=fixture.build();assertTrue(build.success(),build.diagnostics().toString());
|
|
var plan=fixture.packer.workspaceService().planPackWorkspace(new p.packer.messages.PackerProjectContext(fixture.project.name(),fixture.root));
|
|
assertEquals(count,plan.preload().stream().filter(p->p.bankType().equals(type.toUpperCase(Locale.ROOT))).count());
|
|
var process=new ProcessBuilder(installation.resolve("prometeu").toString(),"headless","--stdio").directory(fixture.root.toFile()).start();
|
|
var session=new HeadlessProcessSession(process,json,HeadlessLimits.defaults(),"qualify-"+type+count);
|
|
var record=new LinkedHashMap<String,Object>();record.put("bankType",type);record.put("preloads",count);record.put("plan",plan);
|
|
try {
|
|
session.initializeAndBoot(build.manifestPath().getParent(),fixture.root,false,Map.of());
|
|
var result=session.advance(1,progress->{});record.put("observation",result.observation());record.put("outcome",result.kind().name());
|
|
if(count==16){assertEquals(AutomationOutcome.Kind.SUCCEEDED,result.kind(),result.toString());assertEquals(1,result.completedFrames());}
|
|
else assertNotEquals(AutomationOutcome.Kind.SUCCEEDED,result.kind(),"Seventeenth preload must be rejected by the native pool");
|
|
}catch(AutomationException failure) {
|
|
record.put("failure",failure.failure());assertEquals(17,count,"Sixteen native preloads must boot and execute");
|
|
var nativeFacts=json.valueToTree(failure.failure().runtimeError());
|
|
assertEquals("boot_failed",nativeFacts.path("code").asText(),nativeFacts.toString());
|
|
assertEquals("vm_panic",nativeFacts.path("details").path("fault").path("kind").asText(),nativeFacts.toString());
|
|
assertEquals("Cartridge preload failed: BackendError",nativeFacts.path("details").path("fault").path("message").asText(),nativeFacts.toString());
|
|
}finally {
|
|
record.put("nativeObservation",session.observation());
|
|
try{session.shutdown().toCompletableFuture().get(7,TimeUnit.SECONDS);}finally{if(session.alive())session.abort("Capacity qualification cleanup");}
|
|
}
|
|
record.put("expected",count==16?"accepted":"rejected");observations.add(record);
|
|
}
|
|
}
|
|
Path output=Path.of("build/asset-authoring-qualification");Files.createDirectories(output);
|
|
var executables=new TreeMap<String,String>();for(String file:List.of("prometeu","prometeu-headless","prometeu-runtime"))executables.put(file,HexFormat.of().formatHex(java.security.MessageDigest.getInstance("SHA-256").digest(Files.readAllBytes(installation.resolve(file)))));
|
|
var nativeObservation=(RuntimeObservation)observations.getFirst().get("nativeObservation");
|
|
json.writerWithDefaultPrettyPrinter().writeValue(output.resolve("native-capacity-boundaries.json").toFile(),Map.of("installation",installation.toString(),"runtimeVersion",nativeObservation.nativeDetails().get("runtimeVersion"),"executables",executables,"observations",observations,"scope","Actual packaged native 16/17 qualification, glyph/scene only; no runtime writes/builds or larger guest budgets. Native rejection reports the existing aggregate preload BackendError, not a fabricated slot detail."));
|
|
}
|
|
}
|