More work on porting tests
This commit is contained in:
parent
43c9003258
commit
e7f8f8c30d
|
@ -1,26 +1,7 @@
|
||||||
package ca.uhn.fhir.rest.client.api;
|
package ca.uhn.fhir.rest.client.api;
|
||||||
|
|
||||||
/*
|
import org.hl7.fhir.instance.model.api.IBaseConformance;
|
||||||
* #%L
|
|
||||||
* HAPI FHIR - Core Library
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2014 - 2017 University Health Network
|
|
||||||
* %%
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* #L%
|
|
||||||
*/
|
|
||||||
|
|
||||||
import ca.uhn.fhir.model.base.resource.BaseConformance;
|
|
||||||
import ca.uhn.fhir.rest.annotation.Metadata;
|
import ca.uhn.fhir.rest.annotation.Metadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,6 +17,6 @@ public interface IBasicClient extends IRestfulClient {
|
||||||
* for more information.
|
* for more information.
|
||||||
*/
|
*/
|
||||||
@Metadata
|
@Metadata
|
||||||
BaseConformance getServerConformanceStatement();
|
IBaseConformance getServerConformanceStatement();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ public class ParameterUtil {
|
||||||
for (Annotation[] annotations : theMethod.getParameterAnnotations()) {
|
for (Annotation[] annotations : theMethod.getParameterAnnotations()) {
|
||||||
for (int annotationIndex = 0; annotationIndex < annotations.length; annotationIndex++) {
|
for (int annotationIndex = 0; annotationIndex < annotations.length; annotationIndex++) {
|
||||||
Annotation nextAnnotation = annotations[annotationIndex];
|
Annotation nextAnnotation = annotations[annotationIndex];
|
||||||
Class<? extends Annotation> class1 = nextAnnotation.getClass();
|
Class<? extends Annotation> class1 = nextAnnotation.annotationType();
|
||||||
if (toFind.isAssignableFrom(class1)) {
|
if (toFind.isAssignableFrom(class1)) {
|
||||||
return paramIndex;
|
return paramIndex;
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,11 @@ public abstract class BaseResourceReturningMethodBinding extends BaseMethodBindi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map<String, List<String>> theHeaders) {
|
public Object invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map<String, List<String>> theHeaders) {
|
||||||
|
|
||||||
|
if (Constants.STATUS_HTTP_204_NO_CONTENT == theResponseStatusCode) {
|
||||||
|
return toReturnType(null);
|
||||||
|
}
|
||||||
|
|
||||||
IParser parser = createAppropriateParserForParsingResponse(theResponseMimeType, theResponseReader, theResponseStatusCode, myPreferTypesList);
|
IParser parser = createAppropriateParserForParsingResponse(theResponseMimeType, theResponseReader, theResponseStatusCode, myPreferTypesList);
|
||||||
|
|
||||||
switch (getReturnType()) {
|
switch (getReturnType()) {
|
||||||
|
@ -153,31 +158,44 @@ public abstract class BaseResourceReturningMethodBinding extends BaseMethodBindi
|
||||||
|
|
||||||
MethodUtil.parseClientRequestResourceHeaders(null, theHeaders, resource);
|
MethodUtil.parseClientRequestResourceHeaders(null, theHeaders, resource);
|
||||||
|
|
||||||
switch (getMethodReturnType()) {
|
return toReturnType(resource);
|
||||||
case LIST_OF_RESOURCES:
|
|
||||||
return Collections.singletonList(resource);
|
|
||||||
case RESOURCE:
|
|
||||||
return resource;
|
|
||||||
case BUNDLE_RESOURCE:
|
|
||||||
return resource;
|
|
||||||
case METHOD_OUTCOME:
|
|
||||||
MethodOutcome retVal = new MethodOutcome();
|
|
||||||
retVal.setOperationOutcome((IBaseOperationOutcome) resource);
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IllegalStateException("Should not get here!");
|
throw new IllegalStateException("Should not get here!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Object toReturnType(IBaseResource resource) {
|
||||||
|
Object retVal = null;
|
||||||
|
|
||||||
|
switch (getMethodReturnType()) {
|
||||||
|
case LIST_OF_RESOURCES:
|
||||||
|
retVal = Collections.emptyList();
|
||||||
|
if (resource != null) {
|
||||||
|
retVal = Collections.singletonList(resource);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RESOURCE:
|
||||||
|
retVal = resource;
|
||||||
|
break;
|
||||||
|
case BUNDLE_RESOURCE:
|
||||||
|
retVal = resource;
|
||||||
|
break;
|
||||||
|
case METHOD_OUTCOME:
|
||||||
|
MethodOutcome outcome = new MethodOutcome();
|
||||||
|
outcome.setOperationOutcome((IBaseOperationOutcome) resource);
|
||||||
|
retVal = outcome;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private List<Class<? extends IBaseResource>> createPreferTypesList() {
|
private List<Class<? extends IBaseResource>> createPreferTypesList() {
|
||||||
List<Class<? extends IBaseResource>> preferTypes = null;
|
List<Class<? extends IBaseResource>> preferTypes = null;
|
||||||
if (myResourceType != null && !BaseMethodBinding.isResourceInterface(myResourceType)) {
|
if (myResourceType != null && !BaseMethodBinding.isResourceInterface(myResourceType)) {
|
||||||
preferTypes = new ArrayList<Class<? extends IBaseResource>>(1);
|
preferTypes = new ArrayList<Class<? extends IBaseResource>>(1);
|
||||||
preferTypes.add((Class<? extends IBaseResource>) myResourceType);
|
preferTypes.add(myResourceType);
|
||||||
} else if (myResourceListCollectionType != null && IBaseResource.class.isAssignableFrom(myResourceListCollectionType) && !BaseMethodBinding.isResourceInterface(myResourceListCollectionType)) {
|
} else if (myResourceListCollectionType != null && IBaseResource.class.isAssignableFrom(myResourceListCollectionType) && !BaseMethodBinding.isResourceInterface(myResourceListCollectionType)) {
|
||||||
preferTypes = new ArrayList<Class<? extends IBaseResource>>(1);
|
preferTypes = new ArrayList<Class<? extends IBaseResource>>(1);
|
||||||
preferTypes.add((Class<? extends IBaseResource>) myResourceListCollectionType);
|
preferTypes.add((Class<? extends IBaseResource>) myResourceListCollectionType);
|
||||||
|
|
|
@ -23,24 +23,19 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.ConfigurationException;
|
import ca.uhn.fhir.context.ConfigurationException;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.model.api.annotation.Description;
|
import ca.uhn.fhir.model.api.annotation.Description;
|
||||||
import ca.uhn.fhir.model.primitive.IdDt;
|
|
||||||
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
|
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
|
||||||
import ca.uhn.fhir.rest.annotation.Search;
|
import ca.uhn.fhir.rest.annotation.Search;
|
||||||
import ca.uhn.fhir.rest.api.Constants;
|
import ca.uhn.fhir.rest.api.*;
|
||||||
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
|
|
||||||
import ca.uhn.fhir.rest.api.SearchStyleEnum;
|
|
||||||
import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation;
|
import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation;
|
||||||
import ca.uhn.fhir.rest.param.ParameterUtil;
|
import ca.uhn.fhir.rest.param.ParameterUtil;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||||
|
@ -135,7 +130,7 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding {
|
||||||
queryStringArgs.put(Constants.PARAM_QUERY, Collections.singletonList(myQueryName));
|
queryStringArgs.put(Constants.PARAM_QUERY, Collections.singletonList(myQueryName));
|
||||||
}
|
}
|
||||||
|
|
||||||
IdDt id = (IdDt) (myIdParamIndex != null ? theArgs[myIdParamIndex] : null);
|
IIdType id = (IIdType) (myIdParamIndex != null ? theArgs[myIdParamIndex] : null);
|
||||||
|
|
||||||
String resourceName = getResourceName();
|
String resourceName = getResourceName();
|
||||||
if (theArgs != null) {
|
if (theArgs != null) {
|
||||||
|
@ -167,7 +162,7 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static BaseHttpClientInvocation createSearchInvocation(FhirContext theContext, String theResourceName, Map<String, List<String>> theParameters, IdDt theId, String theCompartmentName,
|
public static BaseHttpClientInvocation createSearchInvocation(FhirContext theContext, String theResourceName, Map<String, List<String>> theParameters, IIdType theId, String theCompartmentName,
|
||||||
SearchStyleEnum theSearchStyle) {
|
SearchStyleEnum theSearchStyle) {
|
||||||
SearchStyleEnum searchStyle = theSearchStyle;
|
SearchStyleEnum searchStyle = theSearchStyle;
|
||||||
if (searchStyle == null) {
|
if (searchStyle == null) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class TransactionParameter implements IParameter {
|
||||||
if (theInnerCollectionType.equals(List.class) == false) {
|
if (theInnerCollectionType.equals(List.class) == false) {
|
||||||
throw new ConfigurationException(createParameterTypeError(theMethod));
|
throw new ConfigurationException(createParameterTypeError(theMethod));
|
||||||
}
|
}
|
||||||
if (theParameterType.equals(IResource.class) == false) {
|
if (theParameterType.equals(IResource.class) == false && theParameterType.equals(IBaseResource.class) == false) {
|
||||||
throw new ConfigurationException(createParameterTypeError(theMethod));
|
throw new ConfigurationException(createParameterTypeError(theMethod));
|
||||||
}
|
}
|
||||||
myParamStyle = ParamStyle.RESOURCE_LIST;
|
myParamStyle = ParamStyle.RESOURCE_LIST;
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class ValidateMethodBindingDstu2Plus extends OperationMethodBinding {
|
||||||
|
|
||||||
public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider,
|
public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider,
|
||||||
Validate theAnnotation) {
|
Validate theAnnotation) {
|
||||||
super(theReturnResourceType, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION);
|
super(null, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION);
|
||||||
|
|
||||||
List<IParameter> newParams = new ArrayList<IParameter>();
|
List<IParameter> newParams = new ArrayList<IParameter>();
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
|
@ -196,8 +196,8 @@
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xmlunit</groupId>
|
<groupId>org.xmlunit</groupId>
|
||||||
<artifactId>xmlunit</artifactId>
|
<artifactId>xmlunit-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -80,8 +80,8 @@
|
||||||
|
|
||||||
<!-- Testing -->
|
<!-- Testing -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xmlunit</groupId>
|
<groupId>org.xmlunit</groupId>
|
||||||
<artifactId>xmlunit</artifactId>
|
<artifactId>xmlunit-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,120 +0,0 @@
|
||||||
package ca.uhn.fhir.parser;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.StringReader;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.util.zip.ZipEntry;
|
|
||||||
import java.util.zip.ZipInputStream;
|
|
||||||
|
|
||||||
import javax.xml.stream.XMLEventReader;
|
|
||||||
import javax.xml.stream.XMLEventWriter;
|
|
||||||
import javax.xml.stream.XMLStreamConstants;
|
|
||||||
import javax.xml.stream.events.XMLEvent;
|
|
||||||
|
|
||||||
import org.custommonkey.xmlunit.DetailedDiff;
|
|
||||||
import org.custommonkey.xmlunit.Diff;
|
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
|
||||||
import ca.uhn.fhir.util.TestUtil;
|
|
||||||
import ca.uhn.fhir.util.XmlUtil;
|
|
||||||
|
|
||||||
public class RoundTripDstu2_1Test {
|
|
||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RoundTripDstu2_1Test.class);
|
|
||||||
private static FhirContext ourCtx = FhirContext.forDstu2_1();
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testIt() {
|
|
||||||
// Just so this doesn't complain until we enable roundtrip test
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
|
||||||
public static void afterClassClearContext() {
|
|
||||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testRoundTrip() throws Exception {
|
|
||||||
ZipInputStream is = new ZipInputStream(new FileInputStream("src/test/resources/examples.zip"));
|
|
||||||
try {
|
|
||||||
while (true) {
|
|
||||||
ZipEntry nextEntry = is.getNextEntry();
|
|
||||||
if (nextEntry == null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ByteArrayOutputStream oos = new ByteArrayOutputStream();
|
|
||||||
byte[] buffer = new byte[2048];
|
|
||||||
int len = 0;
|
|
||||||
while ((len = is.read(buffer)) > 0) {
|
|
||||||
oos.write(buffer, 0, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
String exampleText = oos.toString("UTF-8");
|
|
||||||
ourLog.info("Next file: {} - Size: {} bytes", nextEntry.getName(), exampleText.length());
|
|
||||||
if (!nextEntry.getName().contains("diagnosticreport-examples-lab")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
IBaseResource parsed = ourCtx.newXmlParser().parseResource(exampleText);
|
|
||||||
String encodedXml = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
|
||||||
|
|
||||||
exampleText = cleanXml(exampleText);
|
|
||||||
encodedXml = cleanXml(encodedXml);
|
|
||||||
|
|
||||||
DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml)));
|
|
||||||
// d.overrideDifferenceListener(new DifferenceListener() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void skippedComparison(Node theControl, Node theTest) {
|
|
||||||
// ourLog.info("" + theControl);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public int differenceFound(Difference theDifference) {
|
|
||||||
// ourLog.info("" + theDifference);
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
boolean similar = d.similar();
|
|
||||||
if (!similar) {
|
|
||||||
exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", "");
|
|
||||||
encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", "");
|
|
||||||
if (exampleText.length() != encodedXml.length()) {
|
|
||||||
// ourLog.info("Expected: " + exampleText);
|
|
||||||
// ourLog.info("Actual : " + encodedXml);
|
|
||||||
assertTrue(d.toString(), similar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String cleanXml(String exampleText) throws Error, Exception {
|
|
||||||
XMLEventReader read = XmlUtil.createXmlReader(new StringReader(exampleText));
|
|
||||||
StringWriter sw = new StringWriter();
|
|
||||||
XMLEventWriter write = XmlUtil.createXmlWriter(sw);
|
|
||||||
while (read.hasNext()) {
|
|
||||||
XMLEvent nextEvent = read.nextEvent();
|
|
||||||
if (nextEvent.getEventType() == XMLStreamConstants.COMMENT) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
write.add(nextEvent);
|
|
||||||
}
|
|
||||||
write.add(read);
|
|
||||||
sw.close();
|
|
||||||
return sw.toString().replaceAll("<!--.*-->", "").replace("\n", " ").replace("\r", " ").replaceAll(">\\s+<", "><").replaceAll("<\\?.*\\?>", "").replaceAll("\\s+", " ");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,32 +1,16 @@
|
||||||
package ca.uhn.fhir.parser;
|
package ca.uhn.fhir.parser;
|
||||||
|
|
||||||
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.hamcrest.Matchers.contains;
|
import static org.hamcrest.Matchers.contains;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.junit.Assert.*;
|
||||||
import static org.hamcrest.Matchers.empty;
|
|
||||||
import static org.hamcrest.Matchers.not;
|
|
||||||
import static org.hamcrest.Matchers.stringContainsInOrder;
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertSame;
|
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.Matchers.any;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.*;
|
||||||
import static org.mockito.Mockito.times;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringReader;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.custommonkey.xmlunit.Diff;
|
|
||||||
import org.custommonkey.xmlunit.XMLUnit;
|
|
||||||
import org.hamcrest.collection.IsEmptyCollection;
|
import org.hamcrest.collection.IsEmptyCollection;
|
||||||
import org.hamcrest.core.StringContains;
|
import org.hamcrest.core.StringContains;
|
||||||
import org.hamcrest.text.StringContainsInOrder;
|
import org.hamcrest.text.StringContainsInOrder;
|
||||||
|
@ -46,6 +30,9 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
import org.hl7.fhir.instance.model.api.IIdType;
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
|
import org.xmlunit.builder.DiffBuilder;
|
||||||
|
import org.xmlunit.builder.Input;
|
||||||
|
import org.xmlunit.diff.*;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
@ -1814,8 +1801,7 @@ public class XmlParserDstu2_1Test {
|
||||||
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
||||||
ourLog.info(reencoded);
|
ourLog.info(reencoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
|
compareXml(content, reencoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1852,9 +1838,7 @@ public class XmlParserDstu2_1Test {
|
||||||
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
||||||
ourLog.info(reencoded);
|
ourLog.info(reencoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
|
compareXml(content, reencoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -2510,8 +2494,7 @@ public class XmlParserDstu2_1Test {
|
||||||
String reEncoded = p.encodeResourceToString(b);
|
String reEncoded = p.encodeResourceToString(b);
|
||||||
ourLog.info(reEncoded);
|
ourLog.info(reEncoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(bundle), new StringReader(reEncoded));
|
compareXml(bundle, reEncoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2684,11 +2667,17 @@ public class XmlParserDstu2_1Test {
|
||||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
public static void compareXml(String content, String reEncoded) {
|
||||||
public static void beforeClass() {
|
Diff d = DiffBuilder.compare(Input.fromString(content))
|
||||||
XMLUnit.setIgnoreAttributeOrder(true);
|
.withTest(Input.fromString(reEncoded))
|
||||||
XMLUnit.setIgnoreComments(true);
|
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
|
||||||
XMLUnit.setIgnoreWhitespace(true);
|
.checkForSimilar()
|
||||||
|
.ignoreWhitespace()
|
||||||
|
.ignoreComments()
|
||||||
|
.withComparisonController(ComparisonControllers.Default)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
assertTrue(d.toString(), !d.hasDifferences());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
@ -52,8 +52,8 @@
|
||||||
<!-- Testing -->
|
<!-- Testing -->
|
||||||
<!-- <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dstu</artifactId> <version>0.8</version> <scope>test</scope> </dependency> -->
|
<!-- <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dstu</artifactId> <version>0.8</version> <scope>test</scope> </dependency> -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xmlunit</groupId>
|
<groupId>org.xmlunit</groupId>
|
||||||
<artifactId>xmlunit</artifactId>
|
<artifactId>xmlunit-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,120 +0,0 @@
|
||||||
package ca.uhn.fhir.parser;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.StringReader;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.util.zip.ZipEntry;
|
|
||||||
import java.util.zip.ZipInputStream;
|
|
||||||
|
|
||||||
import javax.xml.stream.XMLEventReader;
|
|
||||||
import javax.xml.stream.XMLEventWriter;
|
|
||||||
import javax.xml.stream.XMLStreamConstants;
|
|
||||||
import javax.xml.stream.events.XMLEvent;
|
|
||||||
|
|
||||||
import org.custommonkey.xmlunit.DetailedDiff;
|
|
||||||
import org.custommonkey.xmlunit.Diff;
|
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
|
||||||
import ca.uhn.fhir.util.TestUtil;
|
|
||||||
import ca.uhn.fhir.util.XmlUtil;
|
|
||||||
|
|
||||||
public class RoundTripDstu2Test {
|
|
||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RoundTripDstu2Test.class);
|
|
||||||
private static FhirContext ourCtx = FhirContext.forDstu2();
|
|
||||||
|
|
||||||
@AfterClass
|
|
||||||
public static void afterClassClearContext() {
|
|
||||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testIt() {
|
|
||||||
// Just so this doesn't complain until we enable roundtrip test
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testRoundTrip() throws Exception {
|
|
||||||
ZipInputStream is = new ZipInputStream(new FileInputStream("src/test/resources/examples.zip"));
|
|
||||||
try {
|
|
||||||
while (true) {
|
|
||||||
ZipEntry nextEntry = is.getNextEntry();
|
|
||||||
if (nextEntry == null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ByteArrayOutputStream oos = new ByteArrayOutputStream();
|
|
||||||
byte[] buffer = new byte[2048];
|
|
||||||
int len = 0;
|
|
||||||
while ((len = is.read(buffer)) > 0) {
|
|
||||||
oos.write(buffer, 0, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
String exampleText = oos.toString("UTF-8");
|
|
||||||
ourLog.info("Next file: {} - Size: {} bytes", nextEntry.getName(), exampleText.length());
|
|
||||||
if (!nextEntry.getName().contains("diagnosticreport-examples-lab")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
IBaseResource parsed = ourCtx.newXmlParser().parseResource(exampleText);
|
|
||||||
String encodedXml = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
|
||||||
|
|
||||||
exampleText = cleanXml(exampleText);
|
|
||||||
encodedXml = cleanXml(encodedXml);
|
|
||||||
|
|
||||||
DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml)));
|
|
||||||
// d.overrideDifferenceListener(new DifferenceListener() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void skippedComparison(Node theControl, Node theTest) {
|
|
||||||
// ourLog.info("" + theControl);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public int differenceFound(Difference theDifference) {
|
|
||||||
// ourLog.info("" + theDifference);
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
boolean similar = d.similar();
|
|
||||||
if (!similar) {
|
|
||||||
exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", "");
|
|
||||||
encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", "");
|
|
||||||
if (exampleText.length() != encodedXml.length()) {
|
|
||||||
// ourLog.info("Expected: " + exampleText);
|
|
||||||
// ourLog.info("Actual : " + encodedXml);
|
|
||||||
assertTrue(d.toString(), similar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String cleanXml(String exampleText) throws Error, Exception {
|
|
||||||
XMLEventReader read = XmlUtil.createXmlReader(new StringReader(exampleText));
|
|
||||||
StringWriter sw = new StringWriter();
|
|
||||||
XMLEventWriter write = XmlUtil.createXmlWriter(sw);
|
|
||||||
while (read.hasNext()) {
|
|
||||||
XMLEvent nextEvent = read.nextEvent();
|
|
||||||
if (nextEvent.getEventType() == XMLStreamConstants.COMMENT) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
write.add(nextEvent);
|
|
||||||
}
|
|
||||||
write.add(read);
|
|
||||||
sw.close();
|
|
||||||
return sw.toString().replaceAll("<!--.*-->", "").replace("\n", " ").replace("\r", " ").replaceAll(">\\s+<", "><").replaceAll("<\\?.*\\?>", "").replaceAll("\\s+", " ");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,23 +1,9 @@
|
||||||
package ca.uhn.fhir.parser;
|
package ca.uhn.fhir.parser;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.contains;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.junit.Assert.*;
|
||||||
import static org.hamcrest.Matchers.emptyOrNullString;
|
|
||||||
import static org.hamcrest.Matchers.not;
|
|
||||||
import static org.hamcrest.Matchers.stringContainsInOrder;
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertSame;
|
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.Matchers.any;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.*;
|
||||||
import static org.mockito.Mockito.times;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
@ -25,17 +11,19 @@ import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.custommonkey.xmlunit.Diff;
|
|
||||||
import org.custommonkey.xmlunit.XMLUnit;
|
|
||||||
import org.hamcrest.collection.IsEmptyCollection;
|
import org.hamcrest.collection.IsEmptyCollection;
|
||||||
import org.hamcrest.core.StringContains;
|
import org.hamcrest.core.StringContains;
|
||||||
import org.hamcrest.text.StringContainsInOrder;
|
import org.hamcrest.text.StringContainsInOrder;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
import org.hl7.fhir.instance.model.api.IIdType;
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
import org.junit.*;
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
import org.mockito.internal.stubbing.answers.ThrowsException;
|
import org.mockito.internal.stubbing.answers.ThrowsException;
|
||||||
|
import org.xmlunit.builder.DiffBuilder;
|
||||||
|
import org.xmlunit.builder.Input;
|
||||||
|
import org.xmlunit.diff.*;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
@ -1933,8 +1921,7 @@ public class XmlParserDstu2Test {
|
||||||
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
||||||
ourLog.info(reencoded);
|
ourLog.info(reencoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
|
compareXml(content, reencoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1970,8 +1957,7 @@ public class XmlParserDstu2Test {
|
||||||
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
||||||
ourLog.info(reencoded);
|
ourLog.info(reencoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
|
compareXml(content, reencoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2624,9 +2610,7 @@ public class XmlParserDstu2Test {
|
||||||
|
|
||||||
ourLog.info(reEncoded);
|
ourLog.info(reEncoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(bundle), new StringReader(reEncoded));
|
compareXml(bundle, reEncoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -2811,12 +2795,6 @@ public class XmlParserDstu2Test {
|
||||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void beforeClass() {
|
|
||||||
XMLUnit.setIgnoreAttributeOrder(true);
|
|
||||||
XMLUnit.setIgnoreComments(true);
|
|
||||||
XMLUnit.setIgnoreWhitespace(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
IGenericClient c = ourCtx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
|
IGenericClient c = ourCtx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
|
||||||
|
@ -2858,4 +2836,17 @@ public class XmlParserDstu2Test {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void compareXml(String content, String reEncoded) {
|
||||||
|
Diff d = DiffBuilder.compare(Input.fromString(content))
|
||||||
|
.withTest(Input.fromString(reEncoded))
|
||||||
|
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
|
||||||
|
.checkForSimilar()
|
||||||
|
.ignoreWhitespace()
|
||||||
|
.ignoreComments()
|
||||||
|
.withComparisonController(ComparisonControllers.Default)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
assertTrue(d.toString(), !d.hasDifferences());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,12 +109,6 @@ public class ETagClientDstu2Test {
|
||||||
lm.setTimeZoneZulu(true);
|
lm.setTimeZoneZulu(true);
|
||||||
assertEquals("1995-11-15T04:58:08.000Z", lm.getValueAsString());
|
assertEquals("1995-11-15T04:58:08.000Z", lm.getValueAsString());
|
||||||
|
|
||||||
TagList tags = ResourceMetadataKeyEnum.TAG_LIST.get(response);
|
|
||||||
assertNotNull(tags);
|
|
||||||
assertEquals(1, tags.size());
|
|
||||||
assertEquals("http://foo/tagdefinition.html", tags.get(0).getTerm());
|
|
||||||
assertEquals("http://hl7.org/fhir/tag", tags.get(0).getScheme());
|
|
||||||
assertEquals("Some tag", tags.get(0).getLabel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -93,8 +93,8 @@
|
||||||
|
|
||||||
<!-- Testing -->
|
<!-- Testing -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xmlunit</groupId>
|
<groupId>org.xmlunit</groupId>
|
||||||
<artifactId>xmlunit</artifactId>
|
<artifactId>xmlunit-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,21 +1,12 @@
|
||||||
package ca.uhn.fhir.parser;
|
package ca.uhn.fhir.parser;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import java.io.*;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.StringReader;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
import javax.xml.stream.XMLEventReader;
|
import javax.xml.stream.*;
|
||||||
import javax.xml.stream.XMLEventWriter;
|
|
||||||
import javax.xml.stream.XMLStreamConstants;
|
|
||||||
import javax.xml.stream.events.XMLEvent;
|
import javax.xml.stream.events.XMLEvent;
|
||||||
|
|
||||||
import org.custommonkey.xmlunit.DetailedDiff;
|
|
||||||
import org.custommonkey.xmlunit.Diff;
|
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -68,31 +59,17 @@ public class RoundTripDstu3Test {
|
||||||
exampleText = cleanXml(exampleText);
|
exampleText = cleanXml(exampleText);
|
||||||
encodedXml = cleanXml(encodedXml);
|
encodedXml = cleanXml(encodedXml);
|
||||||
|
|
||||||
DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml)));
|
XmlParserDstu3Test.compareXml(exampleText, encodedXml);
|
||||||
// d.overrideDifferenceListener(new DifferenceListener() {
|
// DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml)));
|
||||||
//
|
//
|
||||||
// @Override
|
// boolean similar = d.similar();
|
||||||
// public void skippedComparison(Node theControl, Node theTest) {
|
// if (!similar) {
|
||||||
// ourLog.info("" + theControl);
|
// exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", "");
|
||||||
|
// encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", "");
|
||||||
|
// if (exampleText.length() != encodedXml.length()) {
|
||||||
|
// assertTrue(d.toString(), similar);
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public int differenceFound(Difference theDifference) {
|
|
||||||
// ourLog.info("" + theDifference);
|
|
||||||
// return 0;
|
|
||||||
// }
|
// }
|
||||||
// });
|
|
||||||
|
|
||||||
boolean similar = d.similar();
|
|
||||||
if (!similar) {
|
|
||||||
exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", "");
|
|
||||||
encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", "");
|
|
||||||
if (exampleText.length() != encodedXml.length()) {
|
|
||||||
// ourLog.info("Expected: " + exampleText);
|
|
||||||
// ourLog.info("Actual : " + encodedXml);
|
|
||||||
assertTrue(d.toString(), similar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,6 @@ import java.util.*;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.custommonkey.xmlunit.Diff;
|
|
||||||
import org.custommonkey.xmlunit.XMLUnit;
|
|
||||||
import org.hamcrest.collection.IsEmptyCollection;
|
import org.hamcrest.collection.IsEmptyCollection;
|
||||||
import org.hamcrest.core.StringContains;
|
import org.hamcrest.core.StringContains;
|
||||||
import org.hamcrest.text.StringContainsInOrder;
|
import org.hamcrest.text.StringContainsInOrder;
|
||||||
|
@ -54,6 +52,9 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
import org.hl7.fhir.instance.model.api.IIdType;
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
|
import org.xmlunit.builder.DiffBuilder;
|
||||||
|
import org.xmlunit.builder.Input;
|
||||||
|
import org.xmlunit.diff.*;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
@ -1571,7 +1572,8 @@ public class XmlParserDstu3Test {
|
||||||
ourLog.info(encoded);
|
ourLog.info(encoded);
|
||||||
|
|
||||||
assertThat(encoded, containsString("<Patient"));
|
assertThat(encoded, containsString("<Patient"));
|
||||||
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>", "<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
|
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>",
|
||||||
|
"<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
|
||||||
assertThat(encoded, not(containsString("text")));
|
assertThat(encoded, not(containsString("text")));
|
||||||
assertThat(encoded, not(containsString("THE DIV")));
|
assertThat(encoded, not(containsString("THE DIV")));
|
||||||
assertThat(encoded, containsString("family"));
|
assertThat(encoded, containsString("family"));
|
||||||
|
@ -1717,7 +1719,8 @@ public class XmlParserDstu3Test {
|
||||||
ourLog.info(encoded);
|
ourLog.info(encoded);
|
||||||
|
|
||||||
assertThat(encoded, containsString("<Patient"));
|
assertThat(encoded, containsString("<Patient"));
|
||||||
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>", "<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
|
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>",
|
||||||
|
"<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
|
||||||
assertThat(encoded, not(containsString("THE DIV")));
|
assertThat(encoded, not(containsString("THE DIV")));
|
||||||
assertThat(encoded, containsString("family"));
|
assertThat(encoded, containsString("family"));
|
||||||
assertThat(encoded, not(containsString("maritalStatus")));
|
assertThat(encoded, not(containsString("maritalStatus")));
|
||||||
|
@ -1738,7 +1741,8 @@ public class XmlParserDstu3Test {
|
||||||
|
|
||||||
assertThat(encoded, containsString("<Patient"));
|
assertThat(encoded, containsString("<Patient"));
|
||||||
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"foo\"/>", "<code value=\"bar\"/>", "</tag>"));
|
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"foo\"/>", "<code value=\"bar\"/>", "</tag>"));
|
||||||
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>", "<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
|
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>",
|
||||||
|
"<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
|
||||||
assertThat(encoded, not(containsString("THE DIV")));
|
assertThat(encoded, not(containsString("THE DIV")));
|
||||||
assertThat(encoded, containsString("family"));
|
assertThat(encoded, containsString("family"));
|
||||||
assertThat(encoded, not(containsString("maritalStatus")));
|
assertThat(encoded, not(containsString("maritalStatus")));
|
||||||
|
@ -2130,8 +2134,7 @@ public class XmlParserDstu3Test {
|
||||||
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
||||||
ourLog.info(reencoded);
|
ourLog.info(reencoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
|
compareXml(content, reencoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2168,8 +2171,7 @@ public class XmlParserDstu3Test {
|
||||||
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
|
||||||
ourLog.info(reencoded);
|
ourLog.info(reencoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
|
compareXml(content, reencoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2994,7 +2996,7 @@ public class XmlParserDstu3Test {
|
||||||
@Test
|
@Test
|
||||||
public void testParseMetadata() throws Exception {
|
public void testParseMetadata() throws Exception {
|
||||||
|
|
||||||
String bundle = "<Bundle xmlns=\"http://hl7.org/fhir\">\n" +
|
String content = "<Bundle xmlns=\"http://hl7.org/fhir\">\n" +
|
||||||
" <total value=\"1\"/>\n" +
|
" <total value=\"1\"/>\n" +
|
||||||
" <link>\n" +
|
" <link>\n" +
|
||||||
" <relation value=\"self\"/>\n" +
|
" <relation value=\"self\"/>\n" +
|
||||||
|
@ -3023,7 +3025,7 @@ public class XmlParserDstu3Test {
|
||||||
" </entry>\n" +
|
" </entry>\n" +
|
||||||
"</Bundle>";
|
"</Bundle>";
|
||||||
|
|
||||||
Bundle b = ourCtx.newXmlParser().parseResource(Bundle.class, bundle);
|
Bundle b = ourCtx.newXmlParser().parseResource(Bundle.class, content);
|
||||||
assertEquals(1, b.getEntry().size());
|
assertEquals(1, b.getEntry().size());
|
||||||
|
|
||||||
BundleEntryComponent entry = b.getEntry().get(0);
|
BundleEntryComponent entry = b.getEntry().get(0);
|
||||||
|
@ -3040,11 +3042,23 @@ public class XmlParserDstu3Test {
|
||||||
String reEncoded = p.encodeResourceToString(b);
|
String reEncoded = p.encodeResourceToString(b);
|
||||||
ourLog.info(reEncoded);
|
ourLog.info(reEncoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(bundle), new StringReader(reEncoded));
|
compareXml(content, reEncoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void compareXml(String content, String reEncoded) {
|
||||||
|
Diff d = DiffBuilder.compare(Input.fromString(content))
|
||||||
|
.withTest(Input.fromString(reEncoded))
|
||||||
|
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
|
||||||
|
.checkForSimilar()
|
||||||
|
.ignoreWhitespace() // this is working with newest Saxon 9.8.0-2 (not worked with 9.7.0-15
|
||||||
|
.ignoreComments() // this is not working even with newest Saxon 9.8.0-2
|
||||||
|
.withComparisonController(ComparisonControllers.Default)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
assertTrue(d.toString(), !d.hasDifferences());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testParseMetaUpdatedDate() {
|
public void testParseMetaUpdatedDate() {
|
||||||
|
|
||||||
|
@ -3325,13 +3339,6 @@ public class XmlParserDstu3Test {
|
||||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void beforeClass() {
|
|
||||||
XMLUnit.setIgnoreAttributeOrder(true);
|
|
||||||
XMLUnit.setIgnoreComments(true);
|
|
||||||
XMLUnit.setIgnoreWhitespace(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
IGenericClient c = ourCtx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
|
IGenericClient c = ourCtx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
|
||||||
// c.registerInterceptor(new LoggingInterceptor(true));
|
// c.registerInterceptor(new LoggingInterceptor(true));
|
||||||
|
|
|
@ -343,7 +343,7 @@ public class BaseDateTimeTypeDstu3Test {
|
||||||
public void testLargePrecision() {
|
public void testLargePrecision() {
|
||||||
DateTimeType dt = new DateTimeType("2014-03-06T22:09:58.9121174+04:30");
|
DateTimeType dt = new DateTimeType("2014-03-06T22:09:58.9121174+04:30");
|
||||||
|
|
||||||
myDateInstantParser.setTimeZone(TimeZone.getTimeZone("Z"));
|
myDateInstantParser.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
assertEquals("2014-03-06 17:39:58.912", myDateInstantParser.format(dt.getValue()));
|
assertEquals("2014-03-06 17:39:58.912", myDateInstantParser.format(dt.getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,8 @@
|
||||||
|
|
||||||
<!-- Testing -->
|
<!-- Testing -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xmlunit</groupId>
|
<groupId>org.xmlunit</groupId>
|
||||||
<artifactId>xmlunit</artifactId>
|
<artifactId>xmlunit-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
package ca.uhn.fhir.parser;
|
package ca.uhn.fhir.parser;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.junit.Assert.*;
|
||||||
import static org.hamcrest.Matchers.stringContainsInOrder;
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertNotEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
@ -18,7 +9,6 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.custommonkey.xmlunit.Diff;
|
|
||||||
import org.hamcrest.core.IsNot;
|
import org.hamcrest.core.IsNot;
|
||||||
import org.hamcrest.core.StringContains;
|
import org.hamcrest.core.StringContains;
|
||||||
import org.hamcrest.text.StringContainsInOrder;
|
import org.hamcrest.text.StringContainsInOrder;
|
||||||
|
@ -38,7 +28,6 @@ import org.junit.*;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.model.api.TagList;
|
|
||||||
import ca.uhn.fhir.model.api.annotation.Child;
|
import ca.uhn.fhir.model.api.annotation.Child;
|
||||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||||
import ca.uhn.fhir.narrative.INarrativeGenerator;
|
import ca.uhn.fhir.narrative.INarrativeGenerator;
|
||||||
|
@ -1281,9 +1270,7 @@ public class JsonParserHl7OrgDstu2Test {
|
||||||
String expected = (xmlString);
|
String expected = (xmlString);
|
||||||
String actual = (encoded.trim());
|
String actual = (encoded.trim());
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(expected), new StringReader(actual));
|
XmlParserHl7OrgDstu2Test.compareXml(expected, actual);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,13 @@
|
||||||
package ca.uhn.fhir.parser;
|
package ca.uhn.fhir.parser;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.junit.Assert.*;
|
||||||
import static org.hamcrest.Matchers.stringContainsInOrder;
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.custommonkey.xmlunit.Diff;
|
|
||||||
import org.custommonkey.xmlunit.XMLUnit;
|
|
||||||
import org.hamcrest.core.IsNot;
|
import org.hamcrest.core.IsNot;
|
||||||
import org.hamcrest.core.StringContains;
|
import org.hamcrest.core.StringContains;
|
||||||
import org.hamcrest.text.StringContainsInOrder;
|
import org.hamcrest.text.StringContainsInOrder;
|
||||||
|
@ -32,6 +22,9 @@ import org.hl7.fhir.instance.model.Narrative.NarrativeStatus;
|
||||||
import org.hl7.fhir.instance.model.api.*;
|
import org.hl7.fhir.instance.model.api.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
import org.xmlunit.builder.DiffBuilder;
|
||||||
|
import org.xmlunit.builder.Input;
|
||||||
|
import org.xmlunit.diff.*;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.ConfigurationException;
|
import ca.uhn.fhir.context.ConfigurationException;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
|
@ -1352,12 +1345,10 @@ public class XmlParserHl7OrgDstu2Test {
|
||||||
|
|
||||||
ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient));
|
ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient));
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
|
|
||||||
|
|
||||||
ourLog.info("Expected: {}", msg);
|
ourLog.info("Expected: {}", msg);
|
||||||
ourLog.info("Actual: {}", encoded);
|
ourLog.info("Actual: {}", encoded);
|
||||||
|
|
||||||
assertTrue(d.toString(), d.identical());
|
compareXml(msg, encoded);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1396,8 +1387,7 @@ public class XmlParserHl7OrgDstu2Test {
|
||||||
String encoded = p.setPrettyPrint(true).encodeResourceToString(resource);
|
String encoded = p.setPrettyPrint(true).encodeResourceToString(resource);
|
||||||
ourLog.info(encoded);
|
ourLog.info(encoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
|
compareXml(msg, encoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -1437,8 +1427,7 @@ public class XmlParserHl7OrgDstu2Test {
|
||||||
String encoded = p.encodeResourceToString(resource);
|
String encoded = p.encodeResourceToString(resource);
|
||||||
ourLog.info(encoded);
|
ourLog.info(encoded);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
|
compareXml(msg, encoded);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -1679,9 +1668,7 @@ public class XmlParserHl7OrgDstu2Test {
|
||||||
ourLog.info("Expected: {}", msg);
|
ourLog.info("Expected: {}", msg);
|
||||||
ourLog.info("Actual: {}", encoded1);
|
ourLog.info("Actual: {}", encoded1);
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(msg), new StringReader(encoded1));
|
compareXml(msg, encoded1);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -1709,9 +1696,7 @@ public class XmlParserHl7OrgDstu2Test {
|
||||||
String expected = (jsonString);
|
String expected = (jsonString);
|
||||||
String actual = (encoded.trim());
|
String actual = (encoded.trim());
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(expected), new StringReader(actual));
|
compareXml(expected, actual);
|
||||||
assertTrue(d.toString(), d.identical());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -1755,9 +1740,6 @@ public class XmlParserHl7OrgDstu2Test {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void beforeClass() {
|
public static void beforeClass() {
|
||||||
XMLUnit.setIgnoreAttributeOrder(true);
|
|
||||||
XMLUnit.setIgnoreComments(true);
|
|
||||||
XMLUnit.setIgnoreWhitespace(true);
|
|
||||||
ourCtx = FhirContext.forDstu2Hl7Org();
|
ourCtx = FhirContext.forDstu2Hl7Org();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1784,4 +1766,17 @@ public class XmlParserHl7OrgDstu2Test {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void compareXml(String content, String reEncoded) {
|
||||||
|
Diff d = DiffBuilder.compare(Input.fromString(content))
|
||||||
|
.withTest(Input.fromString(reEncoded))
|
||||||
|
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
|
||||||
|
.checkForSimilar()
|
||||||
|
.ignoreWhitespace()
|
||||||
|
.ignoreComments()
|
||||||
|
.withComparisonController(ComparisonControllers.Default)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
assertTrue(d.toString(), !d.hasDifferences());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,8 @@
|
||||||
|
|
||||||
<!-- Testing -->
|
<!-- Testing -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xmlunit</groupId>
|
<groupId>org.xmlunit</groupId>
|
||||||
<artifactId>xmlunit</artifactId>
|
<artifactId>xmlunit-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,30 +1,15 @@
|
||||||
package org.hl7.fhir.r4.elementmodel;
|
package org.hl7.fhir.r4.elementmodel;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.*;
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hl7.fhir.exceptions.*;
|
||||||
import org.hl7.fhir.r4.conformance.ProfileUtilities;
|
import org.hl7.fhir.r4.conformance.ProfileUtilities;
|
||||||
import org.hl7.fhir.r4.context.IWorkerContext;
|
import org.hl7.fhir.r4.context.IWorkerContext;
|
||||||
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
|
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
|
||||||
import org.hl7.fhir.r4.model.Base;
|
import org.hl7.fhir.r4.model.*;
|
||||||
import org.hl7.fhir.r4.model.CodeableConcept;
|
|
||||||
import org.hl7.fhir.r4.model.Coding;
|
|
||||||
import org.hl7.fhir.r4.model.ElementDefinition;
|
|
||||||
import org.hl7.fhir.r4.model.Factory;
|
|
||||||
import org.hl7.fhir.r4.model.PrimitiveType;
|
|
||||||
import org.hl7.fhir.r4.model.Resource;
|
|
||||||
import org.hl7.fhir.r4.model.StructureDefinition;
|
|
||||||
import org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind;
|
import org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind;
|
||||||
import org.hl7.fhir.r4.model.Type;
|
|
||||||
import org.hl7.fhir.exceptions.DefinitionException;
|
|
||||||
import org.hl7.fhir.exceptions.FHIRException;
|
|
||||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
|
||||||
import org.hl7.fhir.utilities.TextFile;
|
|
||||||
|
|
||||||
import com.sun.corba.se.impl.ior.NewObjectKeyTemplateBase;
|
|
||||||
|
|
||||||
|
|
||||||
public class ObjectConverter {
|
public class ObjectConverter {
|
||||||
|
|
|
@ -29,6 +29,8 @@ import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
|
|
||||||
|
import com.google.common.base.Charsets;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.model.api.Include;
|
import ca.uhn.fhir.model.api.Include;
|
||||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||||
|
@ -145,7 +147,7 @@ public class ClientR4Test {
|
||||||
|
|
||||||
assertEquals(HttpPost.class, capt.getValue().getClass());
|
assertEquals(HttpPost.class, capt.getValue().getClass());
|
||||||
HttpPost post = (HttpPost) capt.getValue();
|
HttpPost post = (HttpPost) capt.getValue();
|
||||||
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
|
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
|
||||||
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
||||||
assertEquals(EncodingEnum.XML.getResourceContentType() + Constants.HEADER_SUFFIX_CT_UTF_8, capt.getAllValues().get(0).getFirstHeader(Constants.HEADER_CONTENT_TYPE).getValue());
|
assertEquals(EncodingEnum.XML.getResourceContentType() + Constants.HEADER_SUFFIX_CT_UTF_8, capt.getAllValues().get(0).getFirstHeader(Constants.HEADER_CONTENT_TYPE).getValue());
|
||||||
assertEquals("200", response.getId().getVersionIdPart());
|
assertEquals("200", response.getId().getVersionIdPart());
|
||||||
|
@ -193,7 +195,7 @@ public class ClientR4Test {
|
||||||
|
|
||||||
assertEquals(HttpPost.class, capt.getValue().getClass());
|
assertEquals(HttpPost.class, capt.getValue().getClass());
|
||||||
HttpPost post = (HttpPost) capt.getValue();
|
HttpPost post = (HttpPost) capt.getValue();
|
||||||
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
|
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
|
||||||
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
||||||
assertEquals("200", response.getId().getVersionIdPart());
|
assertEquals("200", response.getId().getVersionIdPart());
|
||||||
}
|
}
|
||||||
|
@ -250,14 +252,13 @@ public class ClientR4Test {
|
||||||
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")));
|
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")));
|
||||||
|
|
||||||
ITestClient client = ourCtx.newRestfulClient(ITestClient.class, "http://foo");
|
ITestClient client = ourCtx.newRestfulClient(ITestClient.class, "http://foo");
|
||||||
BaseConformance response = client.getServerConformanceStatement();
|
CapabilityStatement response = (CapabilityStatement) client.getServerConformanceStatement();
|
||||||
|
|
||||||
assertEquals("http://foo/metadata", capt.getValue().getURI().toString());
|
assertEquals("http://foo/metadata", capt.getValue().getURI().toString());
|
||||||
assertEquals("Health Intersections", response.getPublisherElement().getValue());
|
assertEquals("Health Intersections", response.getPublisherElement().getValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Test
|
@Test
|
||||||
public void testHistoryResourceInstance() throws Exception {
|
public void testHistoryResourceInstance() throws Exception {
|
||||||
|
|
||||||
|
@ -279,7 +280,6 @@ public class ClientR4Test {
|
||||||
verifyHistoryBundleWithTwoResults(response);
|
verifyHistoryBundleWithTwoResults(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Test
|
@Test
|
||||||
public void testHistoryResourceType() throws Exception {
|
public void testHistoryResourceType() throws Exception {
|
||||||
|
|
||||||
|
@ -298,7 +298,6 @@ public class ClientR4Test {
|
||||||
verifyHistoryBundleWithTwoResults(response);
|
verifyHistoryBundleWithTwoResults(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Test
|
@Test
|
||||||
public void testHistoryServer() throws Exception {
|
public void testHistoryServer() throws Exception {
|
||||||
String msg = getHistoryBundleWithTwoResults();
|
String msg = getHistoryBundleWithTwoResults();
|
||||||
|
@ -1036,7 +1035,7 @@ public class ClientR4Test {
|
||||||
assertEquals(HttpPut.class, capt.getValue().getClass());
|
assertEquals(HttpPut.class, capt.getValue().getClass());
|
||||||
HttpPut post = (HttpPut) capt.getValue();
|
HttpPut post = (HttpPut) capt.getValue();
|
||||||
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/100"));
|
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/100"));
|
||||||
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
|
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
|
||||||
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
||||||
assertEquals("200", response.getId().getVersionIdPart());
|
assertEquals("200", response.getId().getVersionIdPart());
|
||||||
assertEquals(EncodingEnum.XML.getResourceContentType() + Constants.HEADER_SUFFIX_CT_UTF_8, capt.getAllValues().get(0).getFirstHeader(Constants.HEADER_CONTENT_TYPE).getValue());
|
assertEquals(EncodingEnum.XML.getResourceContentType() + Constants.HEADER_SUFFIX_CT_UTF_8, capt.getAllValues().get(0).getFirstHeader(Constants.HEADER_CONTENT_TYPE).getValue());
|
||||||
|
@ -1105,21 +1104,21 @@ public class ClientR4Test {
|
||||||
assertEquals(HttpPut.class, capt.getValue().getClass());
|
assertEquals(HttpPut.class, capt.getValue().getClass());
|
||||||
HttpPut post = (HttpPut) capt.getValue();
|
HttpPut post = (HttpPut) capt.getValue();
|
||||||
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/100"));
|
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/100"));
|
||||||
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
|
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
|
||||||
assertThat(post.getFirstHeader(Constants.HEADER_LOCATION).getValue(), StringEndsWith.endsWith("Patient/100/_history/200"));
|
assertThat(post.getFirstHeader(Constants.HEADER_LOCATION).getValue(), StringEndsWith.endsWith("Patient/100/_history/200"));
|
||||||
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
||||||
assertEquals("200", response.getId().getVersionIdPart());
|
assertEquals("200", response.getId().getVersionIdPart());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValidate() throws Exception {
|
public void testValidateNoContentResponse() throws Exception {
|
||||||
|
|
||||||
Patient patient = new Patient();
|
Patient patient = new Patient();
|
||||||
patient.addIdentifier().setSystem("urn:foo").setValue("123");
|
patient.addIdentifier().setSystem("urn:foo").setValue("123");
|
||||||
|
|
||||||
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
|
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
|
||||||
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
|
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
|
||||||
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 201, "OK"));
|
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), Constants.STATUS_HTTP_204_NO_CONTENT, "OK"));
|
||||||
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_TEXT + "; charset=UTF-8"));
|
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_TEXT + "; charset=UTF-8"));
|
||||||
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(""), Charset.forName("UTF-8")));
|
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(""), Charset.forName("UTF-8")));
|
||||||
when(myHttpResponse.getAllHeaders()).thenReturn(toHeaderArray("Location", "http://example.com/fhir/Patient/100/_history/200"));
|
when(myHttpResponse.getAllHeaders()).thenReturn(toHeaderArray("Location", "http://example.com/fhir/Patient/100/_history/200"));
|
||||||
|
@ -1129,13 +1128,42 @@ public class ClientR4Test {
|
||||||
|
|
||||||
assertEquals(HttpPost.class, capt.getValue().getClass());
|
assertEquals(HttpPost.class, capt.getValue().getClass());
|
||||||
HttpPost post = (HttpPost) capt.getValue();
|
HttpPost post = (HttpPost) capt.getValue();
|
||||||
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/_validate"));
|
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/$validate"));
|
||||||
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
|
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
|
||||||
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
|
assertNull(response.getOperationOutcome());
|
||||||
assertEquals("200", response.getId().getVersionIdPart());
|
assertNull(response.getResource());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testValidateOutcomeResponse() throws Exception {
|
||||||
|
|
||||||
|
OperationOutcome oo = new OperationOutcome();
|
||||||
|
oo.addIssue().setDiagnostics("ALL GOOD");
|
||||||
|
String resp = ourCtx.newJsonParser().encodeResourceToString(oo);
|
||||||
|
|
||||||
|
Patient patient = new Patient();
|
||||||
|
patient.addIdentifier().setSystem("urn:foo").setValue("123");
|
||||||
|
|
||||||
|
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
|
||||||
|
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
|
||||||
|
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
|
||||||
|
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON_NEW + "; charset=UTF-8"));
|
||||||
|
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(resp), Charset.forName("UTF-8")));
|
||||||
|
when(myHttpResponse.getAllHeaders()).thenReturn(toHeaderArray("Location", "http://example.com/fhir/Patient/100/_history/200"));
|
||||||
|
|
||||||
|
ITestClient client = ourCtx.newRestfulClient(ITestClient.class, "http://foo");
|
||||||
|
MethodOutcome response = client.validatePatient(patient);
|
||||||
|
|
||||||
|
assertEquals(HttpPost.class, capt.getValue().getClass());
|
||||||
|
HttpPost post = (HttpPost) capt.getValue();
|
||||||
|
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/$validate"));
|
||||||
|
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
|
||||||
|
assertNotNull(response.getOperationOutcome());
|
||||||
|
assertEquals("ALL GOOD", ((OperationOutcome)response.getOperationOutcome()).getIssueFirstRep().getDiagnostics());
|
||||||
|
assertNull(response.getResource());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVRead() throws Exception {
|
public void testVRead() throws Exception {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.mockito.ArgumentCaptor;
|
||||||
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.model.base.resource.BaseOperationOutcome;
|
|
||||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||||
import ca.uhn.fhir.rest.annotation.Read;
|
import ca.uhn.fhir.rest.annotation.Read;
|
||||||
import ca.uhn.fhir.rest.api.Constants;
|
import ca.uhn.fhir.rest.api.Constants;
|
||||||
|
@ -144,7 +143,7 @@ public class ExceptionHandlingTest {
|
||||||
assertThat(e.getMessage(), StringContains.containsString("HTTP 500 Internal Error"));
|
assertThat(e.getMessage(), StringContains.containsString("HTTP 500 Internal Error"));
|
||||||
assertThat(e.getMessage(), StringContains.containsString("Help I'm a bug"));
|
assertThat(e.getMessage(), StringContains.containsString("Help I'm a bug"));
|
||||||
assertNotNull(e.getOperationOutcome());
|
assertNotNull(e.getOperationOutcome());
|
||||||
assertEquals("Help I'm a bug", ((BaseOperationOutcome) e.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue());
|
assertEquals("Help I'm a bug", ((OperationOutcome) e.getOperationOutcome()).getIssueFirstRep().getDiagnosticsElement().getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -170,7 +169,7 @@ public class ExceptionHandlingTest {
|
||||||
assertThat(e.getMessage(), StringContains.containsString("HTTP 500 Internal Error"));
|
assertThat(e.getMessage(), StringContains.containsString("HTTP 500 Internal Error"));
|
||||||
assertThat(e.getMessage(), StringContains.containsString("Help I'm a bug"));
|
assertThat(e.getMessage(), StringContains.containsString("Help I'm a bug"));
|
||||||
assertNotNull(e.getOperationOutcome());
|
assertNotNull(e.getOperationOutcome());
|
||||||
assertEquals("Help I'm a bug", ((BaseOperationOutcome) e.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue());
|
assertEquals("Help I'm a bug", ((OperationOutcome) e.getOperationOutcome()).getIssueFirstRep().getDiagnosticsElement().getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ import ca.uhn.fhir.util.TestUtil;
|
||||||
public class IncludedResourceStitchingClientTest {
|
public class IncludedResourceStitchingClientTest {
|
||||||
|
|
||||||
private FhirContext ctx;
|
private FhirContext ctx;
|
||||||
private HttpClient httpClient;
|
private HttpClient myHttpClient;
|
||||||
private HttpResponse httpResponse;
|
private HttpResponse myHttpResponse;
|
||||||
|
|
||||||
// atom-document-large.xml
|
// atom-document-large.xml
|
||||||
|
|
||||||
|
@ -42,20 +42,20 @@ public class IncludedResourceStitchingClientTest {
|
||||||
public void before() {
|
public void before() {
|
||||||
ctx = FhirContext.forR4();
|
ctx = FhirContext.forR4();
|
||||||
|
|
||||||
httpClient = mock(HttpClient.class, new ReturnsDeepStubs());
|
myHttpClient = mock(HttpClient.class, new ReturnsDeepStubs());
|
||||||
ctx.getRestfulClientFactory().setHttpClient(httpClient);
|
ctx.getRestfulClientFactory().setHttpClient(myHttpClient);
|
||||||
ctx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
|
ctx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
|
||||||
|
|
||||||
httpResponse = mock(HttpResponse.class, new ReturnsDeepStubs());
|
myHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWithParam() throws Exception {
|
public void testWithParam() throws Exception {
|
||||||
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
|
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
|
||||||
when(httpClient.execute(capt.capture())).thenReturn(httpResponse);
|
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
|
||||||
when(httpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
|
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
|
||||||
when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8"));
|
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8"));
|
||||||
when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(createBundle()), Charset.forName("UTF-8")));
|
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(createBundle()), Charset.forName("UTF-8")));
|
||||||
|
|
||||||
IGenericClient client = ctx.newRestfulGenericClient( "http://foo");
|
IGenericClient client = ctx.newRestfulGenericClient( "http://foo");
|
||||||
Bundle bundle = client
|
Bundle bundle = client
|
||||||
|
@ -84,10 +84,10 @@ public class IncludedResourceStitchingClientTest {
|
||||||
@Test
|
@Test
|
||||||
public void testWithDeclaredExtension() throws Exception {
|
public void testWithDeclaredExtension() throws Exception {
|
||||||
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
|
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
|
||||||
when(httpClient.execute(capt.capture())).thenReturn(httpResponse);
|
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
|
||||||
when(httpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
|
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
|
||||||
when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8"));
|
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8"));
|
||||||
when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(createLinkedBundle()), Charset.forName("UTF-8")));
|
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(createLinkedBundle()), Charset.forName("UTF-8")));
|
||||||
|
|
||||||
IGenericClient client = ctx.newRestfulGenericClient( "http://foo");
|
IGenericClient client = ctx.newRestfulGenericClient( "http://foo");
|
||||||
Bundle bundle = client.search().forResource(IncludeTest.ExtPatient.class).returnBundle(Bundle.class).execute();
|
Bundle bundle = client.search().forResource(IncludeTest.ExtPatient.class).returnBundle(Bundle.class).execute();
|
||||||
|
@ -115,12 +115,25 @@ public class IncludedResourceStitchingClientTest {
|
||||||
|
|
||||||
Patient p1 = new Patient();
|
Patient p1 = new Patient();
|
||||||
p1.addIdentifier().setValue("p1");
|
p1.addIdentifier().setValue("p1");
|
||||||
|
p1.addExtension().setUrl("http://foo#secondOrg").setValue(new Reference("Organization/o1"));
|
||||||
bundle.addEntry().setResource(p1);
|
bundle.addEntry().setResource(p1);
|
||||||
|
|
||||||
Patient p2 = new Patient();
|
Patient p2 = new Patient();
|
||||||
p2.addIdentifier().setValue("p1");
|
p2.addIdentifier().setValue("p2");
|
||||||
|
p2.addExtension().setUrl("http://foo#secondOrg").setValue(new Reference("Organization/o1"));
|
||||||
bundle.addEntry().setResource(p2);
|
bundle.addEntry().setResource(p2);
|
||||||
|
|
||||||
|
Organization o1 = new Organization();
|
||||||
|
o1.setId("o1");
|
||||||
|
o1.setName("o1");
|
||||||
|
o1.getPartOf().setReference("Organization/o2");
|
||||||
|
bundle.addEntry().setResource(o1);
|
||||||
|
|
||||||
|
Organization o2 = new Organization();
|
||||||
|
o2.setId("o2");
|
||||||
|
o2.setName("o2");
|
||||||
|
bundle.addEntry().setResource(o2);
|
||||||
|
|
||||||
return ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle);
|
return ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle);
|
||||||
|
|
||||||
// //@formatter:off
|
// //@formatter:off
|
||||||
|
@ -200,65 +213,85 @@ public class IncludedResourceStitchingClientTest {
|
||||||
|
|
||||||
|
|
||||||
private String createBundle() {
|
private String createBundle() {
|
||||||
//@formatter:on
|
Bundle bundle = new Bundle();
|
||||||
return "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" +
|
|
||||||
" <title/>\n" +
|
Patient p1 = new Patient();
|
||||||
" <id>f051fd86-4daa-48da-80f7-5a0443bf6f11</id>\n" +
|
p1.addIdentifier().setValue("p1");
|
||||||
" <link rel=\"self\" href=\"http://localhost:49627/Patient?_query=extInclude&_pretty=true\"/>\n" +
|
p1.addExtension().setUrl("http://foo").setValue(new Reference("Organization/o1"));
|
||||||
" <link rel=\"fhir-base\" href=\"http://localhost:49627\"/>\n" +
|
bundle.addEntry().setResource(p1);
|
||||||
" <os:totalResults xmlns:os=\"http://a9.com/-/spec/opensearch/1.1/\">2</os:totalResults>\n" +
|
|
||||||
" <author>\n" +
|
Patient p2 = new Patient();
|
||||||
" <name>HAPI FHIR Server</name>\n" +
|
p2.addIdentifier().setValue("p2");
|
||||||
" </author>\n" +
|
p2.addExtension().setUrl("http://foo#secondOrg").setValue(new Reference("Organization/o1"));
|
||||||
" <entry>\n" +
|
bundle.addEntry().setResource(p2);
|
||||||
" <title>Patient p1</title>\n" +
|
|
||||||
" <id>http://localhost:49627/Patient/p1</id>\n" +
|
Organization o1 = new Organization();
|
||||||
" <published>2014-08-05T15:22:08-04:00</published>\n" +
|
o1.setId("o1");
|
||||||
" <link rel=\"self\" href=\"http://localhost:49627/Patient/p1\"/>\n" +
|
o1.setName("o1");
|
||||||
" <content type=\"text/xml\">\n" +
|
o1.getPartOf().setReference("Organization/o2");
|
||||||
" <Patient xmlns=\"http://hl7.org/fhir\">\n" +
|
bundle.addEntry().setResource(o1);
|
||||||
" <extension url=\"http://foo\">\n" +
|
|
||||||
" <valueResource>\n" +
|
return ctx.newXmlParser().encodeResourceToString(bundle);
|
||||||
" <reference value=\"Organization/o1\"/>\n" +
|
|
||||||
" </valueResource>\n" +
|
// //@formatter:on
|
||||||
" </extension>\n" +
|
// return "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" +
|
||||||
" <identifier>\n" +
|
// " <title/>\n" +
|
||||||
" <label value=\"p1\"/>\n" +
|
// " <id>f051fd86-4daa-48da-80f7-5a0443bf6f11</id>\n" +
|
||||||
" </identifier>\n" +
|
// " <link rel=\"self\" href=\"http://localhost:49627/Patient?_query=extInclude&_pretty=true\"/>\n" +
|
||||||
" </Patient>\n" +
|
// " <link rel=\"fhir-base\" href=\"http://localhost:49627\"/>\n" +
|
||||||
" </content>\n" +
|
// " <os:totalResults xmlns:os=\"http://a9.com/-/spec/opensearch/1.1/\">2</os:totalResults>\n" +
|
||||||
" </entry>\n" +
|
// " <author>\n" +
|
||||||
" <entry>\n" +
|
// " <name>HAPI FHIR Server</name>\n" +
|
||||||
" <title>Patient p2</title>\n" +
|
// " </author>\n" +
|
||||||
" <id>http://localhost:49627/Patient/p2</id>\n" +
|
// " <entry>\n" +
|
||||||
" <published>2014-08-05T15:22:08-04:00</published>\n" +
|
// " <title>Patient p1</title>\n" +
|
||||||
" <link rel=\"self\" href=\"http://localhost:49627/Patient/p2\"/>\n" +
|
// " <id>http://localhost:49627/Patient/p1</id>\n" +
|
||||||
" <content type=\"text/xml\">\n" +
|
// " <published>2014-08-05T15:22:08-04:00</published>\n" +
|
||||||
" <Patient xmlns=\"http://hl7.org/fhir\">\n" +
|
// " <link rel=\"self\" href=\"http://localhost:49627/Patient/p1\"/>\n" +
|
||||||
" <extension url=\"http://foo\">\n" +
|
// " <content type=\"text/xml\">\n" +
|
||||||
" <valueResource>\n" +
|
// " <Patient xmlns=\"http://hl7.org/fhir\">\n" +
|
||||||
" <reference value=\"Organization/o1\"/>\n" +
|
// " <extension url=\"http://foo\">\n" +
|
||||||
" </valueResource>\n" +
|
// " <valueResource>\n" +
|
||||||
" </extension>\n" +
|
// " <reference value=\"Organization/o1\"/>\n" +
|
||||||
" <identifier>\n" +
|
// " </valueResource>\n" +
|
||||||
" <label value=\"p2\"/>\n" +
|
// " </extension>\n" +
|
||||||
" </identifier>\n" +
|
// " <identifier>\n" +
|
||||||
" </Patient>\n" +
|
// " <label value=\"p1\"/>\n" +
|
||||||
" </content>\n" +
|
// " </identifier>\n" +
|
||||||
" </entry>\n" +
|
// " </Patient>\n" +
|
||||||
" <entry>\n" +
|
// " </content>\n" +
|
||||||
" <title>Organization o1</title>\n" +
|
// " </entry>\n" +
|
||||||
" <id>http://localhost:49627/Organization/o1</id>\n" +
|
// " <entry>\n" +
|
||||||
" <published>2014-08-05T15:22:08-04:00</published>\n" +
|
// " <title>Patient p2</title>\n" +
|
||||||
" <link rel=\"self\" href=\"http://localhost:49627/Organization/o1\"/>\n" +
|
// " <id>http://localhost:49627/Patient/p2</id>\n" +
|
||||||
" <content type=\"text/xml\">\n" +
|
// " <published>2014-08-05T15:22:08-04:00</published>\n" +
|
||||||
" <Organization xmlns=\"http://hl7.org/fhir\">\n" +
|
// " <link rel=\"self\" href=\"http://localhost:49627/Patient/p2\"/>\n" +
|
||||||
" <name value=\"o1\"/>\n" +
|
// " <content type=\"text/xml\">\n" +
|
||||||
" </Organization>\n" +
|
// " <Patient xmlns=\"http://hl7.org/fhir\">\n" +
|
||||||
" </content>\n" +
|
// " <extension url=\"http://foo\">\n" +
|
||||||
" </entry>\n" +
|
// " <valueResource>\n" +
|
||||||
"</feed>";
|
// " <reference value=\"Organization/o1\"/>\n" +
|
||||||
//@formatter:off
|
// " </valueResource>\n" +
|
||||||
|
// " </extension>\n" +
|
||||||
|
// " <identifier>\n" +
|
||||||
|
// " <label value=\"p2\"/>\n" +
|
||||||
|
// " </identifier>\n" +
|
||||||
|
// " </Patient>\n" +
|
||||||
|
// " </content>\n" +
|
||||||
|
// " </entry>\n" +
|
||||||
|
// " <entry>\n" +
|
||||||
|
// " <title>Organization o1</title>\n" +
|
||||||
|
// " <id>http://localhost:49627/Organization/o1</id>\n" +
|
||||||
|
// " <published>2014-08-05T15:22:08-04:00</published>\n" +
|
||||||
|
// " <link rel=\"self\" href=\"http://localhost:49627/Organization/o1\"/>\n" +
|
||||||
|
// " <content type=\"text/xml\">\n" +
|
||||||
|
// " <Organization xmlns=\"http://hl7.org/fhir\">\n" +
|
||||||
|
// " <name value=\"o1\"/>\n" +
|
||||||
|
// " </Organization>\n" +
|
||||||
|
// " </content>\n" +
|
||||||
|
// " </entry>\n" +
|
||||||
|
// "</feed>";
|
||||||
|
// //@formatter:off
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,9 +84,9 @@ public class TransactionClientTest {
|
||||||
ourLog.info(ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle));
|
ourLog.info(ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle));
|
||||||
|
|
||||||
assertEquals(2, bundle.getEntry().size());
|
assertEquals(2, bundle.getEntry().size());
|
||||||
assertEquals("Patient/testPersistWithSimpleLinkP01", bundle.getEntry().get(0).getIdElement().getValue());
|
assertEquals("Patient/testPersistWithSimpleLinkP01", bundle.getEntry().get(0).getResource().getIdElement().getValue());
|
||||||
|
|
||||||
assertTrue(bundle.getEntry().get(1).getId().isEmpty());
|
assertTrue(bundle.getEntry().get(1).getResource().getIdElement().isEmpty());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public class TransactionClientTest {
|
||||||
obs.setSubject(new Reference("Patient/testPersistWithSimpleLinkP01"));
|
obs.setSubject(new Reference("Patient/testPersistWithSimpleLinkP01"));
|
||||||
|
|
||||||
Bundle transactionBundle = new Bundle();
|
Bundle transactionBundle = new Bundle();
|
||||||
transactionBundle.addEntry().setResource(patient);
|
transactionBundle.addEntry().setResource(patient).setFullUrl("http://foo/Patient/testPersistWithSimpleLinkP01");
|
||||||
transactionBundle.addEntry().setResource(obs);
|
transactionBundle.addEntry().setResource(obs);
|
||||||
|
|
||||||
IBundleClient client = ctx.newRestfulClient(IBundleClient.class, "http://foo");
|
IBundleClient client = ctx.newRestfulClient(IBundleClient.class, "http://foo");
|
||||||
|
@ -125,7 +125,7 @@ public class TransactionClientTest {
|
||||||
assertEquals(2, bundle.getEntry().size());
|
assertEquals(2, bundle.getEntry().size());
|
||||||
assertEquals("http://foo/Patient/testPersistWithSimpleLinkP01", bundle.getEntry().get(0).getResource().getIdElement().getValue());
|
assertEquals("http://foo/Patient/testPersistWithSimpleLinkP01", bundle.getEntry().get(0).getResource().getIdElement().getValue());
|
||||||
|
|
||||||
assertTrue(bundle.getEntry().get(1).getId().isEmpty());
|
assertTrue(bundle.getEntry().get(1).getResource().getIdElement().isEmpty());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class ZipGenerator {
|
||||||
|
|
||||||
public void addFiles(String actualDir, String statedDir, String ext, String noExt) throws FileNotFoundException, IOException {
|
public void addFiles(String actualDir, String statedDir, String ext, String noExt) throws FileNotFoundException, IOException {
|
||||||
byte data[] = new byte[BUFFER];
|
byte data[] = new byte[BUFFER];
|
||||||
statedDir.replace("\\", "/");
|
statedDir = statedDir.replace("\\", "/");
|
||||||
File f = new CSFile(actualDir);
|
File f = new CSFile(actualDir);
|
||||||
|
|
||||||
String files[] = f.list();
|
String files[] = f.list();
|
||||||
|
@ -136,7 +136,7 @@ public class ZipGenerator {
|
||||||
|
|
||||||
public void addFilesFiltered(String actualDir, String statedDir, String ext, String[] noExt) throws FileNotFoundException, IOException {
|
public void addFilesFiltered(String actualDir, String statedDir, String ext, String[] noExt) throws FileNotFoundException, IOException {
|
||||||
byte data[] = new byte[BUFFER];
|
byte data[] = new byte[BUFFER];
|
||||||
statedDir.replace("\\", "/");
|
statedDir = statedDir.replace("\\", "/");
|
||||||
File f = new CSFile(actualDir);
|
File f = new CSFile(actualDir);
|
||||||
|
|
||||||
String files[] = f.list();
|
String files[] = f.list();
|
||||||
|
|
|
@ -167,7 +167,7 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
|
||||||
String html = Processor.process("[$PROFILE$]: extended\n" + md);
|
String html = Processor.process("[$PROFILE$]: extended\n" + md);
|
||||||
pieces.addAll(htmlToParagraphPieces(html));
|
pieces.addAll(htmlToParagraphPieces(html));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e = e;
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
66
pom.xml
66
pom.xml
|
@ -368,8 +368,8 @@
|
||||||
<!-- Dependency Versions -->
|
<!-- Dependency Versions -->
|
||||||
<derby_version>10.13.1.1</derby_version>
|
<derby_version>10.13.1.1</derby_version>
|
||||||
<jersey_version>2.25.1</jersey_version>
|
<jersey_version>2.25.1</jersey_version>
|
||||||
<jetty_version>9.4.5.v20170502</jetty_version>
|
<jetty_version>9.4.6.v20170531</jetty_version>
|
||||||
<hibernate_version>5.2.9.Final</hibernate_version>
|
<hibernate_version>5.2.10.Final</hibernate_version>
|
||||||
<hibernate_validator_version>5.4.1.Final</hibernate_validator_version>
|
<hibernate_validator_version>5.4.1.Final</hibernate_validator_version>
|
||||||
<!-- Update lucene version when you update hibernate-search version -->
|
<!-- Update lucene version when you update hibernate-search version -->
|
||||||
<hibernate_search_version>5.7.0.Final</hibernate_search_version>
|
<hibernate_search_version>5.7.0.Final</hibernate_search_version>
|
||||||
|
@ -378,10 +378,9 @@
|
||||||
<maven_license_plugin_version>1.8</maven_license_plugin_version>
|
<maven_license_plugin_version>1.8</maven_license_plugin_version>
|
||||||
<maven_source_plugin_version>2.4</maven_source_plugin_version>
|
<maven_source_plugin_version>2.4</maven_source_plugin_version>
|
||||||
<phloc_schematron_version>2.7.1</phloc_schematron_version>
|
<phloc_schematron_version>2.7.1</phloc_schematron_version>
|
||||||
<phloc_commons_version>4.4.6</phloc_commons_version>
|
<phloc_commons_version>4.4.11</phloc_commons_version>
|
||||||
<spring_version>4.3.7.RELEASE</spring_version>
|
<spring_version>4.3.10.RELEASE</spring_version>
|
||||||
<thymeleaf-version>3.0.2.RELEASE</thymeleaf-version>
|
<thymeleaf-version>3.0.7.RELEASE</thymeleaf-version>
|
||||||
<xmlunit_version>1.6</xmlunit_version>
|
|
||||||
|
|
||||||
<!-- We are aiming to still work on a very old version of SLF4j even though we depend on the newest, just to be nice to users of the API. This version is tested in the hapi-fhir-cobertura. -->
|
<!-- We are aiming to still work on a very old version of SLF4j even though we depend on the newest, just to be nice to users of the API. This version is tested in the hapi-fhir-cobertura. -->
|
||||||
<slf4j_target_version>1.6.0</slf4j_target_version>
|
<slf4j_target_version>1.6.0</slf4j_target_version>
|
||||||
|
@ -400,7 +399,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.qos.logback</groupId>
|
<groupId>ch.qos.logback</groupId>
|
||||||
<artifactId>logback-classic</artifactId>
|
<artifactId>logback-classic</artifactId>
|
||||||
<version>1.2.2</version>
|
<version>1.2.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.atlassian.commonmark</groupId>
|
<groupId>com.atlassian.commonmark</groupId>
|
||||||
|
@ -420,12 +419,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.errorprone</groupId>
|
<groupId>com.google.errorprone</groupId>
|
||||||
<artifactId>error_prone_core</artifactId>
|
<artifactId>error_prone_core</artifactId>
|
||||||
<version>2.0.9</version>
|
<version>2.0.21</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>21.0</version>
|
<version>22.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.phloc</groupId>
|
<groupId>com.phloc</groupId>
|
||||||
|
@ -445,7 +444,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-cli</groupId>
|
<groupId>commons-cli</groupId>
|
||||||
<artifactId>commons-cli</artifactId>
|
<artifactId>commons-cli</artifactId>
|
||||||
<version>1.3.1</version>
|
<version>1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-codec</groupId>
|
<groupId>commons-codec</groupId>
|
||||||
|
@ -497,7 +496,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>2.8.0</version>
|
<version>2.8.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.mail</groupId>
|
<groupId>javax.mail</groupId>
|
||||||
|
@ -560,12 +559,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.saxon</groupId>
|
<groupId>net.sf.saxon</groupId>
|
||||||
<artifactId>Saxon-HE</artifactId>
|
<artifactId>Saxon-HE</artifactId>
|
||||||
|
<!-- <version>9.8.0-3</version> -->
|
||||||
<version>9.5.1-5</version>
|
<version>9.5.1-5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.ttddyy</groupId>
|
<groupId>net.ttddyy</groupId>
|
||||||
<artifactId>datasource-proxy</artifactId>
|
<artifactId>datasource-proxy</artifactId>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.antlr</groupId>
|
<groupId>org.antlr</groupId>
|
||||||
|
@ -580,7 +580,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.derby</groupId>
|
<groupId>org.apache.derby</groupId>
|
||||||
|
@ -600,7 +600,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
<version>4.5.2</version>
|
<version>4.5.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
@ -610,7 +610,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpcore</artifactId>
|
<artifactId>httpcore</artifactId>
|
||||||
<version>4.4.5</version>
|
<version>4.4.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.lucene</groupId>
|
<groupId>org.apache.lucene</groupId>
|
||||||
|
@ -645,7 +645,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven.wagon</groupId>
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
<artifactId>wagon-scm</artifactId>
|
<artifactId>wagon-scm</artifactId>
|
||||||
<version>2.10</version>
|
<version>2.12</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
|
@ -655,12 +655,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
<artifactId>maven-plugin-api</artifactId>
|
<artifactId>maven-plugin-api</artifactId>
|
||||||
<version>3.2.5</version>
|
<version>3.5.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-annotations</artifactId>
|
<artifactId>maven-plugin-annotations</artifactId>
|
||||||
<version>3.2</version>
|
<version>3.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.apache.velocity</groupId>
|
||||||
|
@ -672,20 +672,25 @@
|
||||||
<artifactId>velocity-tools</artifactId>
|
<artifactId>velocity-tools</artifactId>
|
||||||
<version>2.0</version>
|
<version>2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-compiler-api</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-compiler-javac</artifactId>
|
<artifactId>plexus-compiler-javac</artifactId>
|
||||||
<version>2.8.1</version>
|
<version>2.8.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-compiler-javac-errorprone</artifactId>
|
<artifactId>plexus-compiler-javac-errorprone</artifactId>
|
||||||
<version>2.8.1</version>
|
<version>2.8.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-utils</artifactId>
|
<artifactId>plexus-utils</artifactId>
|
||||||
<version>3.0.22</version>
|
<version>3.0.24</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.woodstox</groupId>
|
<groupId>org.codehaus.woodstox</groupId>
|
||||||
|
@ -745,7 +750,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.fusesource.jansi</groupId>
|
<groupId>org.fusesource.jansi</groupId>
|
||||||
<artifactId>jansi</artifactId>
|
<artifactId>jansi</artifactId>
|
||||||
<version>1.15</version>
|
<version>1.16</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.glassfish</groupId>
|
<groupId>org.glassfish</groupId>
|
||||||
|
@ -908,9 +913,9 @@
|
||||||
<version>${thymeleaf-version}</version>
|
<version>${thymeleaf-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xmlunit</groupId>
|
<groupId>org.xmlunit</groupId>
|
||||||
<artifactId>xmlunit</artifactId>
|
<artifactId>xmlunit-core</artifactId>
|
||||||
<version>1.6</version>
|
<version>2.4.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xpp3</groupId>
|
<groupId>xpp3</groupId>
|
||||||
|
@ -954,7 +959,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.1</version>
|
<version>3.6.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.7</source>
|
||||||
<target>1.7</target>
|
<target>1.7</target>
|
||||||
|
@ -974,15 +979,20 @@
|
||||||
<artifactId>error_prone_core</artifactId>
|
<artifactId>error_prone_core</artifactId>
|
||||||
<version>2.0.19</version>
|
<version>2.0.19</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-compiler-api</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-compiler-javac</artifactId>
|
<artifactId>plexus-compiler-javac</artifactId>
|
||||||
<version>2.8.1</version>
|
<version>2.8.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-compiler-javac-errorprone</artifactId>
|
<artifactId>plexus-compiler-javac-errorprone</artifactId>
|
||||||
<version>2.8.1</version>
|
<version>2.8.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
|
|
@ -7,6 +7,24 @@
|
||||||
</properties>
|
</properties>
|
||||||
<body>
|
<body>
|
||||||
<release version="3.0" date="TBD">
|
<release version="3.0" date="TBD">
|
||||||
|
<action type="add">
|
||||||
|
Bump the version of a few dependencies to the
|
||||||
|
latest versions (dependent HAPI modules listed in brackets):
|
||||||
|
<![CDATA[
|
||||||
|
<ul>
|
||||||
|
<li>Gson (JSON Parser): 2.8.0 -> 2.8.1</li>
|
||||||
|
<li>Commons-lang3 (Everywhere): 3.5 -> 3.6</li>
|
||||||
|
<!--<li>Saxon-HE (Validator): 9.5.1-5 -> 9.8.0-3</li>-->
|
||||||
|
<li>Apache HttpClient (FHIR Client): 4.5.2 -> 4.5.3</li>
|
||||||
|
<li>Apache HttpCore (FHIR Client): 4.4.5 -> 4.4.6</li>
|
||||||
|
<li>Phloc Commons (Schematron Validator): 4.4.6 -> 4.4.11</li>
|
||||||
|
<li>Hibernate (JPA): 5.2.9 -> 5.2.10</li>
|
||||||
|
<li>Spring (JPA): 4.3.7.RELEASE -> 4.3.10.RELEASE</li>
|
||||||
|
<li>Thymeleaf (Testpage Overlay): 3.0.2.RELEASE -> 3.0.7.RELEASE</li>
|
||||||
|
</ul>
|
||||||
|
]]>
|
||||||
|
</action>
|
||||||
|
|
||||||
<action type="fix">
|
<action type="fix">
|
||||||
hapi-fhir-client-okhttp project POM had dependencies on both
|
hapi-fhir-client-okhttp project POM had dependencies on both
|
||||||
hapi-fhir-structures-dstu2 and hapi-fhir-structures-dstu3, which
|
hapi-fhir-structures-dstu2 and hapi-fhir-structures-dstu3, which
|
||||||
|
|
Loading…
Reference in New Issue