more robust tests of equip state on server
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
ea0902d22f
commit
4aed133a97
@ -620,6 +620,10 @@ Update image assert method
|
||||
Jenkins save and display captured images when failing a rendering test
|
||||
Setup MantisBT
|
||||
|
||||
(08/22/2024)
|
||||
Fix rendering testing on jenkins
|
||||
Fix entity scene test spinup by preventing networking sockets from closing
|
||||
|
||||
|
||||
# TODO
|
||||
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
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.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.joml.Vector3d;
|
||||
|
||||
@ -8,6 +12,7 @@ import annotations.IntegrationTest;
|
||||
import electrosphere.engine.Globals;
|
||||
import electrosphere.entity.Entity;
|
||||
import electrosphere.entity.state.inventory.InventoryUtils;
|
||||
import electrosphere.entity.types.attach.AttachUtils;
|
||||
import electrosphere.entity.types.creature.CreatureTemplate;
|
||||
import electrosphere.entity.types.creature.CreatureUtils;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
@ -32,8 +37,20 @@ public class ServerEquipStateTests extends EntityTestTemplate {
|
||||
ServerEquipState serverEquipState = ServerEquipState.getServerEquipState(creature);
|
||||
serverEquipState.commandAttemptEquip(inInventoryItem, serverEquipState.getEquipPoint("handsCombined"));
|
||||
|
||||
//propagate to client
|
||||
TestEngineUtils.simulateFrames(2);
|
||||
|
||||
//
|
||||
//verify was equipped
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user