Fix EventBus test
This commit is contained in:
parent
d8d6f7e0a9
commit
91026b373d
3 changed files with 25 additions and 3 deletions
23
.runConfigurations/Test.run.xml
Normal file
23
.runConfigurations/Test.run.xml
Normal file
|
@ -0,0 +1,23 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Test" type="GradleRunConfiguration" factoryName="Gradle">
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="test" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" value="" />
|
||||
</ExternalSystemSettings>
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
|
@ -4,4 +4,4 @@ import space.uranos.server.Server
|
|||
|
||||
private lateinit var serverInstance: Server
|
||||
|
||||
object Uranos : Server by serverInstance
|
||||
val Uranos get() = serverInstance
|
||||
|
|
|
@ -29,7 +29,6 @@ class EventBusTest {
|
|||
|
||||
@BeforeEach
|
||||
fun initServer() {
|
||||
// Does not work because Uranos will not be reinitialized. When we use DI, we do no longer need this.
|
||||
UranosServer.setServerInstance(UranosServer())
|
||||
}
|
||||
|
||||
|
@ -87,8 +86,8 @@ class EventBusTest {
|
|||
val order = listOf(
|
||||
EventHandlerPosition.FIRST,
|
||||
Position1,
|
||||
EventHandlerPosition.NORMAL,
|
||||
Position2,
|
||||
EventHandlerPosition.NORMAL,
|
||||
Position3,
|
||||
EventHandlerPosition.LAST
|
||||
)
|
Reference in a new issue