From 1c05bcb29c37b01d75f0876ef746d02096c70c96 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 2 Jul 2014 15:24:29 -0400 Subject: [PATCH] Fix a number of unit tests --- .project | 6 + .settings/org.eclipse.core.resources.prefs | 2 + .settings/org.eclipse.m2e.core.prefs | 4 + hapi-fhir-base/.classpath | 4 +- hapi-fhir-base/.project | 4 +- .../org.eclipse.wst.validation.prefs | 2 + .../BaseOutcomeReturningMethodBinding.java | 4 +- .../ca/uhn/fhir/rest/server/Constants.java | 2 + .../fhir/rest/client/GenericClientTest.java | 2 +- .../uhn/fhir/rest/server/CompressionTest.java | 3 +- .../ca/uhn/fhir/rest/server/IncludeTest.java | 9 +- .../ca/uhn/fhir/rest/server/PagingTest.java | 23 +-- .../fhir/rest/server/PlainProviderTest.java | 10 +- .../rest/server/ReferenceParameterTest.java | 13 +- .../rest/server/ResfulServerMethodTest.java | 141 ++++++++++++------ .../fhir/rest/server/ServerFeaturesTest.java | 42 ++++-- .../ca/uhn/fhir/rest/server/SortTest.java | 15 +- .../fhir/rest/server/StringParameterTest.java | 29 ++-- .../uhn/fhir/rest/server/TagsServerTest.java | 27 ++-- .../uhn/fhir/rest/server/TransactionTest.java | 3 +- hapi-fhir-jpaserver-base/.classpath | 2 +- hapi-fhir-jpaserver-base/.project | 4 +- .../org.eclipse.wst.validation.prefs | 2 + hapi-fhir-jpaserver-base/pom.xml | 7 +- .../uhn/fhir/jpa/dao/FhirSystemDaoTest.java | 4 +- hapi-fhir-jpaserver-test/pom.xml | 12 ++ hapi-fhir-testpage-overlay/.classpath | 15 +- hapi-fhir-testpage-overlay/.project | 4 +- .../org.eclipse.core.resources.prefs | 1 + .../.settings/org.eclipse.jdt.core.prefs | 6 +- .../org.eclipse.wst.common.component | 3 +- hapi-tinder-test/.project | 33 ++-- .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.m2e.core.prefs | 4 + restful-server-example/pom.xml | 2 +- 35 files changed, 299 insertions(+), 147 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 hapi-fhir-base/.settings/org.eclipse.wst.validation.prefs create mode 100644 hapi-fhir-jpaserver-base/.settings/org.eclipse.wst.validation.prefs create mode 100644 hapi-tinder-test/.settings/org.eclipse.core.resources.prefs create mode 100644 hapi-tinder-test/.settings/org.eclipse.m2e.core.prefs diff --git a/.project b/.project index afaf82e1907..7f72f8d439e 100644 --- a/.project +++ b/.project @@ -10,8 +10,14 @@ + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature org.eclipse.jdt.core.javanature diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-fhir-base/.classpath b/hapi-fhir-base/.classpath index f0a60b623ce..550e3f2ae04 100644 --- a/hapi-fhir-base/.classpath +++ b/hapi-fhir-base/.classpath @@ -28,9 +28,9 @@ - + - + diff --git a/hapi-fhir-base/.project b/hapi-fhir-base/.project index a47a949c8a6..23adf1aaa35 100644 --- a/hapi-fhir-base/.project +++ b/hapi-fhir-base/.project @@ -16,12 +16,12 @@ - org.eclipse.m2e.core.maven2Builder + org.eclipse.wst.validation.validationbuilder - org.eclipse.wst.validation.validationbuilder + org.eclipse.m2e.core.maven2Builder diff --git a/hapi-fhir-base/.settings/org.eclipse.wst.validation.prefs b/hapi-fhir-base/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 00000000000..04cad8cb752 --- /dev/null +++ b/hapi-fhir-base/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java index ec9137b15af..7270843d6d6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java @@ -268,7 +268,7 @@ public abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBindin b.append("/"+Constants.PARAM_HISTORY+"/"); b.append(response.getVersionId().getValue()); } - theResponse.addHeader(Constants.HEADER_CONTENT_LOCATION, b.toString()); + theResponse.addHeader(Constants.HEADER_LOCATION, b.toString()); } private static void parseTagValue(TagList theTagList, String theCompleteHeaderValue, StringBuilder theBuffer) { @@ -399,7 +399,7 @@ public abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBindin } public static MethodOutcome process2xxResponse(FhirContext theContext, String theResourceName, int theResponseStatusCode, String theResponseMimeType, Reader theResponseReader, Map> theHeaders) { - List locationHeaders = theHeaders.get(Constants.HEADER_CONTENT_LOCATION_LC); + List locationHeaders = theHeaders.get(Constants.HEADER_LOCATION_LC); MethodOutcome retVal = new MethodOutcome(); if (locationHeaders != null && locationHeaders.size() > 0) { String locationHeader = locationHeaders.get(0); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/Constants.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/Constants.java index caad3ec392f..a5cf9bd5863 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/Constants.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/Constants.java @@ -85,6 +85,8 @@ public class Constants { public static final String HEADER_ACCEPT_ENCODING = "Accept-Encoding"; public static final String HEADER_CONTENT_ENCODING = "Content-Encoding"; public static final String ENCODING_GZIP = "gzip"; + public static final String HEADER_LOCATION = "Location"; + public static final String HEADER_LOCATION_LC = HEADER_LOCATION.toLowerCase(); static { diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java index eaf0fddb406..ae778efce57 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java @@ -73,7 +73,7 @@ public class GenericClientTest { ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 201, "OK")); - when(myHttpResponse.getAllHeaders()).thenReturn(new Header[] {new BasicHeader(Constants.HEADER_CONTENT_LOCATION, "/Patient/44/_history/22")}); + when(myHttpResponse.getAllHeaders()).thenReturn(new Header[] {new BasicHeader(Constants.HEADER_LOCATION, "/Patient/44/_history/22")}); when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(""), Charset.forName("UTF-8"))); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java index 8913dc0d740..e7421e6e6ab 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java @@ -86,7 +86,8 @@ public class CompressionTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1/_history/2"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); IdentifierDt dt = ourCtx.newXmlParser().parseResource(Patient.class,responseContent).getIdentifierFirstRep(); assertEquals("1", dt.getSystem().getValueAsString()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java index 8ba3bc64d72..967c8d28d5a 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java @@ -47,7 +47,8 @@ public class IncludeTest { public void testNoIncludes() throws Exception { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); @@ -61,7 +62,8 @@ public class IncludeTest { public void testOneInclude() throws Exception { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); @@ -76,7 +78,8 @@ public class IncludeTest { public void testTwoInclude() throws Exception { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo&_include=bar"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java index 9d9a33e9e66..5b4d4e453fc 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java @@ -54,7 +54,8 @@ public class PagingTest { { HttpGet httpGet = new HttpGet(base+ "/Patient?_format=xml&_pretty=true"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = ourContext.newXmlParser().parseBundle(responseContent); assertEquals(5, bundle.getEntries().size()); @@ -67,7 +68,8 @@ public class PagingTest { { HttpGet httpGet = new HttpGet(link); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = ourContext.newXmlParser().parseBundle(responseContent); assertEquals(5, bundle.getEntries().size()); @@ -90,7 +92,8 @@ public class PagingTest { { HttpGet httpGet = new HttpGet(base + '?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=8&" + Constants.PARAM_COUNT + "=5&_format=xml&_pretty=true"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = ourContext.newXmlParser().parseBundle(responseContent); assertEquals(2, bundle.getEntries().size()); @@ -114,28 +117,30 @@ public class PagingTest { { HttpGet httpGet = new HttpGet(base+ "/Patient?_count=2"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = ourContext.newXmlParser().parseBundle(responseContent); assertEquals(2, bundle.getEntries().size()); assertEquals("0", bundle.getEntries().get(0).getId().getIdPart()); assertEquals("1", bundle.getEntries().get(1).getId().getIdPart()); - assertEquals(base + '?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=2&" + Constants.PARAM_COUNT + "=2", bundle.getLinkNext().getValue()); + assertEquals(base + '?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=2&" + Constants.PARAM_COUNT + "=2&_format=xml", bundle.getLinkNext().getValue()); assertNull(bundle.getLinkPrevious().getValue()); link=bundle.getLinkNext().getValue(); } { HttpGet httpGet = new HttpGet(link); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = ourContext.newXmlParser().parseBundle(responseContent); assertEquals(2, bundle.getEntries().size()); assertEquals("2", bundle.getEntries().get(0).getId().getIdPart()); assertEquals("3", bundle.getEntries().get(1).getId().getIdPart()); - assertEquals(base + '?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=4&" + Constants.PARAM_COUNT + "=2", bundle.getLinkNext().getValue()); - assertEquals(base + '/'+'?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=2&" + Constants.PARAM_COUNT + "=2", bundle.getLinkSelf().getValue()); - assertEquals(base + '?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=0&" + Constants.PARAM_COUNT + "=2", bundle.getLinkPrevious().getValue()); + assertEquals(base + '?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=4&" + Constants.PARAM_COUNT + "=2&_format=xml", bundle.getLinkNext().getValue()); + assertEquals(base + '/'+'?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=2&" + Constants.PARAM_COUNT + "=2&_format=xml", bundle.getLinkSelf().getValue()); + assertEquals(base + '?'+Constants.PARAM_PAGINGACTION + "=ABCD&" + Constants.PARAM_PAGINGOFFSET + "=0&" + Constants.PARAM_COUNT + "=2&_format=xml", bundle.getLinkPrevious().getValue()); } } diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java index 966fa2388f6..05943f75700 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java @@ -69,6 +69,7 @@ public class PlainProviderTest { PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); myClient = builder.build(); @@ -90,6 +91,7 @@ public class PlainProviderTest { HttpResponse status = myClient.execute(httpGet); String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -102,6 +104,8 @@ public class PlainProviderTest { assertEquals(uri, bundle.getLinkSelf().getValue()); assertEquals(baseUri, bundle.getLinkBase().getValue()); + + httpGet.releaseConnection(); } @Test @@ -114,6 +118,7 @@ public class PlainProviderTest { HttpResponse status = myClient.execute(new HttpGet(baseUri + "/_history?_since=2012-01-02T00%3A01%3A02&_count=12")); String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = myCtx.newXmlParser().parseBundle(responseContent); @@ -124,14 +129,16 @@ public class PlainProviderTest { status = myClient.execute(new HttpGet(baseUri + "/_history?&_count=12")); responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); assertEquals(200, status.getStatusLine().getStatusCode()); bundle = myCtx.newXmlParser().parseBundle(responseContent); assertEquals(3, bundle.getEntries().size()); assertNull(provider.myLastSince.getValueAsString()); assertThat(provider.myLastCount.getValueAsString(), IsEqual.equalTo("12")); - + status =myClient.execute(new HttpGet(baseUri + "/_history?_since=2012-01-02T00%3A01%3A02")); responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); assertEquals(200, status.getStatusLine().getStatusCode()); bundle = myCtx.newXmlParser().parseBundle(responseContent); assertEquals(3, bundle.getEntries().size()); @@ -140,6 +147,7 @@ public class PlainProviderTest { status =myClient.execute(new HttpGet(baseUri + "/_history")); responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); assertEquals(200, status.getStatusLine().getStatusCode()); bundle = myCtx.newXmlParser().parseBundle(responseContent); assertEquals(3, bundle.getEntries().size()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java index 333f5659ffe..adc6efabf7c 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java @@ -48,7 +48,9 @@ public class ReferenceParameterTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?" + Patient.SP_PROVIDER+"=123"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); List entries = new FhirContext().newXmlParser().parseBundle(responseContent).getEntries(); assertEquals(1, entries.size()); @@ -64,7 +66,8 @@ public class ReferenceParameterTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?" + Patient.SP_PROVIDER+":Organization=123"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); List entries = new FhirContext().newXmlParser().parseBundle(responseContent).getEntries(); assertEquals(1, entries.size()); @@ -79,7 +82,8 @@ public class ReferenceParameterTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?" + Patient.SP_PROVIDER+":Organization.name=123"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); List entries = new FhirContext().newXmlParser().parseBundle(responseContent).getEntries(); assertEquals(1, entries.size()); @@ -95,7 +99,8 @@ public class ReferenceParameterTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?" + Patient.SP_PROVIDER+".name=123"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); List entries = new FhirContext().newXmlParser().parseBundle(responseContent).getEntries(); assertEquals(1, entries.size()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java index f4c1378525a..0d15937ba76 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java @@ -103,7 +103,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/DiagnosticReport?throw404=true"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(404, status.getStatusLine().getStatusCode()); @@ -123,10 +124,11 @@ public class ResfulServerMethodTest { HttpResponse status = ourClient.execute(httpPost); String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info("Response was:\n{}", responseContent); assertEquals(201, status.getStatusLine().getStatusCode()); - assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("Location").getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("location").getValue()); } @@ -143,11 +145,12 @@ public class ResfulServerMethodTest { HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(201, status.getStatusLine().getStatusCode()); - assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("Location").getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("location").getValue()); } @@ -162,7 +165,8 @@ public class ResfulServerMethodTest { HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(422, status.getStatusLine().getStatusCode()); @@ -183,7 +187,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?dateRange=%3E%3D2011-01-01&dateRange=%3C%3D2021-01-01"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -200,7 +205,8 @@ public class ResfulServerMethodTest { HttpDelete httpGet = new HttpDelete("http://localhost:" + ourPort + "/Patient/1234"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -230,7 +236,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?withIncludes=include1&_include=include2&_include=include3"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = ourCtx.newXmlParser().parseBundle(responseContent); BundleEntry entry0 = bundle.getEntries().get(0); @@ -239,7 +246,8 @@ public class ResfulServerMethodTest { httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?withIncludes=include1&_include=include2&_include=include3&_format=json"); status = ourClient.execute(httpGet); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); ourLog.info(responseContent); bundle = ourCtx.newJsonParser().parseBundle(responseContent); @@ -260,7 +268,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1?_format=json"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -284,7 +293,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1?_format=xml"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -304,7 +314,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -318,7 +329,8 @@ public class ResfulServerMethodTest { httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/2"); status = ourClient.execute(httpGet); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.debug("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -332,7 +344,8 @@ public class ResfulServerMethodTest { httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/9999999"); status = ourClient.execute(httpGet); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.debug("Response was:\n{}", responseContent); assertEquals(404, status.getStatusLine().getStatusCode()); @@ -350,7 +363,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1/_history/999"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -366,7 +380,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/metadata"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + // ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -401,7 +416,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/999/_history"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(500, status.getStatusLine().getStatusCode()); @@ -410,7 +426,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/998/_history"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(500, status.getStatusLine().getStatusCode()); @@ -437,7 +454,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/222/_history"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -486,7 +504,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/_history"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -537,7 +556,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/AdverseReaction/223"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(Constants.STATUS_HTTP_400_BAD_REQUEST, status.getStatusLine().getStatusCode()); @@ -550,7 +570,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/AdverseReaction"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -561,7 +582,8 @@ public class ResfulServerMethodTest { HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/AdverseReaction/_search"); status = ourClient.execute(httpPost); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -577,7 +599,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Profile?"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + // ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -594,7 +617,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?dob=2011-01-02"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -613,7 +637,8 @@ public class ResfulServerMethodTest { httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?dob=%3E%3D2011-01-02"); status = ourClient.execute(httpGet); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -633,7 +658,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/_search?dob=2011-01-02"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -650,7 +676,8 @@ public class ResfulServerMethodTest { HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/_search?dob=2011-01-02"); status = ourClient.execute(httpPost); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -670,7 +697,8 @@ public class ResfulServerMethodTest { httpPost.setEntity(new UrlEncodedFormEntity(urlParameters)); status = ourClient.execute(httpPost); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -690,7 +718,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?ids=urn:aaa%7Caaa,urn:bbb%7Cbbb"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -709,7 +738,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?identifier=urn:hapitest:mrns%7C00001"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -726,7 +756,8 @@ public class ResfulServerMethodTest { HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/_search?identifier=urn:hapitest:mrns%7C00001"); status = ourClient.execute(httpPost); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -743,7 +774,8 @@ public class ResfulServerMethodTest { httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/_search?identifier=urn:hapitest:mrns%7C00001"); status = ourClient.execute(httpGet); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -761,7 +793,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/?_query=someQueryNoParams"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -784,7 +817,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/?_query=someQueryOneParam¶m1=AAAA"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -804,7 +838,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/?quantityParam=%3E%3D123%7Cfoo%7Cbar"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -822,7 +857,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?withIncludes=include1&_include=include2&_include=include3"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -841,7 +877,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?withIncludes=include1&_include=include2&_include=include4"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(400, status.getStatusLine().getStatusCode()); @@ -853,7 +890,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?withIncludes=include1"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); // Make sure there is no crash @@ -866,7 +904,8 @@ public class ResfulServerMethodTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name1=AAA"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -885,7 +924,8 @@ public class ResfulServerMethodTest { httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name1=AAA&name2=BBB"); status = ourClient.execute(httpGet); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -910,14 +950,15 @@ public class ResfulServerMethodTest { HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); OperationOutcome oo = new FhirContext().newXmlParser().parseResource(OperationOutcome.class, responseContent); assertEquals("OODETAILS", oo.getIssueFirstRep().getDetails().getValue()); assertEquals(200, status.getStatusLine().getStatusCode()); - assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("Location").getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("location").getValue()); } @@ -933,7 +974,7 @@ public class ResfulServerMethodTest { HttpResponse status = ourClient.execute(httpPost); assertEquals(204, status.getStatusLine().getStatusCode()); - assertEquals("http://localhost:" + ourPort + "/DiagnosticReport/001/_history/002", status.getFirstHeader("Location").getValue()); + assertEquals("http://localhost:" + ourPort + "/DiagnosticReport/001/_history/002", status.getFirstHeader("location").getValue()); } @@ -1087,7 +1128,8 @@ public class ResfulServerMethodTest { HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertThat(responseContent, not(containsString("\n "))); @@ -1105,7 +1147,8 @@ public class ResfulServerMethodTest { status = ourClient.execute(httpPost); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(422, status.getStatusLine().getStatusCode()); @@ -1142,7 +1185,8 @@ public class ResfulServerMethodTest { HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertThat(responseContent, containsString("\n ")); } @@ -1153,7 +1197,8 @@ public class ResfulServerMethodTest { HttpDelete httpGet = new HttpDelete("http://localhost:" + ourPort + "/Patient/1234?_pretty=true"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java index 1b3a87d9af8..d93c327919b 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java @@ -52,7 +52,8 @@ public class ServerFeaturesTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertThat(responseContent, StringContains.containsString("\n ")); httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1"); httpGet.addHeader("Accept", Constants.CT_FHIR_JSON+ "; pretty=true"); status = ourClient.execute(httpGet); - responseContent = IOUtils.toString(status.getEntity().getContent()); + responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertThat(responseContent, StringContains.containsString("\",\n")); } @@ -160,7 +173,8 @@ public class ServerFeaturesTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/?_query=findPatientsWithNoIdSpecified"); httpGet.addHeader("Accept", Constants.CT_FHIR_XML+ "; pretty=true"); CloseableHttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(500, status.getStatusLine().getStatusCode()); assertThat(responseContent, StringContains.containsString("ID")); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SortTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SortTest.java index 16dc3ffe300..acd35aad358 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SortTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SortTest.java @@ -44,7 +44,8 @@ public class SortTest { public void testNoSort() throws Exception { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); @@ -59,7 +60,8 @@ public class SortTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_sort=given"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); @@ -72,7 +74,8 @@ public class SortTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_sort:asc=given"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); @@ -85,7 +88,8 @@ public class SortTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_sort:desc=given"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); @@ -103,7 +107,8 @@ public class SortTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_sort=given&_sort=family&_sort=name"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/StringParameterTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/StringParameterTest.java index 98d725981c6..01307ee1e2c 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/StringParameterTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/StringParameterTest.java @@ -42,7 +42,8 @@ public class StringParameterTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?str=aaa&_format=xml&_pretty=true"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(1, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } @@ -53,21 +54,26 @@ public class StringParameterTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?str=aaa"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(1, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?str=AAA"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(1, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?str=BBB"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(0, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } @@ -78,14 +84,16 @@ public class StringParameterTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?plain=aaa"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(1, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?plain=BBB"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(0, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } @@ -96,21 +104,24 @@ public class StringParameterTest { { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?str:exact=aaa"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(1, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?str:exact=AAA"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(0, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?str:exact=BBB"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(0, new FhirContext().newXmlParser().parseBundle(responseContent).getEntries().size()); } diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TagsServerTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TagsServerTest.java index 55405fadc46..08f9fe3854f 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TagsServerTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TagsServerTest.java @@ -66,7 +66,8 @@ public class TagsServerTest { httpPost.setEntity(new StringEntity(ourCtx.newJsonParser().encodeTagListToString(tagList), ContentType.create(EncodingEnum.JSON.getResourceContentType(), "UTF-8"))); HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -84,7 +85,8 @@ public class TagsServerTest { httpPost.setEntity(new StringEntity(ourCtx.newJsonParser().encodeTagListToString(tagList), ContentType.create(EncodingEnum.JSON.getResourceContentType(), "UTF-8"))); HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -110,7 +112,8 @@ public class TagsServerTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/_tags"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -124,7 +127,8 @@ public class TagsServerTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/_tags"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -141,7 +145,8 @@ public class TagsServerTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/111/_tags"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -158,7 +163,8 @@ public class TagsServerTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/111/_history/222/_tags"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -175,7 +181,8 @@ public class TagsServerTest { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Observation/111/_history/222/_tags"); HttpResponse status = ourClient.execute(httpGet); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -196,7 +203,8 @@ public class TagsServerTest { httpPost.setEntity(new StringEntity(ourCtx.newJsonParser().encodeTagListToString(tagList), ContentType.create(EncodingEnum.JSON.getResourceContentType(), "UTF-8"))); HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); @@ -214,7 +222,8 @@ public class TagsServerTest { httpPost.setEntity(new StringEntity(ourCtx.newJsonParser().encodeTagListToString(tagList), ContentType.create(EncodingEnum.JSON.getResourceContentType(), "UTF-8"))); HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TransactionTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TransactionTest.java index e9358e524e3..8ac820c1f0e 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TransactionTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TransactionTest.java @@ -70,7 +70,8 @@ public class TransactionTest { httpPost.addHeader("Accept", Constants.CT_ATOM_XML + "; pretty=true"); httpPost.setEntity(new StringEntity(bundleString, ContentType.create(Constants.CT_ATOM_XML, "UTF-8"))); HttpResponse status = ourClient.execute(httpPost); - String responseContent = IOUtils.toString(status.getEntity().getContent()); + String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); ourLog.info(responseContent); diff --git a/hapi-fhir-jpaserver-base/.classpath b/hapi-fhir-jpaserver-base/.classpath index 9d87089fa9a..caa2612fd4f 100644 --- a/hapi-fhir-jpaserver-base/.classpath +++ b/hapi-fhir-jpaserver-base/.classpath @@ -21,7 +21,7 @@ - + diff --git a/hapi-fhir-jpaserver-base/.project b/hapi-fhir-jpaserver-base/.project index 6aa0bca9a01..68612babd9f 100644 --- a/hapi-fhir-jpaserver-base/.project +++ b/hapi-fhir-jpaserver-base/.project @@ -17,12 +17,12 @@ - org.eclipse.m2e.core.maven2Builder + org.eclipse.wst.validation.validationbuilder - org.eclipse.wst.validation.validationbuilder + org.eclipse.m2e.core.maven2Builder diff --git a/hapi-fhir-jpaserver-base/.settings/org.eclipse.wst.validation.prefs b/hapi-fhir-jpaserver-base/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 00000000000..04cad8cb752 --- /dev/null +++ b/hapi-fhir-jpaserver-base/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index 4b28406546a..ddbc78aa540 100644 --- a/hapi-fhir-jpaserver-base/pom.xml +++ b/hapi-fhir-jpaserver-base/pom.xml @@ -46,7 +46,12 @@ ${derby_version} test - + + commons-dbcp + commons-dbcp + 1.4 + test + diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java index 4f3640b4e29..1288298f1f3 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java @@ -58,7 +58,7 @@ public class FhirSystemDaoTest { Patient patient = new Patient(); patient.addIdentifier("urn:system", "testHistory"); patient.addName().addFamily("Tester").addGiven("Joe"); - IdDt pid = ourPatientDao.create(patient).getId(); + IdDt pid = ourPatientDao.create(patient).getId().toVersionless(); Thread.sleep(10); IdDt newpid = ourPatientDao.update(patient, pid).getId(); @@ -76,7 +76,7 @@ public class FhirSystemDaoTest { assertEquals(newpid3, res.get(0).getId()); assertEquals(newpid2, res.get(1).getId()); assertEquals(newpid, res.get(2).getId()); - assertEquals(pid, res.get(3).getId()); + assertEquals(pid.toUnqualifiedVersionless(), res.get(3).getId().toUnqualifiedVersionless()); Location loc = new Location(); loc.getAddress().addLine("AAA"); diff --git a/hapi-fhir-jpaserver-test/pom.xml b/hapi-fhir-jpaserver-test/pom.xml index 333d83a8f19..8b53f133c94 100644 --- a/hapi-fhir-jpaserver-test/pom.xml +++ b/hapi-fhir-jpaserver-test/pom.xml @@ -36,6 +36,18 @@ ${junit_version} test + + org.hamcrest + hamcrest-all + ${hamcrest_version} + test + + + org.apache.derby + derby + ${derby_version} + test + com.google.guava guava diff --git a/hapi-fhir-testpage-overlay/.classpath b/hapi-fhir-testpage-overlay/.classpath index d72ff7912c8..1e35cc78281 100644 --- a/hapi-fhir-testpage-overlay/.classpath +++ b/hapi-fhir-testpage-overlay/.classpath @@ -6,11 +6,6 @@ - - - - - @@ -18,11 +13,6 @@ - - - - - @@ -32,5 +22,10 @@ + + + + + diff --git a/hapi-fhir-testpage-overlay/.project b/hapi-fhir-testpage-overlay/.project index 48f045944f4..adf73f36dcc 100644 --- a/hapi-fhir-testpage-overlay/.project +++ b/hapi-fhir-testpage-overlay/.project @@ -21,12 +21,12 @@ - org.eclipse.m2e.core.maven2Builder + org.eclipse.wst.validation.validationbuilder - org.eclipse.wst.validation.validationbuilder + org.eclipse.m2e.core.maven2Builder diff --git a/hapi-fhir-testpage-overlay/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-testpage-overlay/.settings/org.eclipse.core.resources.prefs index abdea9ac032..839d647eef8 100644 --- a/hapi-fhir-testpage-overlay/.settings/org.eclipse.core.resources.prefs +++ b/hapi-fhir-testpage-overlay/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-fhir-testpage-overlay/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-testpage-overlay/.settings/org.eclipse.jdt.core.prefs index 443e08599a2..69c31cd493c 100644 --- a/hapi-fhir-testpage-overlay/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-fhir-testpage-overlay/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.component b/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.component index ae394b16e2b..d088b0783b8 100644 --- a/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.component +++ b/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.component @@ -4,11 +4,10 @@ - uses - + diff --git a/hapi-tinder-test/.project b/hapi-tinder-test/.project index d205c972cb3..dea54c136b3 100644 --- a/hapi-tinder-test/.project +++ b/hapi-tinder-test/.project @@ -1,14 +1,23 @@ - hapi-tinder-test - NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - - - org.eclipse.jdt.core.javabuilder - - - - org.eclipse.jdt.core.javanature - - \ No newline at end of file + hapi-tinder-test + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/hapi-tinder-test/.settings/org.eclipse.core.resources.prefs b/hapi-tinder-test/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/hapi-tinder-test/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/hapi-tinder-test/.settings/org.eclipse.m2e.core.prefs b/hapi-tinder-test/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/hapi-tinder-test/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/restful-server-example/pom.xml b/restful-server-example/pom.xml index 9081c4b7b00..ede87571473 100644 --- a/restful-server-example/pom.xml +++ b/restful-server-example/pom.xml @@ -40,7 +40,7 @@ org.thymeleaf thymeleaf - 2.1.2.RELEASE + 2.1.3.RELEASE true