Output with package option differs between Java 8 and Java 9+
authorrfscholte <rfscholte@apache.org>
Wed, 1 Aug 2018 18:03:31 +0000 (20:03 +0200)
committerrfscholte <rfscholte@apache.org>
Wed, 1 Aug 2018 18:03:31 +0000 (20:03 +0200)
src/it/package/verify.groovy

index 16a77db..95ec277 100644 (file)
  */
  
 def buildLog = new File( basedir, 'build.log' )
+def env = System.getenv()
 
-assert 1 == buildLog.readLines().dropWhile{ it != 'classes -> java.base' }.drop(1).takeWhile{ !it.startsWith( '[INFO]' ) }.size()
\ No newline at end of file
+if ( System.getProperty('java.verion', '8') == '8' )
+{
+  // classes -> c:\Program Files\Java\jdk1.8.0_152\jre\lib\rt.jar
+  //   org.apache.maven.plugins.jdeps.its (classes)
+  //      -> java.io  
+  assert 2 == buildLog.readLines().dropWhile{ !it.startsWith("classes -> ${env.JAVA_HOME}") }.drop(1).takeWhile{ !it.startsWith( '[INFO]' ) }.size()
+}
+else
+{
+  // classes -> java.base
+  //   org.apache.maven.plugins.jdeps.its                 -> java.io                                            java.base
+  assert 1 == buildLog.readLines().dropWhile{ it != 'classes -> java.base' }.drop(1).takeWhile{ !it.startsWith( '[INFO]' ) }.size()
+}