ruleant/getback_gps

fix compatibility issue with Java8 and unit tests

ruleant opened this issue · 5 comments

junit4 is not compatible with Java 8 :

com.github.ruleant.getback_gps.lib.LatitudeTest > testGetSegment FAILED
java.lang.IllegalArgumentException

  • enable junit5 in gradle build (including de.mannodermaus.gradle.plugins:android-junit5:1.7.0.0)
  • convert tests to junit5
  • fix tests using mockito
  • enable coverage (replacement for cobertura?), see #126

Temporarily disabled unittest in Gradle file:
Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0 at build_47v1op87c5rii96bt2k4tdgku$_run_closure8.doCall(/vagrant/build.gradle:90) (Run with --stacktrace to get the full stack trace of this deprecation warning.) The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead. at build_47v1op87c5rii96bt2k4tdgku$_run_closure8.doCall(/vagrant/build.gradle:90)

Particularly problems with :
testClassesDir = project.sourceSets.unitTest.output.classesDir classpath = project.sourceSets.unitTest.runtimeClasspath

preparation in junit5 branch

testresultaat in build/reports/tests/testReleaseUnitTest/index.html

run unit tests with ./gradlew clean check