implements PLN-0053
This commit is contained in:
+23
@@ -512,6 +512,29 @@ final class FileSystemPackerWorkspaceServiceTest {
|
||||
assertTrue(events.stream().anyMatch(event -> event.kind() == PackerEventKind.ACTION_APPLIED));
|
||||
}
|
||||
|
||||
@Test
|
||||
void createsSceneBankAssetAndWritesStudioSupportFile() throws Exception {
|
||||
final Path projectRoot = tempDir.resolve("created-scene-bank");
|
||||
final FileSystemPackerWorkspaceService service = service();
|
||||
|
||||
final var result = service.createAsset(new CreateAssetRequest(
|
||||
project(projectRoot),
|
||||
"scenes/overworld",
|
||||
"overworld",
|
||||
AssetFamilyCatalog.SCENE_BANK,
|
||||
OutputFormatCatalog.SCENE_TILED_V1,
|
||||
OutputCodecCatalog.NONE,
|
||||
false));
|
||||
|
||||
assertEquals(PackerOperationStatus.SUCCESS, result.status());
|
||||
final Path assetRoot = projectRoot.resolve("assets/scenes/overworld");
|
||||
assertTrue(Files.isRegularFile(assetRoot.resolve("asset.json")));
|
||||
assertTrue(Files.isRegularFile(assetRoot.resolve("scene-bank.studio.json")));
|
||||
final var supportFile = MAPPER.readTree(assetRoot.resolve("scene-bank.studio.json").toFile());
|
||||
assertEquals(1, supportFile.path("layer_count").asInt());
|
||||
assertEquals("layer-1.tmx", supportFile.path("layers").get(0).path("tilemap").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
void returnsCreatedAssetThroughRuntimeBackedDetailsWithoutRescanMismatch() throws Exception {
|
||||
final Path projectRoot = tempDir.resolve("created-details");
|
||||
|
||||
+25
@@ -67,6 +67,31 @@ final class PackerAssetDeclarationParserTest {
|
||||
assertEquals(128, result.declaration().outputPipelineMetadata().get("samples").path("1").path("length").asInt());
|
||||
}
|
||||
|
||||
@Test
|
||||
void parsesSceneBankDeclaration() throws Exception {
|
||||
final Path manifest = tempDir.resolve("scene-asset.json");
|
||||
Files.writeString(manifest, """
|
||||
{
|
||||
"schema_version": 1,
|
||||
"asset_uuid": "uuid-scene",
|
||||
"name": "overworld_scene",
|
||||
"type": "scene_bank",
|
||||
"output": {
|
||||
"format": "SCENE/tiled_v1",
|
||||
"codec": "NONE"
|
||||
},
|
||||
"preload": { "enabled": false }
|
||||
}
|
||||
""");
|
||||
|
||||
final var result = parser.parse(manifest);
|
||||
|
||||
assertTrue(result.valid());
|
||||
assertEquals(AssetFamilyCatalog.SCENE_BANK, result.declaration().assetFamily());
|
||||
assertEquals("SCENE/tiled_v1", result.declaration().outputFormat().displayName());
|
||||
assertEquals(OutputCodecCatalog.NONE, result.declaration().outputCodec());
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsNonObjectPipelineMetadata() throws Exception {
|
||||
final Path manifest = tempDir.resolve("asset.json");
|
||||
|
||||
Reference in New Issue
Block a user