Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change tests to expect JAXB flavored JSON/XML
Browse files Browse the repository at this point in the history
JPercival committed Dec 20, 2024
1 parent b9f7ad3 commit c357850
Showing 15 changed files with 3,034 additions and 2,621 deletions.
4 changes: 2 additions & 2 deletions Src/java/buildSrc/src/main/groovy/cql.java-conventions.gradle
Original file line number Diff line number Diff line change
@@ -25,12 +25,12 @@ repositories {
}

dependencies {
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'org.slf4j:slf4j-api:2.0.13'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation 'uk.co.datumedge:hamcrest-json:0.2'
testImplementation(platform('org.junit:junit-bom:5.10.2'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation 'org.slf4j:slf4j-simple:1.7.36'
testImplementation 'org.slf4j:slf4j-simple:2.0.13'

// These are JAXB dependencies excluded because the libraries need to work
// on Android. But for test purposes we use them pretty much everywhere.
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ dependencies {
xjc 'org.glassfish.jaxb:jaxb-xjc:3.0.2'
xjc 'org.glassfish.jaxb:jaxb-runtime:4.0.3'
xjc 'org.eclipse.persistence:org.eclipse.persistence.moxy:4.0.2'
xjc 'org.slf4j:slf4j-simple:1.7.36'
xjc 'org.slf4j:slf4j-simple:2.0.13'
api 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1'
api 'codes.rafael.jaxb2_commons:jaxb2-basics-runtime:3.0.0'
}
4 changes: 1 addition & 3 deletions Src/java/cql-to-elm-cli/build.gradle
Original file line number Diff line number Diff line change
@@ -14,11 +14,9 @@ dependencies {
implementation project(':model-jaxb')
implementation project(':elm-jaxb')
implementation 'net.sf.jopt-simple:jopt-simple:4.7'
implementation 'org.slf4j:slf4j-simple:1.7.36'
implementation 'org.slf4j:slf4j-simple:2.0.13'
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.5'
implementation 'org.eclipse.persistence:org.eclipse.persistence.moxy:4.0.2'
testImplementation project(':model-jaxb')
testImplementation project(':model-jackson')
testImplementation project(':elm-jaxb')
testImplementation project(':elm-jackson')
}
5 changes: 3 additions & 2 deletions Src/java/cql-to-elm/build.gradle
Original file line number Diff line number Diff line change
@@ -19,10 +19,11 @@ dependencies {
// libraries such that we could swap out jackson for something else. In the meantime, these are
// "implementation" dependencies so that they are not exported downstream.
implementation "com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:${jacksonVersion}"
testImplementation project(':elm-jackson')
testImplementation project(':model-jackson')
testImplementation project(':elm-jaxb')
testImplementation project(':model-jaxb')
testImplementation project(':quick')
testImplementation project(':qdm')
testImplementation 'org.xmlunit:xmlunit-assertj:2.10.0'
testImplementation 'com.github.reinert:jjschema:1.16'
testImplementation 'com.tngtech.archunit:archunit:1.2.1'
testImplementation 'org.skyscreamer:jsonassert:1.5.1'
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package org.cqframework.cql.cql2elm;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import java.io.File;
import java.io.IOException;
import java.net.URL;
@@ -13,6 +10,7 @@
import org.cqframework.cql.cql2elm.LibraryBuilder.SignatureLevel;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.xmlunit.assertj.XmlAssert;

class CMS146XmlTest {

@@ -37,7 +35,8 @@ void cms146SignatureLevels(String fileName, SignatureLevel expectedSignatureLeve
new LibraryManager(
modelManager, new CqlCompilerOptions(ErrorSeverity.Warning, expectedSignatureLevel)));
final String actualXml = translator.toXml().trim();
assertThat(actualXml, equalTo(expectedXml));

XmlAssert.assertThat(actualXml).and(expectedXml).ignoreWhitespace().areIdentical();
}

private static String getXml(String name) throws IOException {
Loading

0 comments on commit c357850

Please sign in to comment.