Skip to content

Commit

Permalink
Update notes on tests failures
Browse files Browse the repository at this point in the history
  • Loading branch information
JPercival committed Jan 1, 2025
1 parent 9508a81 commit 70285b2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
import org.junit.jupiter.params.provider.MethodSource;
import org.skyscreamer.jsonassert.JSONAssert;

@Disabled("Currently failing due to differences in QName serialization. Possible fix: Custom serializer for QName.")
@Disabled(
"""
Currently failing due to differences in QName serialization.
The default QName serializer expects a structured object, not a string
Possible fix: Custom serializer for QName.""")
class CMS146JsonTest {

private static Object[][] sigFileAndSigLevel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
import org.xmlunit.assertj.XmlAssert;

@Disabled(
"Currently failing due to differences in the namespace prefixes. Possible fix: Decorate all POJOs with the namespace declaration.")
"""
Currently failing due to differences in the namespace prefixes.
turning `isCollectingNsAttributes` on in the XML serializer would probably fix this,
except that there's a bug in the serializer that causes an out-of-heap issue when it's on.
Probably need to fix that upstream.""")
class CMS146XmlTest {

private static Object[][] sigFileAndSigLevel() {
Expand All @@ -44,7 +48,16 @@ void cms146SignatureLevels(String fileName, SignatureLevel expectedSignatureLeve
// The compiler version changes release-to-release
// so we strip it out of the XML before comparison
final String xmlWithVersion = translator.toXml().trim();
String actualXml = xmlWithVersion.replaceAll("translatorVersion=\"[^\"]*\"", "");
String actualXml = xmlWithVersion
.replaceAll("translatorVersion=\"[^\"]*\"", "")
// temporary fix for namespace prefix differences
// .replaceAll("xmlns:n1=\"urn:hl7-org:elm:r1\"", "")
// .replaceAll("n1:", "")
// Possible bug in original XML, no access modifier on when name and context are both Patient?
// Maybe it's not emitting default access modifiers?
.replace(
"name=\"Patient\" context=\"Patient\" accessLevel=\"Public\"",
"name=\"Patient\" context=\"Patient\"");

XmlAssert.assertThat(actualXml).and(expectedXml).ignoreWhitespace().areIdentical();
}
Expand Down
6 changes: 3 additions & 3 deletions Src/js/xsd-kotlin-gen/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ function processElements(elements, config, mode) {
if (isList) {
return `
${config.packageName === 'org.hl7.elm_modelinfo.r1' ? '' : `@kotlinx.serialization.SerialName(${JSON.stringify(name)})`}
@nl.adaptivity.xmlutil.serialization.XmlSerialName(${JSON.stringify(name)}, ${JSON.stringify(config.namespaceUri)}, "")
@nl.adaptivity.xmlutil.serialization.XmlSerialName(${JSON.stringify(name)}, ${JSON.stringify(config.namespaceUri)})
private var _${fieldName}: MutableList<${type}>? = null
var ${fieldName}: MutableList<${type}>
Expand All @@ -523,7 +523,7 @@ function processElements(elements, config, mode) {

return `
${config.packageName === 'org.hl7.elm_modelinfo.r1' ? '' : `@kotlinx.serialization.SerialName(${JSON.stringify(name)})`}
@nl.adaptivity.xmlutil.serialization.XmlSerialName(${JSON.stringify(name)}, ${JSON.stringify(config.namespaceUri)}, "")
@nl.adaptivity.xmlutil.serialization.XmlSerialName(${JSON.stringify(name)}, ${JSON.stringify(config.namespaceUri)})
${
// type === 'nl.adaptivity.xmlutil.SerializableQName' ? '@kotlinx.serialization.Contextual' : '@kotlinx.serialization.Serializable'
''
Expand Down Expand Up @@ -593,7 +593,7 @@ ${element.attributes.name === 'Library' || element.attributes.name === 'ModelInf
@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class, nl.adaptivity.xmlutil.ExperimentalXmlUtilApi::class)
@kotlinx.serialization.Serializable
${config.packageName === 'org.hl7.elm_modelinfo.r1' ? '' : `@kotlinx.serialization.SerialName(${JSON.stringify(makeLocalName(element.attributes.name))})`}
@nl.adaptivity.xmlutil.serialization.XmlSerialName(${JSON.stringify(makeLocalName(element.attributes.name))}, ${ JSON.stringify(config.namespaceUri)}, "")
@nl.adaptivity.xmlutil.serialization.XmlSerialName(${JSON.stringify(makeLocalName(element.attributes.name))}, ${ JSON.stringify(config.namespaceUri)})
${element.attributes.abstract === "true" ? "abstract" : "open"} class ${element.attributes.name} ${extendsClass ? `: ${extendsClass}()` : ""} {
${fields
Expand Down

0 comments on commit 70285b2

Please sign in to comment.