Merge branch 'master' of github.com:jamesagnew/hapi-fhir

This commit is contained in:
James Agnew 2016-04-13 08:10:00 -04:00
commit e1196ec70b
7 changed files with 55 additions and 15 deletions

View File

@ -19,6 +19,8 @@ before_script:
- export MAVEN_SKIP_RC=true
script:
- mvn -e -B clean install && cd hapi-fhir-cobertura && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID -P COBERTURA clean cobertura:cobertura coveralls:report
- mvn -e -B clean install && cd hapi-fhir-cobertura && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID clean test jacoco:report coveralls:report
# - mvn -e -B clean install && cd hapi-fhir-cobertura && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID -P COBERTURA clean cobertura:cobertura coveralls:report

View File

@ -335,11 +335,21 @@
</execution>
</executions>
</plugin>
<!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>${maven_cobertura_plugin_version}</version> <configuration>
<check> <branchRate>85</branchRate> <lineRate>85</lineRate> <haltOnFailure>true</haltOnFailure> <totalBranchRate>85</totalBranchRate> <totalLineRate>85</totalLineRate>
<packageLineRate>85</packageLineRate> <packageBranchRate>85</packageBranchRate> <regexes> <regex> <pattern>com.example.reallyimportant.*</pattern> <branchRate>90</branchRate>
<lineRate>80</lineRate> </regex> <regex> <pattern>com.example.boringcode.*</pattern> <branchRate>40</branchRate> <lineRate>30</lineRate> </regex> </regexes> </check>
</configuration> <executions> <execution> <goals> <goal>clean</goal> <goal>check</goal> </goals> </execution> </executions> </plugin> -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.6.201602180812</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
</resources>

View File

@ -3,6 +3,10 @@ package ca.uhn.fhirtest;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Enumeration;
import org.apache.derby.drda.NetworkServerControl;
import org.springframework.beans.factory.DisposableBean;
@ -18,8 +22,20 @@ public class DerbyNetworkServer implements InitializingBean, DisposableBean {
try {
ourLog.info("Shutting down derby");
// DriverManager.getConnection("jdbc:derby:directory:" + System.getProperty("fhir.db.location") + ";shutdown=true");
Enumeration<Driver> drivers = DriverManager.getDrivers();
while (drivers.hasMoreElements()) {
Driver driver = drivers.nextElement();
try {
ourLog.error("Unregistering driver: {}", driver.getClass());
DriverManager.deregisterDriver(driver);
} catch (SQLException e) {
ourLog.error("Failed to unregister driver", e);
}
}
} catch (Exception e) {
ourLog.info("Failed to create database: {}", e.getMessage());
ourLog.info("Failed to shut down database: {}", e.getMessage());
}
}

View File

@ -38,6 +38,10 @@ import ca.uhn.fhirtest.config.TestDstu2Config;
public class TestRestfulServer extends RestfulServer {
public static final String FHIR_BASEURL_DSTU2 = "fhir.baseurl.dstu2";
public static final String FHIR_BASEURL_DSTU3 = "fhir.baseurl.dstu3";
public static final String FHIR_BASEURL_DSTU1 = "fhir.baseurl.dstu1";
private static final long serialVersionUID = 1L;
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TestRestfulServer.class);
@ -85,7 +89,7 @@ public class TestRestfulServer extends RestfulServer {
JpaConformanceProviderDstu1 confProvider = new JpaConformanceProviderDstu1(this, systemDao);
confProvider.setImplementationDescription(implDesc);
setServerConformanceProvider(confProvider);
baseUrlProperty = "fhir.baseurl.dstu1";
baseUrlProperty = FHIR_BASEURL_DSTU1;
break;
}
case "DSTU2": {
@ -102,7 +106,7 @@ public class TestRestfulServer extends RestfulServer {
JpaConformanceProviderDstu2 confProvider = new JpaConformanceProviderDstu2(this, systemDao, myAppCtx.getBean(DaoConfig.class));
confProvider.setImplementationDescription(implDesc);
setServerConformanceProvider(confProvider);
baseUrlProperty = "fhir.baseurl.dstu2";
baseUrlProperty = FHIR_BASEURL_DSTU2;
break;
}
case "DSTU3": {
@ -119,7 +123,7 @@ public class TestRestfulServer extends RestfulServer {
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(this, systemDao, myAppCtx.getBean(DaoConfig.class));
confProvider.setImplementationDescription(implDesc);
setServerConformanceProvider(confProvider);
baseUrlProperty = "fhir.baseurl.dstu3";
baseUrlProperty = FHIR_BASEURL_DSTU3;
break;
}
default:

View File

@ -25,7 +25,9 @@ import ca.uhn.fhir.jpa.dao.DaoConfig;
@EnableTransactionManagement()
public class TestDstu1Config extends BaseJavaConfigDstu1 {
@Value("${fhir.db.location}")
public static final String FHIR_DB_LOCATION = "${fhir.db.location}";
@Value(FHIR_DB_LOCATION)
private String myFhirDbLocation;
/**

View File

@ -29,10 +29,13 @@ import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
@EnableTransactionManagement()
public class TestDstu2Config extends BaseJavaConfigDstu2 {
@Value("${fhir.db.location.dstu2}")
public static final String FHIR_LUCENE_LOCATION_DSTU2 = "${fhir.lucene.location.dstu2}";
public static final String FHIR_DB_LOCATION_DSTU2 = "${fhir.db.location.dstu2}";
@Value(FHIR_DB_LOCATION_DSTU2)
private String myFhirDbLocation;
@Value("${fhir.lucene.location.dstu2}")
@Value(FHIR_LUCENE_LOCATION_DSTU2)
private String myFhirLuceneLocation;
/**

View File

@ -34,10 +34,13 @@ import ca.uhn.fhir.validation.ResultSeverityEnum;
@EnableTransactionManagement()
public class TestDstu3Config extends BaseJavaConfigDstu3 {
@Value("${fhir.db.location.dstu3}")
public static final String FHIR_LUCENE_LOCATION_DSTU3 = "${fhir.lucene.location.dstu3}";
public static final String FHIR_DB_LOCATION_DSTU3 = "${fhir.db.location.dstu3}";
@Value(FHIR_DB_LOCATION_DSTU3)
private String myFhirDbLocation;
@Value("${fhir.lucene.location.dstu3}")
@Value(FHIR_LUCENE_LOCATION_DSTU3)
private String myFhirLuceneLocation;
@Bean()