Finally have travis and coveralls working!

This commit is contained in:
jamesagnew 2015-06-21 00:48:10 -04:00
parent d8c4bce72a
commit e9ac63688c
16 changed files with 47 additions and 156 deletions

View File

@ -161,6 +161,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId>
<version>2.1.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
@ -195,13 +202,8 @@
</configuration>
</plugin>
<!--<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
</configuration>
</plugin>-->
<!--<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.0</version> <configuration> </configuration> </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
@ -213,20 +215,11 @@
<report>jxr</report>
</reports>
</reportSet>
<!--
<reportSet>
<id>restful-server-example</id>
<reports>
<report>jxr</report>
</reports>
<configuration>
<sourcePath>../restful-server-example/src/main/java</sourcePath>
<destDir>${project.reporting.outputDirectory}/rse-xref</destDir>
<outputDirectory>tmp</outputDirectory>
<reportOutputDirectory>rse-xref</reportOutputDirectory>
</configuration>
</reportSet>
-->
<!-- <reportSet> <id>restful-server-example</id> <reports> <report>jxr</report>
</reports> <configuration> <sourcePath>../restful-server-example/src/main/java</sourcePath>
<destDir>${project.reporting.outputDirectory}/rse-xref</destDir> <outputDirectory>tmp</outputDirectory>
<reportOutputDirectory>rse-xref</reportOutputDirectory> </configuration>
</reportSet> -->
</reportSets>
</plugin>
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-linkcheck-plugin</artifactId>

View File

