more robust tests of equip state on server
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-08-22 19:15:45 -04:00
parent ea0902d22f
commit 4aed133a97
2 changed files with 21 additions and 0 deletions

View File

@ -620,6 +620,10 @@ Update image assert method
Jenkins save and display captured images when failing a rendering test Jenkins save and display captured images when failing a rendering test
Setup MantisBT Setup MantisBT
(08/22/2024)
Fix rendering testing on jenkins
Fix entity scene test spinup by preventing networking sockets from closing
# TODO # TODO

View File

@ -1,6 +1,10 @@
package electrosphere.entity.state.equip; package electrosphere.entity.state.equip;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.List;
import org.joml.Vector3d; import org.joml.Vector3d;
@ -8,6 +12,7 @@ import annotations.IntegrationTest;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.state.inventory.InventoryUtils; import electrosphere.entity.state.inventory.InventoryUtils;
import electrosphere.entity.types.attach.AttachUtils;
import electrosphere.entity.types.creature.CreatureTemplate; import electrosphere.entity.types.creature.CreatureTemplate;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.entity.types.item.ItemUtils; import electrosphere.entity.types.item.ItemUtils;
@ -31,9 +36,21 @@ public class ServerEquipStateTests extends EntityTestTemplate {
Entity inInventoryItem = InventoryUtils.serverAttemptStoreItem(creature, katana); Entity inInventoryItem = InventoryUtils.serverAttemptStoreItem(creature, katana);
ServerEquipState serverEquipState = ServerEquipState.getServerEquipState(creature); ServerEquipState serverEquipState = ServerEquipState.getServerEquipState(creature);
serverEquipState.commandAttemptEquip(inInventoryItem, serverEquipState.getEquipPoint("handsCombined")); serverEquipState.commandAttemptEquip(inInventoryItem, serverEquipState.getEquipPoint("handsCombined"));
//propagate to client
TestEngineUtils.simulateFrames(2);
//
//verify was equipped //verify was equipped
assertNotNull(serverEquipState.getEquippedItemAtPoint("handsCombined")); assertNotNull(serverEquipState.getEquippedItemAtPoint("handsCombined"));
List<Entity> children = AttachUtils.getChildrenList(creature);
assertNotNull(children);
assertEquals(1, children.size());
Entity child = children.get(0);
assertTrue(ItemUtils.isItem(child));
assertTrue(ItemUtils.isWeapon(child));
assertNotNull(AttachUtils.getParent(child));
assertEquals(AttachUtils.getParent(child), creature);
} }
} }