Skip to content

Commit

Permalink
Merge pull request #23 from cqframework/to-1.5.2
Browse files Browse the repository at this point in the history
Upgrade CQL-to-ELM to 1.5.2
  • Loading branch information
cmoesel authored Apr 13, 2021
2 parents 297c069 + ba797e9 commit ccc9396
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 16 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Java CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode verify
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ EXPOSE 8080

# execute it
# CMD ["mvn", "exec:java"]
CMD ["java", "-jar", "target/cqlTranslationServer-1.4.9-jar-with-dependencies.jar", "-d"]
CMD ["java", "-jar", "target/cqlTranslationServer-1.5.2-jar-with-dependencies.jar", "-d"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Build:

Execute via the command line:

java -jar target/cqlTranslationServer-1.4.9-jar-with-dependencies.jar
java -jar target/cqlTranslationServer-1.5.2-jar-with-dependencies.jar

## Simple Request

Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.mitre.bonnie</groupId>
<artifactId>cqlTranslationServer</artifactId>
<packaging>jar</packaging>
<version>1.4.9</version>
<version>1.5.2</version>
<name>cqlTranslationServer</name>

<repositories>
Expand Down Expand Up @@ -70,32 +70,32 @@
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>cql</artifactId>
<version>1.4.9</version>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>model</artifactId>
<version>1.4.9</version>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>cql-to-elm</artifactId>
<version>1.4.9</version>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>elm</artifactId>
<version>1.4.9</version>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>quick</artifactId>
<version>1.4.9</version>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>qdm</artifactId>
<version>1.4.9</version>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void setUp() throws Exception {
// dependency on jersey-media-json module in pom.xml and Main.startServer())
// --
// c.configuration().enable(new org.glassfish.jersey.media.json.JsonJaxbFeature());
target = c.target(Main.BASE_URI);
target = c.target(Main.BASE_URI.replace("0.0.0.0", "localhost"));
}

@After
Expand Down Expand Up @@ -232,7 +232,7 @@ public void testValidLibraryAsJsonWithAnnotationsAndResultTypes() {
JsonObject obj = reader.readObject();
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
assertEquals(1, annotations.size());
assertEquals(2, annotations.size());
JsonObject identifier = library.getJsonObject("identifier");
assertEquals("CMS146", identifier.getString("id"));
assertEquals("2", identifier.getString("version"));
Expand Down Expand Up @@ -360,13 +360,13 @@ public void testMultipartRequestAsJsonAndXml() throws Exception {
parseAndValidateXml( part, "CMS146", "2", 0 );
} else if( part.getMediaType().equals( MediaType.valueOf( TranslationResource.ELM_JSON_TYPE ) ) ) {
parseAndValidateJson( part, "CMS146", "2", 0 );
} else {
} else {
fail( "Unsupported media type" );
}
}
}
}

private Document parseAndValidateXml( BodyPart input, String expectedId, String expectedVersion, int expectedErrors ) throws Exception {
Document doc = parseXml(input.getEntityAs(String.class));
String errorCount = applyXPath(doc, "count(/elm:library/elm:annotation[@errorType='syntax'])");
Expand All @@ -375,21 +375,21 @@ private Document parseAndValidateXml( BodyPart input, String expectedId, String
assertEquals("2", applyXPath(doc, "/elm:library/elm:identifier/@version") );
return doc;
}

private JsonObject parseAndValidateJson( BodyPart input, String expectedId, String expectedVersion, int expectedErrors ) {
JsonReader reader = Json.createReader( new StringReader(input.getEntityAs(String.class)) );
JsonObject obj = reader.readObject();
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
if( expectedErrors == 0 ) {
if( expectedErrors == 0 ) {
assertEquals(1, annotations.size() );
} else {
assertEquals( expectedErrors + 1, annotations.size() );
}
JsonObject identifier = library.getJsonObject("identifier");
assertEquals( expectedId, identifier.getString("id"));
assertEquals( expectedVersion, identifier.getString("version"));

return library;
}

Expand Down

0 comments on commit ccc9396

Please sign in to comment.