Terasology / ModuleTestingEnvironment

3 stars 15 forks source link

refactor: split public MainLoop methods from Engine-management code #73

Closed keturn closed 2 years ago

keturn commented 2 years ago

With the last usage of the deprecated ModuleTestingEnvironment superclass removed from Omega, we're free to remove some of the junit-specific things from ModuleTestingHelper's implementation and look at how to split those dozens of methods up into a few classes with separate responsibilities.

This PR puts createHost and related methods in a new class named Engines. It's mostly used for the work that MTEExtension does behind the scenes, but those tests that use createClient to start additional engines may use it directly.

runWhile and related methods are in the class MainLoop. These are the methods that test authors will be interested in. The makeRelevant methods are currently here as well.

ModuleTestingHelper still exists for backwards compatibility, but I'd like to push tests to use the smaller MainLoop interface as much as possible.

Notes for Reviewers

There are a lot of lines, but I think it's okay to assume that all the methods in Engines and MainLoop were moved out of ModuleTestingEnvironment as-is.

MTEExtension does have some changes to allow the extension to provide the new classes to tests.

This should be reviewable/runnable per-commit.

To Do

keturn commented 2 years ago

Updated a bunch of javadoc. See https://jenkins.terasology.io/teraorg/job/Terasology/job/Modules/job/M/job/ModuleTestingEnvironment/view/change-requests/job/PR-73/javadoc

keturn commented 2 years ago

MTE MainLoop interface