Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate RegionEntitiesTest in IsolatedMTEExtension #92

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/test/java/regions/RegionEntitiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,39 @@

package regions;

import com.google.common.collect.Sets;
import org.joml.RoundingMode;
import org.joml.Vector2i;
import org.joml.Vector3f;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.terasology.dynamicCities.region.RegionEntityManager;
import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.logic.location.LocationComponent;
import org.terasology.moduletestingenvironment.ModuleTestingEnvironment;
import org.terasology.moduletestingenvironment.IsolatedMTEExtension;
import org.terasology.moduletestingenvironment.extension.Dependencies;
import org.terasology.registry.In;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class RegionEntitiesTest extends ModuleTestingEnvironment {
private RegionEntityManager regionEntityManager;

@ExtendWith(IsolatedMTEExtension.class)
@Dependencies({"engine", "ModuleTestingEnvironment", "DynamicCities"})
public class RegionEntitiesTest {
@In
protected RegionEntityManager regionEntityManager;

private EntityRef[] test;
private Vector3f[] pos = new Vector3f[10];

@Override
public Set<String> getDependencies() {
return Sets.newHashSet("engine", "DynamicCities", "ModuleTestingEnvironment");
}

@BeforeEach
public void setupEntityRefs() {
pos[0] = new Vector3f(16, 0, 16);
Expand All @@ -62,8 +62,6 @@ public void setupEntityRefs() {
pos[8] = new Vector3f(-32, 0, -32);
pos[9] = new Vector3f(97, 0, -97);

regionEntityManager = getHostContext().get(RegionEntityManager.class);

test = new EntityRef[10];
LocationComponent[] loc = new LocationComponent[test.length];
for (int i = 0; i < test.length; i++) {
Expand Down