diff --git a/engine-tests/src/test/java/org/terasology/engine/integrationenvironment/ExampleTest.java b/engine-tests/src/test/java/org/terasology/engine/integrationenvironment/ExampleTest.java index a7a47840901..adfae966a71 100644 --- a/engine-tests/src/test/java/org/terasology/engine/integrationenvironment/ExampleTest.java +++ b/engine-tests/src/test/java/org/terasology/engine/integrationenvironment/ExampleTest.java @@ -6,22 +6,25 @@ import org.joml.Vector3i; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.terasology.engine.context.Context; import org.terasology.engine.core.Time; import org.terasology.engine.entitySystem.entity.EntityManager; import org.terasology.engine.integrationenvironment.jupiter.IntegrationEnvironment; import org.terasology.engine.logic.players.LocalPlayer; -import org.terasology.engine.logic.players.event.ResetCameraEvent; import org.terasology.engine.network.ClientComponent; import org.terasology.engine.network.NetworkMode; import org.terasology.engine.registry.In; import org.terasology.engine.world.WorldProvider; import org.terasology.engine.world.block.BlockManager; +import org.terasology.unittest.stubs.DummyEvent; import java.io.IOException; @IntegrationEnvironment(networkMode = NetworkMode.LISTEN_SERVER) public class ExampleTest { + private static final Logger logger = LoggerFactory.getLogger(ExampleTest.class); @In private WorldProvider worldProvider; @@ -34,6 +37,13 @@ public class ExampleTest { @In private ModuleTestingHelper helper; + @Test + public void testClientCreation() { + logger.info("Starting test 'testClientCreation'"); + Assertions.assertDoesNotThrow(helper::createClient); + logger.info("Done with test 'testClientCreation'"); + } + @Test public void testClientConnection() throws IOException { int currentClients = Lists.newArrayList(entityManager.getEntitiesWith(ClientComponent.class)).size(); @@ -65,7 +75,7 @@ public void testSendEvent() throws IOException { Context clientContext = helper.createClient(); // send an event to a client's local player just for fun - clientContext.get(LocalPlayer.class).getClientEntity().send(new ResetCameraEvent()); + clientContext.get(LocalPlayer.class).getClientEntity().send(new DummyEvent()); } @Test diff --git a/engine/src/main/java/org/terasology/engine/core/subsystem/common/MonitoringSubsystem.java b/engine/src/main/java/org/terasology/engine/core/subsystem/common/MonitoringSubsystem.java index 5b118a72f3d..c8be7ad5214 100644 --- a/engine/src/main/java/org/terasology/engine/core/subsystem/common/MonitoringSubsystem.java +++ b/engine/src/main/java/org/terasology/engine/core/subsystem/common/MonitoringSubsystem.java @@ -38,9 +38,8 @@ public void initialise(GameEngine engine, Context rootContext) { if (rootContext.get(SystemConfig.class).monitoringEnabled.get()) { advancedMonitor = new AdvancedMonitor(); advancedMonitor.setVisible(true); + initMicrometerMetrics(rootContext.get(Time.class)); } - - initMicrometerMetrics(rootContext.get(Time.class)); } /**