Skip to content

Commit

Permalink
Try to fix permissions issues in travis
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed Jul 27, 2018
1 parent 75a68a0 commit d04db79
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -26,4 +26,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,REDUCED_JPA_TESTS,ERRORPRONE,JACOCO clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report
- sudo chmod -R 777 "$HOME/.m2/repository";
- sudo chown -R travis:travis "$HOME/.m2/repository";
- mvn -Dci=true -e -B -P ALLMODULES,REDUCED_JPA_TESTS,ERRORPRONE,JACOCO clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report;
Expand Up @@ -9,9 +9,9 @@
* 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.
Expand All @@ -20,46 +20,53 @@
* #L%
*/

import java.util.Collections;
import java.util.List;

import org.hl7.fhir.instance.model.api.IBaseResource;

import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import org.hl7.fhir.instance.model.api.IBaseResource;

import java.util.Collections;
import java.util.List;

public class SimpleBundleProvider implements IBundleProvider {

private List<IBaseResource> myList;

private final List<IBaseResource> myList;
private final String myUuid;

public SimpleBundleProvider(List<IBaseResource> theList) {
myList = theList;
this(theList, null);
}

public SimpleBundleProvider(IBaseResource theResource) {
myList = Collections.singletonList(theResource);
myUuid = null;
}

/**
* Create an empty bundle
*/
public SimpleBundleProvider() {
myList = Collections.emptyList();
myUuid = null;
}

public SimpleBundleProvider(List<IBaseResource> theList, String theUuid) {
myList = theList;
myUuid = theUuid;
}

@Override
public List<IBaseResource> getResources(int theFromIndex, int theToIndex) {
return myList.subList(theFromIndex, Math.min(theToIndex, myList.size()));
public InstantDt getPublished() {
return InstantDt.withCurrentTime();
}

@Override
public Integer size() {
return myList.size();
public List<IBaseResource> getResources(int theFromIndex, int theToIndex) {
return myList.subList(theFromIndex, Math.min(theToIndex, myList.size()));
}

@Override
public InstantDt getPublished() {
return InstantDt.withCurrentTime();
public String getUuid() {
return myUuid;
}

@Override
Expand All @@ -68,8 +75,8 @@ public Integer preferredPageSize() {
}

@Override
public String getUuid() {
return null;
public Integer size() {
return myList.size();
}

}
4 changes: 4 additions & 0 deletions src/changes/changes.xml
Expand Up @@ -207,6 +207,10 @@
"username:password" as an alternate to specifying them as two
discrete strings.
</action>
<action type="add">
SimpleBundleProvider has been modified to optionally allow calling
code to specify a search UUID
</action>
</release>
<release version="3.4.0" date="2018-05-28">
<action type="add">
Expand Down

0 comments on commit d04db79

Please sign in to comment.