@@ -11,8 +11,10 @@ import io.kotest.matchers.string.*
1111import sc.api.plugins.Coordinates
1212import sc.api.plugins.Team
1313import sc.helpers.shouldSerializeTo
14- import sc.helpers.testXStream
14+ import sc.networking.XStreamProvider
1515import sc.plugin2023.util.PenguinConstants
16+ import sc.plugin2023.util.XStreamClasses
17+ import sc.protocol.LobbyProtocol
1618import sc.y
1719
1820class BoardTest : FunSpec ({
@@ -60,20 +62,23 @@ class BoardTest: FunSpec({
6062 board.possibleMovesFrom(0 y 0) shouldHaveSize PenguinConstants .BOARD_SIZE - 1
6163 }
6264 }
63- xcontext("XML Serialization ") {
64- test("empty Board ") {
65+ val xstream = XStreamProvider .basic()
66+ LobbyProtocol .registerAdditionalMessages(xstream, XStreamClasses ().classesToRegister)
67+ context("XML Serialization ") {
68+ xtest("empty Board ") {
69+ // TODO shouldSerializeTo needs to be uncoupled from general testXStream
6570 Board (arrayOf()) shouldSerializeTo """
6671 <board/>
6772 """ .trimIndent()
6873 }
6974 test("random Board length") {
70- testXStream .toXML(Board ()) shouldHaveLineCount 82
75+ xstream .toXML(Board ()) shouldHaveLineCount 82
7176 }
7277 test("Board with content") {
7378 val fieldTwo = " <field>TWO</field>"
74- testXStream .fromXML(fieldTwo) shouldBe Field (penguin = Team .TWO )
75- testXStream.fromXML("<board><list>$fieldTwo</list>") shouldBe makeSimpleBoard(Field (penguin = Team .TWO ))
76- testXStream .toXML(makeBoard(0 y 0 to 1)) shouldContainOnlyOnce fieldTwo
79+ xstream .fromXML(fieldTwo) shouldBe Field (penguin = Team .TWO )
80+ // testXStream.fromXML("<board><list>$fieldTwo</list>") shouldBe makeSimpleBoard(Field(penguin = Team.TWO))
81+ xstream .toXML(makeBoard(0 y 0 to 1)) shouldContainOnlyOnce fieldTwo
7782 }
7883 }
7984})
0 commit comments