@ -26,6 +26,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Enumeration;
import net.sourceforge.cobertura.CoverageIgnore;
import org.hl7.fhir.instance.model.api.IBaseEnumFactory;
import ca.uhn.fhir.model.api.IElement;
@ -106,6 +108,7 @@ public @interface Child {
*/
Class<? extends IBaseEnumFactory<?>> enumFactory() default NoEnumFactory.class;
@CoverageIgnore
public static class NoEnumFactory implements IBaseEnumFactory<Enum<?>> {
private NoEnumFactory() {

View File

@ -24,8 +24,10 @@ package ca.uhn.fhir.model.dstu.valueset;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
@CoverageIgnore
public enum QuantityCompararatorEnum {
/**

View File

@ -24,8 +24,10 @@ package ca.uhn.fhir.model.dstu.valueset;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
@CoverageIgnore
public enum RestfulOperationSystemEnum {
/**

View File

@ -24,8 +24,10 @@ package ca.uhn.fhir.model.dstu.valueset;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
@CoverageIgnore
public enum RestfulOperationTypeEnum {
/**

View File

@ -24,8 +24,10 @@ package ca.uhn.fhir.model.dstu.valueset;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
@CoverageIgnore
public enum SecurityEventObjectSensitivityEnum {
;

View File

@ -24,8 +24,10 @@ package ca.uhn.fhir.model.dstu.valueset;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
@CoverageIgnore
public enum SecurityEventObjectTypeEnum {
/**

View File

@ -20,11 +20,13 @@ package ca.uhn.fhir.model.primitive;
* #L%
*/
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "positiveInt")
@CoverageIgnore
public class PositiveIntDt extends IntegerDt {
/**

View File

@ -20,11 +20,13 @@ package ca.uhn.fhir.model.primitive;
* #L%
*/
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "unsignedInt")
@CoverageIgnore
public class UnsignedIntDt extends IntegerDt {
/**

View File

@ -24,8 +24,10 @@ package ca.uhn.fhir.model.valueset;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
@CoverageIgnore
public enum BundleEntrySearchModeEnum {
MATCH("match", "http://hl7.org/fhir/search-entry-mode"),

View File

@ -24,6 +24,7 @@ package ca.uhn.fhir.model.valueset;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
/**
@ -31,6 +32,7 @@ import ca.uhn.fhir.model.api.IValueSetEnumBinder;
* on a DSTU2 server. It is preferably to use the new DSTU2 Bundle (<code>ca.uhn.fhir.model.dstu2.resource.Bundle</code>)
* for this purpose.
*/
@CoverageIgnore
public enum BundleEntryTransactionMethodEnum {
GET("GET", "http://hl7.org/fhir/http-verb"),

View File

@ -24,8 +24,10 @@ package ca.uhn.fhir.model.valueset;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.cobertura.CoverageIgnore;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
@CoverageIgnore
public enum BundleTypeEnum {
TRANSACTION("transaction", "http://hl7.org/fhir/bundle-type"),

View File

@ -1,118 +0,0 @@
package ca.uhn.fhir.rest.server;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2015 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 java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.Validate;
import org.hl7.fhir.instance.model.api.IBaseResource;
/**
* Used by {@link IBundleProvider} to provide a single page worth of results.
*
* If the server chooses to, it may return a different number of matching results to the number that the user requested.
* For example, if the client requested 100 results but the server decided to return only 10 (perhaps because they were
* very large), this value should be set to 10. Note that this count refers only to resources which are included in the
* indexes provided to {@link IBundleProvider#getResources(int, int)}, so it should not reflect any additional results
* added to the response as a result of _include parameters, OperationOutcome's etc.
*/
public class ResponseResourceList {
/**
* Singleton unmodifiable empty list
*/
public static final ResponseResourceList EMPTY = new EmptyResponseResourceList();
private List<IBaseResource> myIncludeResults;
private List<IBaseResource> myMatchResults;
/**
* Adds an "include" results. Include results are results which are added as a result of <code>_include</code>
* directives in search requests.
*/
public void addIncludeResults(IBaseResource theIncludeResult) {
if (myIncludeResults == null) {
myIncludeResults = new ArrayList<IBaseResource>();
}
myIncludeResults.add(theIncludeResult);
}
/**
* Adds a "match" result. A match result is a result added as a direct result of the operation in question. E.g. for
* a search invocation a match result would be a result which directly matched the search criteria. For a history
* invocation it would be a historical version of a resource or the current version.
*/
public void addMatchResult(IBaseResource theResource) {
Validate.notNull(theResource, "theResource must not be null");
if (myMatchResults == null) {
myMatchResults = new ArrayList<IBaseResource>();
}
myMatchResults.add(theResource);
}
public List<IBaseResource> getIncludeResults() {
return myIncludeResults;
}
public List<IBaseResource> getMatchResults() {
return myMatchResults;
}
/**
* Sets the "include" results. Include results are results which are added as a result of <code>_include</code>
* directives in search requests.
*/
public void setIncludeResults(List<IBaseResource> theIncludeResults) {
myIncludeResults = theIncludeResults;
}
/**
* Sets the "match" results. A match result is a result added as a direct result of the operation in question. E.g.
* for a search invocation a match result would be a result which directly matched the search criteria. For a
* history invocation it would be a historical version of a resource or the current version.
*/
public void setMatchResults(List<IBaseResource> theMatchResults) {
myMatchResults = theMatchResults;
}
private static final class EmptyResponseResourceList extends ResponseResourceList {
@Override
public void addIncludeResults(IBaseResource theIncludeResult) {
throw new UnsupportedOperationException();
}
@Override
public void addMatchResult(IBaseResource theResource) {
throw new UnsupportedOperationException();
}
@Override
public void setIncludeResults(List<IBaseResource> theIncludeResults) {
throw new UnsupportedOperationException();
}
@Override
public void setMatchResults(List<IBaseResource> theMatchResults) {
throw new UnsupportedOperationException();
}
}
}

View File

@ -18,7 +18,7 @@ public class CustomThymeleafNarrativeGeneratorTest {
@Test
public void testGenerator() {
CustomThymeleafNarrativeGenerator gen = new CustomThymeleafNarrativeGenerator("file:src/test/resources/narrative/customnarrative.properties");
CustomThymeleafNarrativeGenerator gen = new CustomThymeleafNarrativeGenerator("classpath:narrative/customnarrative.properties");
gen.setFhirContext(ourCtx);
Practitioner p = new Practitioner();

View File

@ -68,7 +68,7 @@ import ca.uhn.fhir.model.base.composite.BaseNarrativeDt;
import ca.uhn.fhir.narrative.INarrativeGenerator;
public class JsonParserHl7OrgTest {
private static FhirContext ourCtx;
private static final FhirContext ourCtx = FhirContext.forDstu2Hl7Org();
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JsonParserHl7OrgTest.class);
@ -410,7 +410,7 @@ public class JsonParserHl7OrgTest {
rpt.getText().setDivAsString("AAA");
rpt.addSpecimen().setResource(spm);
IParser p = new FhirContext(DiagnosticReport.class).newJsonParser().setPrettyPrint(true);
IParser p = ourCtx.newJsonParser().setPrettyPrint(true);
String str = p.encodeResourceToString(rpt);
ourLog.info(str);
@ -632,7 +632,7 @@ public class JsonParserHl7OrgTest {
Observation obs = new Observation();
obs.setValue(new DecimalType(112.22));
IParser p = new FhirContext(Observation.class).newJsonParser();
IParser p = ourCtx.newJsonParser();
try {
p.encodeResourceToString(obs);
@ -1133,9 +1133,8 @@ public class JsonParserHl7OrgTest {
@Test
public void testSimpleResourceEncodeWithCustomType() throws IOException, SAXException {
FhirContext fhirCtx = new FhirContext(MyObservationWithExtensions.class);
String jsonString = IOUtils.toString(JsonParser.class.getResourceAsStream("/example-patient-general.json"), Charset.forName("UTF-8"));
MyObservationWithExtensions obs = fhirCtx.newJsonParser().parseResource(MyObservationWithExtensions.class, jsonString);
MyObservationWithExtensions obs = ourCtx.newJsonParser().parseResource(MyObservationWithExtensions.class, jsonString);
assertEquals(0, obs.getExtension().size());
assertEquals("aaaa", obs.getExtAtt().getContentType());
@ -1146,7 +1145,7 @@ public class JsonParserHl7OrgTest {
org.hl7.fhir.instance.model.Extension undeclaredExtension = undeclaredExtensions.get(0);
assertEquals("http://hl7.org/fhir/Profile/iso-21090#qualifier", undeclaredExtension.getUrl());
IParser xmlParser = fhirCtx.newXmlParser();
IParser xmlParser = ourCtx.newXmlParser();
String encoded = xmlParser.encodeResourceToString(obs);
encoded = encoded.replaceAll("<!--.*-->", "").replace("\n", "").replace("\r", "").replaceAll(">\\s+<", "><");
@ -1231,11 +1230,6 @@ public class JsonParserHl7OrgTest {
}
@BeforeClass
public static void beforeClass() {
ourCtx = FhirContext.forDstu2Hl7Org();
}
@ResourceDef(name = "Patient")
public static class MyPatientWithOneDeclaredAddressExtension extends Patient {

View File

@ -1107,7 +1107,7 @@ public class XmlParserHl7OrgDstu2Test {
@Test
public void testLoadAndEncodeDeclaredExtensions() throws ConfigurationException, DataFormatException, SAXException, IOException {
IParser p = new FhirContext(ResourceWithExtensionsA.class).newXmlParser();
IParser p = ourCtx.newXmlParser();
//@formatter:off
String msg = "<ResourceWithExtensionsA xmlns=\"http://hl7.org/fhir\">\n" +
@ -1142,7 +1142,7 @@ public class XmlParserHl7OrgDstu2Test {
"</ResourceWithExtensionsA>";
//@formatter:on
ResourceWithExtensionsA resource = (ResourceWithExtensionsA) p.parseResource(msg);
ResourceWithExtensionsA resource = (ResourceWithExtensionsA) p.parseResource(ResourceWithExtensionsA.class, msg);
assertEquals("IdentifierLabel", resource.getIdentifier().get(0).getValue());
assertEquals("Foo1Value", resource.getFoo1().get(0).getValue());
assertEquals("Foo1Value2", resource.getFoo1().get(1).getValue());
@ -1503,9 +1503,8 @@ public class XmlParserHl7OrgDstu2Test {
@Test
public void testSimpleResourceEncodeWithCustomType() throws IOException {
FhirContext fhirCtx = new FhirContext(MyObservationWithExtensions.class);
String xmlString = IOUtils.toString(XmlParserHl7OrgDstu2Test.class.getResourceAsStream("/example-patient-general.xml"), Charset.forName("UTF-8"));
MyObservationWithExtensions obs = fhirCtx.newXmlParser().parseResource(MyObservationWithExtensions.class, xmlString);
MyObservationWithExtensions obs = ourCtx.newXmlParser().parseResource(MyObservationWithExtensions.class, xmlString);
assertEquals(0, obs.getExtension().size());
assertEquals("aaaa", obs.getExtAtt().getContentType());
@ -1516,7 +1515,7 @@ public class XmlParserHl7OrgDstu2Test {
Extension undeclaredExtension = undeclaredExtensions.get(0);
assertEquals("http://hl7.org/fhir/Profile/iso-21090#qualifier", undeclaredExtension.getUrl());
IParser jsonParser = fhirCtx.newJsonParser().setPrettyPrint(true);
IParser jsonParser = ourCtx.newJsonParser().setPrettyPrint(true);
String encoded = jsonParser.encodeResourceToString(obs);
ourLog.info(encoded);