-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into crouchingMode
- Loading branch information
Showing
378 changed files
with
13,759 additions
and
4,442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"id" : "unittest", | ||
"version" : "1.4.1-SNAPSHOT", | ||
"version" : "1.5.1-SNAPSHOT", | ||
"displayName" : "Terasology Engine Test", | ||
"description" : "Engine unit test content" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
engine-tests/src/test/java/org/terasology/engine/ComponentSystemManagerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
|
||
package org.terasology.engine; | ||
|
||
import com.google.common.collect.Iterables; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.terasology.context.Context; | ||
import org.terasology.entitySystem.entity.EntityManager; | ||
import org.terasology.entitySystem.event.internal.EventSystem; | ||
import org.terasology.entitySystem.systems.RenderSystem; | ||
import org.terasology.entitySystem.systems.UpdateSubscriberSystem; | ||
|
||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.assertThat; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
public class ComponentSystemManagerTest { | ||
|
||
private ComponentSystemManager systemUnderTest; | ||
|
||
@Before | ||
public void setUp() { | ||
Context context = mock(Context.class); | ||
EntityManager entityManager = mock(EntityManager.class); | ||
when(entityManager.getEventSystem()).thenReturn(mock(EventSystem.class)); | ||
when(context.get(EntityManager.class)).thenReturn(entityManager); | ||
systemUnderTest = new ComponentSystemManager(context); | ||
} | ||
|
||
@Test | ||
public void testRegisterUpdateSubscriberAddsSubscriber() { | ||
UpdateSubscriberSystem system = mock(UpdateSubscriberSystem.class); | ||
|
||
systemUnderTest.register(system); | ||
|
||
assertThat(Iterables.size(systemUnderTest.iterateUpdateSubscribers()), is(1)); | ||
} | ||
|
||
@Test | ||
public void testShutdownRemovesUpdateSubscribers() { | ||
UpdateSubscriberSystem system = mock(UpdateSubscriberSystem.class); | ||
|
||
systemUnderTest.register(system); | ||
systemUnderTest.shutdown(); | ||
|
||
assertThat(Iterables.size(systemUnderTest.iterateUpdateSubscribers()), is(0)); | ||
} | ||
|
||
@Test | ||
public void testRegisterRenderSystemAddsRenderSubscriber() { | ||
RenderSystem system = mock(RenderSystem.class); | ||
|
||
systemUnderTest.register(system); | ||
|
||
assertThat(Iterables.size(systemUnderTest.iterateRenderSubscribers()), is(1)); | ||
} | ||
|
||
@Test | ||
public void testShutdownRemovesRenderSubscribers() { | ||
//see https://github.com/MovingBlocks/Terasology/issues/3087#issuecomment-326409756 | ||
RenderSystem system = mock(RenderSystem.class); | ||
|
||
systemUnderTest.register(system); | ||
systemUnderTest.shutdown(); | ||
|
||
assertThat(Iterables.size(systemUnderTest.iterateRenderSubscribers()), is(0)); | ||
} | ||
|
||
} |
Oops, something went wrong.