Skip to content

Commit

Permalink
Merge pull request #22 from cqframework/br-update-1.4.9-translator
Browse files Browse the repository at this point in the history
Br update 1.4.9 translator
  • Loading branch information
cmoesel authored Oct 22, 2020
2 parents 2adc273 + 522d671 commit 297c069
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 33 deletions.
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.8-jar-with-dependencies.jar", "-d"]
CMD ["java", "-jar", "target/cqlTranslationServer-1.4.9-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.8-jar-with-dependencies.jar
java -jar target/cqlTranslationServer-1.4.9-jar-with-dependencies.jar

## Simple Request

Expand Down
51 changes: 31 additions & 20 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.8</version>
<version>1.4.9</version>
<name>cqlTranslationServer</name>

<repositories>
Expand All @@ -33,23 +33,34 @@
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-http</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.4.0-b180830.0438</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.9.0.Final</version>
</dependency>
<!-- uncomment this to get JSON support:
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>3.9.3.Final</version>
</dependency>
-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -59,37 +70,37 @@
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>cql</artifactId>
<version>1.4.8</version>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>model</artifactId>
<version>1.4.8</version>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>cql-to-elm</artifactId>
<version>1.4.8</version>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>elm</artifactId>
<version>1.4.8</version>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>quick</artifactId>
<version>1.4.8</version>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>qdm</artifactId>
<version>1.4.8</version>
<groupId>info.cqframework</groupId>
<artifactId>qdm</artifactId>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.3.1</version>
<version>1.4</version>
</dependency>
</dependencies>

Expand All @@ -101,8 +112,8 @@
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -147,7 +158,7 @@
</build>

<properties>
<jersey.version>2.22.1</jersey.version>
<jersey.version>2.32</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private void validateListPromotionDisabled(String cqlTitle, int startLine, int s
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
assertNotNull(annotations);
JsonObject errorAnnotation = annotations.getJsonObject(0);
JsonObject errorAnnotation = annotations.getJsonObject(1);
assertEquals("CqlToElmError", errorAnnotation.getString("type"));
assertEquals("semantic", errorAnnotation.getString("errorType"));
assertEquals(startLine, errorAnnotation.getInt("startLine"));
Expand All @@ -135,7 +135,7 @@ private void validateListPromotionEnabled(String cqlTitle) {
JsonObject obj = reader.readObject();
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
assertNull(annotations);
assertEquals(1, annotations.size());
assertEquals(1, library.getJsonObject("statements").size());
}

Expand Down Expand Up @@ -170,8 +170,8 @@ public void testInvalidCqlAsJson() {
JsonObject obj = reader.readObject();
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
assertEquals(1, annotations.size());
JsonObject errorAnnotation = annotations.getJsonObject(0);
assertEquals(2, annotations.size());
JsonObject errorAnnotation = annotations.getJsonObject(1);
assertEquals("CqlToElmError", errorAnnotation.getString("type"));
assertEquals("syntax", errorAnnotation.getString("errorType"));
assertEquals(1, errorAnnotation.getInt("startLine"));
Expand All @@ -189,8 +189,8 @@ public void testMissingLibraryAsJson() {
JsonObject obj = reader.readObject();
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
assertEquals(1, annotations.size());
JsonObject errorAnnotation = annotations.getJsonObject(0);
assertEquals(2, annotations.size());
JsonObject errorAnnotation = annotations.getJsonObject(1);
assertEquals("CqlToElmError", errorAnnotation.getString("type"));
assertEquals("include", errorAnnotation.getString("errorType"));
assertEquals(5, errorAnnotation.getInt("startLine"));
Expand All @@ -210,7 +210,7 @@ public void testValidLibraryAsJson() {
JsonObject obj = reader.readObject();
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
assertNull(annotations);
assertEquals(1, annotations.size());
JsonObject identifier = library.getJsonObject("identifier");
assertEquals("CMS146", identifier.getString("id"));
assertEquals("2", identifier.getString("version"));
Expand All @@ -232,7 +232,7 @@ public void testValidLibraryAsJsonWithAnnotationsAndResultTypes() {
JsonObject obj = reader.readObject();
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
assertNull(annotations);
assertEquals(1, annotations.size());
JsonObject identifier = library.getJsonObject("identifier");
assertEquals("CMS146", identifier.getString("id"));
assertEquals("2", identifier.getString("version"));
Expand Down Expand Up @@ -303,7 +303,7 @@ public void testCrossLibraryResolution() {
JsonObject obj = reader.readObject();
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
assertNull(annotations); // should be no errors, dependency should be resolved
assertEquals(1, annotations.size()); // should be no errors, dependency should be resolved
JsonObject identifier = library.getJsonObject("identifier");
assertNotNull(identifier.getString("id"));
assertNotNull(identifier.getString("version"));
Expand Down Expand Up @@ -382,9 +382,9 @@ private JsonObject parseAndValidateJson( BodyPart input, String expectedId, Stri
JsonObject library = obj.getJsonObject("library");
JsonArray annotations = library.getJsonArray("annotation");
if( expectedErrors == 0 ) {
assertNull( annotations );
assertEquals(1, annotations.size() );
} else {
assertEquals( expectedErrors, annotations.size() );
assertEquals( expectedErrors + 1, annotations.size() );
}
JsonObject identifier = library.getJsonObject("identifier");
assertEquals( expectedId, identifier.getString("id"));
Expand Down

0 comments on commit 297c069

Please sign in to comment.