diff --git a/.travis.yml b/.travis.yml index 4f84c403175..bec09c5d1cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,6 @@ before_script: script: # - mvn -e -B clean install && cd hapi-fhir-ra && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID clean test jacoco:report coveralls:report - - mvn -Dci=true -e -B -P ALLMODULES,NOPARALLEL,ERRORPRONE clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report - # - mvn -Dci=true -e -B -P ALLMODULES,MINPARALLEL,ERRORPRONE clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report +# - mvn -Dci=true -e -B -P ALLMODULES,NOPARALLEL,ERRORPRONE clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report + - mvn -Dci=true -e -B -P ALLMODULES,REDUCED_JPA_TESTS,ERRORPRONE clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report diff --git a/examples/src/main/java/example/Uploader.java b/examples/src/main/java/example/Uploader.java deleted file mode 100644 index 6803656f0b2..00000000000 --- a/examples/src/main/java/example/Uploader.java +++ /dev/null @@ -1,60 +0,0 @@ -package example; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.model.dstu2.resource.Bundle; -import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum; -import ca.uhn.fhir.model.dstu2.valueset.HTTPVerbEnum; -import ca.uhn.fhir.rest.client.api.IGenericClient; -import ca.uhn.fhir.util.ResourceReferenceInfo; -import org.apache.commons.io.FileUtils; -import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.IIdType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.util.Collection; -import java.util.List; - -public class Uploader { - private static final Logger ourLog = LoggerFactory.getLogger(Uploader.class); - public static void main(String[] theArgs) throws FileNotFoundException { - - FhirContext ctx = FhirContext.forDstu2(); - IGenericClient client = ctx.newRestfulGenericClient("http://localhost:8080/baseDstu2/"); - - Collection files = FileUtils.listFiles(new File("/home/james/tmp/download"), new String[]{"json"}, false); - for (File nextFile : files) { - Bundle bundle = (Bundle) ctx.newJsonParser().parseResource(new FileReader(nextFile)); - for (Bundle.Entry nextEntry : bundle.getEntry()) { - IBaseResource nextResource = nextEntry.getResource(); - IIdType oldId = nextResource.getIdElement(); - String newId = oldId.getResourceType() + "/A" + oldId.getIdPart(); - ourLog.info("Changing resource ID from {} to {}", oldId.toUnqualifiedVersionless(), newId); - nextResource.setId(newId); - - List refs = ctx.newTerser().getAllResourceReferences(nextResource); - for (ResourceReferenceInfo nextRefInfo : refs) { - IIdType nextRef = nextRefInfo.getResourceReference().getReferenceElement(); - String newRef = nextRef.getResourceType() + "/A" + nextRef.getIdPart(); - ourLog.info("Changing ref from {} to {}", nextRef.getValue(), newRef); - nextRefInfo.getResourceReference().setReference(newRef); - } - - nextEntry.getRequest().setMethod(HTTPVerbEnum.PUT); - nextEntry.getRequest().setUrl(newId); - nextEntry.setFullUrl(newId); - - } - - bundle.setType(BundleTypeEnum.TRANSACTION); - ourLog.info("Uploading transaction for {}", nextFile.getName()); - client.transaction().withBundle(bundle).execute(); - } - - - } - -} diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index 5abe1245dd7..742681f5495 100644 --- a/hapi-fhir-jpaserver-base/pom.xml +++ b/hapi-fhir-jpaserver-base/pom.xml @@ -727,7 +727,7 @@ - MINPARALLEL + REDUCED_JPA_TESTS @@ -737,6 +737,7 @@ 2 true + **/*Dstu2* **/stresstest/* diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java index b737c21b914..6c0fb43037e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java @@ -233,8 +233,10 @@ public class FhirSystemDaoDstu2 extends BaseHapiFhirSystemDao { @Transactional(propagation = Propagation.REQUIRED) @Override public Bundle transaction(RequestDetails theRequestDetails, Bundle theRequest) { - ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, theRequest, "Bundle", null); - notifyInterceptors(RestOperationTypeEnum.TRANSACTION, requestDetails); + if (theRequestDetails != null) { + ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, theRequest, "Bundle", null); + notifyInterceptors(RestOperationTypeEnum.TRANSACTION, requestDetails); + } String actionName = "Transaction"; return transaction((ServletRequestDetails) theRequestDetails, theRequest, actionName);