Merge branch 'opengotha' into 'pairing2'

Opengotha

See merge request tournois/pairgoth!1
This commit is contained in:
Claude BRISSON
2023-09-29 11:33:51 +00:00
47 changed files with 427 additions and 28 deletions

View File

@@ -1,5 +1,7 @@
package org.jeudego.pairgoth.test
import org.jeudego.pairgoth.ext.OpenGotha
import org.jeudego.pairgoth.util.XmlUtils
import org.junit.jupiter.api.Test
import java.nio.charset.StandardCharsets
@@ -24,4 +26,19 @@ class ImportExportTests: TestBase() {
logger.info(xml.slice(0..50)+"...")
}
}
@Test
fun `002 test opengotha import export`() {
// We import a tournament
// Check that after exporting and reimporting we get the same pairgoth tournament object
getTestResources("opengotha").forEach { file ->
val resource = file.readText(StandardCharsets.UTF_8)
val root_xml = XmlUtils.parse(resource)
val tournament = OpenGotha.import(root_xml)
val exported = OpenGotha.export(tournament)
val tournament2 = OpenGotha.import(XmlUtils.parse(exported))
assert(tournament == tournament2)
}
}
}