-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 666-UpdateCQL3.x Updated pom.xml with latest version of CQL engine, evaluator, picocli and hapi. * 666-UpdateCQL3.x Updated version to 2.1.1 * 666-UpdateCQL3.x Updated version to 3.0.0 * 666-UpdateCQL3.x Reverted to proper version * 666-UpdateCQL3.x Current state * 666-UpdateCQL3.x Working build with update Todo: Remove evaluator JABX * 666-UpdateCQL3.x Updated to version 3.0.0 Need to remove Jabx * 666-UpdateCQL3.x Updated to version 3.0.0 Fixed startup issue with LsService! Updated cql to elm pom version Need to remove Jabx * 666-UpdateCQL3.x Updated latest version of jaxb * 666-UpdateCQL3.x Removed unused libraries from pom.xml Working version of cql-language-server! * 666-UpdateCQL3.x Cleanup * Test Coverage Increase Added complete test class for ViewElmCommandContribution * Remove Java 9 profile since we're now baselined at 11 --------- Co-authored-by: Jonathan Percival <[email protected]>
- Loading branch information
Showing
3 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...r/src/test/java/org/opencds/cqf/cql/ls/server/command/ViewElmCommandContributionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.opencds.cqf.cql.ls.server.command; | ||
|
||
import com.google.gson.JsonParser; | ||
import org.eclipse.lsp4j.ExecuteCommandParams; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import org.opencds.cqf.cql.ls.core.ContentService; | ||
import org.opencds.cqf.cql.ls.server.manager.CompilerOptionsManager; | ||
import org.opencds.cqf.cql.ls.server.manager.CqlCompilationManager; | ||
import org.opencds.cqf.cql.ls.server.manager.IgContextManager; | ||
import org.opencds.cqf.cql.ls.server.service.TestContentService; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
import java.util.Collections; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class ViewElmCommandContributionTest { | ||
|
||
private static ViewElmCommandContribution viewElmCommandContribution; | ||
@BeforeAll | ||
static void beforeAll() { | ||
ContentService cs = new TestContentService(); | ||
CqlCompilationManager cqlCompilationManager = | ||
new CqlCompilationManager(cs, new CompilerOptionsManager(cs), new IgContextManager(cs)); | ||
viewElmCommandContribution = new ViewElmCommandContribution(cqlCompilationManager); | ||
} | ||
|
||
@Test | ||
void getCommands() { | ||
assertEquals(1, viewElmCommandContribution.getCommands().size()); | ||
assertEquals("org.opencds.cqf.cql.ls.viewElm", viewElmCommandContribution.getCommands().toArray()[0]); | ||
} | ||
|
||
@Test | ||
void executeCommand() { | ||
ExecuteCommandParams params = new ExecuteCommandParams(); | ||
params.setCommand("org.opencds.cqf.cql.ls.viewElm"); | ||
params.setArguments(Collections.singletonList(JsonParser.parseString("\"\\/org\\/opencds\\/cqf\\/cql\\/ls\\/server\\/One.cql\""))); | ||
viewElmCommandContribution.executeCommand(params).thenAccept(result -> { | ||
try { | ||
String expectedXml = new String(Files.readAllBytes(Paths.get("src/test/resources/One.xml"))).trim().replaceAll("\\s+", ""); | ||
assertEquals(expectedXml, result.toString().trim().replaceAll("\\s+", "")); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
}); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
ls/server/src/test/resources/org/opencds/cqf/cql/ls/server/One.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<library xmlns="urn:hl7-org:elm:r1" xmlns:t="urn:hl7-org:elm-types:r1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fhir="http://hl7.org/fhir" xmlns:qdm43="urn:healthit-gov:qdm:v4_3" xmlns:qdm53="urn:healthit-gov:qdm:v5_3" xmlns:a="urn:hl7-org:cql-annotations:r1"> | ||
<annotation translatorVersion="3.3.2" translatorOptions="EnableAnnotations,EnableLocators,DisableListDemotion,DisableListPromotion" signatureLevel="None" xsi:type="a:CqlToElmInfo"/> | ||
<annotation xsi:type="a:Annotation"> | ||
<a:s r="2"> | ||
<a:s>library One</a:s> | ||
</a:s> | ||
</annotation> | ||
<identifier id="One"/> | ||
<schemaIdentifier id="urn:hl7-org:elm" version="r1"/> | ||
<usings> | ||
<def localIdentifier="System" uri="urn:hl7-org:elm-types:r1"/> | ||
</usings> | ||
<statements> | ||
<def localId="2" locator="3:1-4:5" name="One" context="Unfiltered" accessLevel="Public"> | ||
<annotation xsi:type="a:Annotation"> | ||
<a:s r="2"> | ||
<a:s r="1">define "One": | ||
1</a:s> | ||
</a:s> | ||
</annotation> | ||
<expression localId="1" locator="4:5" valueType="t:Integer" value="1" xsi:type="Literal"/> | ||
</def> | ||
</statements> | ||
</library> |