@@ -87,8 +87,8 @@ class RequestTest: RealServerTest() {
8787 fun prepareXmlTest () {
8888 val request = xStream.fromXML(" <?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n " +
8989 " <prepare gameType=\" swc_2018_hase_und_igel\" >\n " +
90- " <slot displayName=\" Häschenschule\" canTimeout=\" true\" shouldBePaused= \" true \" />\n " +
91- " <slot displayName=\" Testhase\" canTimeout=\" true\" shouldBePaused= \" true \" />\n " +
90+ " <slot displayName=\" Häschenschule\" canTimeout=\" true\" />\n " +
91+ " <slot displayName=\" Testhase\" canTimeout=\" true\" />\n " +
9292 " </prepare>" )
9393 assertEquals(PrepareGameRequest ::class .java, request.javaClass)
9494 assertEquals(" Häschenschule" , (request as PrepareGameRequest ).slotDescriptors[0 ].displayName)
@@ -163,31 +163,23 @@ class RequestTest: RealServerTest() {
163163 val sp1 = room.slots[0 ].role.player
164164 sp1.addPlayerListener(p1Listener)
165165 admin.send(PauseGameRequest (room.id, true ))
166- admin.observe(room.id)
166+ admin.observe(room.id, false )
167167
168168 // Wait for admin
169169 TestHelper .waitUntilTrue({ listener.observedReceived }, 2000 )
170170
171-
172171 player2.joinRoomRequest(TestPlugin .TEST_PLUGIN_UUID )
173172 TestHelper .waitMillis(500 )
174173 room.slots[1 ].role.player.addPlayerListener(p2Listener)
175174
176175 // Wait for the server to register that
177176 TestHelper .waitUntilTrue({ room.isPauseRequested }, 2000 )
178177
179- assertTrue(room.isPauseRequested)
180- val pr1 = room.slots[0 ].role
181- val pr2 = room.slots[1 ].role
182- assertTrue(pr1.player.shouldBePaused)
183- assertTrue(pr2.player.shouldBePaused)
184-
185-
186178 // Wait for it to register
187179 // no state will be send if game is paused TestHelper.waitUntilTrue(()->listener.newStateReceived, 2000);
188180 listener.newStateReceived = false
189181
190- assertTrue( TestHelper .waitUntilTrue({ p1Listener.playerEventReceived }, 2000 ) )
182+ TestHelper .waitUntilTrue({ p1Listener.playerEventReceived }, 2000 )
191183 p1Listener.playerEventReceived = false
192184 assertEquals(p1Listener.requests.size.toLong(), 1 )
193185 assertEquals(p1Listener.requests[0 ].javaClass, WelcomeMessage ::class .java)
@@ -231,11 +223,7 @@ class RequestTest: RealServerTest() {
231223 // Wait for the server to register that
232224 TestHelper .waitUntilTrue({ room.isPauseRequested }, 2000 )
233225
234- val pr1 = room.slots[0 ].role
235- val pr2 = room.slots[1 ].role
236- assertTrue(pr1.player.shouldBePaused)
237- assertTrue(pr2.player.shouldBePaused)
238-
226+ // TODO the section above duplicates the one of the previous test, clean that up
239227
240228 // Wait for it to register
241229 // no state will be send if game is paused TestHelper.waitUntilTrue(()->listener.newStateReceived, 2000);
0 commit comments