Terasology / DynamicCities

Cities that get fancy!
18 stars 14 forks source link

Update ParcelList and RegionEntities Tests #40

Closed mayant15 closed 5 years ago

mayant15 commented 5 years ago

To test: Run the test suite. All tests should pass.

Cervator commented 5 years ago

Tried to test this out (after the minor conflict in module.txt, reasy) - but even after dealing with https://github.com/Terasology/ModuleTestingEnvironment/issues/9 so I could run RegionEntitiesTest I am bizarrely getting sandboxed away from BlockType - which is in Cities, a module, not the engine?!?

I'm not sure if I'm doing something wrong (rather sleepy) can anybody else confirm if that test still runs OK? It has got to be something weird in my workspace ...

Cervator commented 5 years ago

Tried again, seemingly with a more solid workspace state. Am still getting the same error - @mayant15 could you check on it sometime?

Even tried adding Cities to the dependency set in the MTE test but no change. There are two BlockType classes (one in Cities, one in StaticCities), not sure if that relates.

09:50:56.008 [main] WARN  org.reflections.Reflections - given scan urls are empty. set urls in the configuration
09:50:56.171 [main] ERROR o.t.module.sandbox.ModuleClassLoader - Denied access to class (not allowed with this module's permissions): org.terasology.cities.BlockType

java.lang.NoClassDefFoundError: org/terasology/cities/BlockType

    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
    at java.lang.Class.getConstructor0(Class.java:3075)
    at java.lang.Class.getConstructor(Class.java:1825)
    at org.terasology.world.generator.internal.WorldGeneratorManager.isValidWorldGenerator(WorldGeneratorManager.java:160)
    at org.terasology.world.generator.internal.WorldGeneratorManager.refresh(WorldGeneratorManager.java:66)
    at org.terasology.world.generator.internal.WorldGeneratorManager.<init>(WorldGeneratorManager.java:50)
    at org.terasology.engine.subsystem.common.WorldGenerationSubsystem.initialise(WorldGenerationSubsystem.java:34)
    at org.terasology.engine.TerasologyEngine.initSubsystems(TerasologyEngine.java:282)
    at org.terasology.engine.TerasologyEngine.initialize(TerasologyEngine.java:214)
    at org.terasology.moduletestingenvironment.ModuleTestingEnvironment.createEngine(ModuleTestingEnvironment.java:245)
    at org.terasology.moduletestingenvironment.ModuleTestingEnvironment.createHeadlessEngine(ModuleTestingEnvironment.java:217)
    at org.terasology.moduletestingenvironment.ModuleTestingEnvironment.createHost(ModuleTestingEnvironment.java:252)
    at org.terasology.moduletestingenvironment.ModuleTestingEnvironment.setup(ModuleTestingEnvironment.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

09:50:57.601 [main] WARN  org.reflections.Reflections - given scan urls are empty. set urls in the configuration
eviltak commented 5 years ago

@Cervator I ran RegionEntitiesTest.testSimpleGet, the test passes just fine for me without such an error. Might be a workspace issue 😄

Cervator commented 5 years ago

Tried this out some more - resulted in a huge engine PR write-up with less than a dozen lines changed ;-)

See https://github.com/MovingBlocks/Terasology/pull/3734 for details - I merged this as I can confirm the tests work on Windows but only with a specific workspace setup. Add too many modules and it still breaks, fresh & clean or not :-)

Threw everybody from here in as reviewers although I'm unsure how much Windows factors in and as a result who might be able to tinker with it further.