From 361c6e80c35c03553e021057cdb7099923e6f352 Mon Sep 17 00:00:00 2001 From: Bill Denton Date: Tue, 14 Jun 2016 15:52:47 -0700 Subject: [PATCH 1/3] additional OSGi dependencies --- hapi-fhir-osgi-core/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-osgi-core/pom.xml b/hapi-fhir-osgi-core/pom.xml index f11c34b0afb..601fc310ab0 100644 --- a/hapi-fhir-osgi-core/pom.xml +++ b/hapi-fhir-osgi-core/pom.xml @@ -132,10 +132,10 @@ - ${pom.artifactId} + ${project.artifactId} <_nouses>true - <_removeheaders>Built-By, Include-Resource, Private-Package + <_removeheaders>Built-By, Include-Resource, Private-Package, Require-Capability @@ -146,6 +146,7 @@ com.google.*;resolution:=optional;-remove-attribute:=version, com.phloc.commons;resolution:=optional;-remove-attribute:=version, com.phloc.*;resolution:=optional;-remove-attribute:=version, + javassist;-remove-attribute:=version, javax.*;-remove-attribute:=version, net.sf.saxon;resolution:=optional, org.apache.commons.*;-remove-attribute:=version, From 4e83b59d3ce3438b65e3ecd35936100d4b1bf3aa Mon Sep 17 00:00:00 2001 From: Bill Denton Date: Tue, 14 Jun 2016 19:30:06 -0700 Subject: [PATCH 2/3] make FhirServerImpl visible in OSGi --- .../main/java/ca/uhn/fhir/osgi/{impl => }/FhirServerImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) rename hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/{impl => }/FhirServerImpl.java (97%) diff --git a/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerImpl.java b/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java similarity index 97% rename from hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerImpl.java rename to hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java index fbf0da4dc3e..07d81c40c80 100644 --- a/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerImpl.java +++ b/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java @@ -1,4 +1,4 @@ -package ca.uhn.fhir.osgi.impl; +package ca.uhn.fhir.osgi; /* * #%L @@ -31,8 +31,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.osgi.FhirConfigurationException; -import ca.uhn.fhir.osgi.FhirServer; import ca.uhn.fhir.rest.server.RestfulServer; /** From 16df4566bfc0f3aec85ee7a4adf68fa8a7fc5c4c Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Fri, 24 Jun 2016 06:10:03 -0400 Subject: [PATCH 3/3] Add test for #390 --- .../uhn/fhir/parser/JsonParserDstu2Test.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java index a3dd22d3f33..b764ba5be39 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java @@ -92,6 +92,24 @@ public class JsonParserDstu2Test { assertThat(output, containsString("\"div\":\"
VALUE
\"")); } + /** + * See #390 + */ + @Test + public void testEncodeAndParseBundleWithNoEntries() { + ca.uhn.fhir.model.dstu2.resource.Bundle b = new ca.uhn.fhir.model.dstu2.resource.Bundle(); + b.setId("123"); + String encoded = ourCtx.newJsonParser().encodeResourceToString(b); + ourLog.info(encoded); + + assertThat(encoded, containsString("123")); + assertThat(encoded, not(containsString("entry"))); + + b = ourCtx.newJsonParser().parseResource(ca.uhn.fhir.model.dstu2.resource.Bundle.class, encoded); + assertEquals("123", b.getId().getIdPart()); + assertEquals(0, b.getEntry().size()); + } + @Test public void testEncodeNarrativeShouldIncludeNamespaceWithProcessingInstruction() {