Rewrite assertion ( JDK8 can have both outputs )
authorrfscholte <rfscholte@apache.org>
Wed, 1 Aug 2018 20:06:15 +0000 (22:06 +0200)
committerrfscholte <rfscholte@apache.org>
Wed, 1 Aug 2018 20:06:15 +0000 (22:06 +0200)
src/it/package/verify.groovy

index abd830b..a228cb8 100644 (file)
  
 def buildLog = new File( basedir, 'build.log' )
 
-if (!System.getProperty('java.version').startsWith('1.8.')) {
+def lines = buildLog.readLines().dropWhile{ !it.startsWith("classes -> ") }.takeWhile{ !it.startsWith( '[INFO]' ) }
+
   // 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()
-} else {
+
   // 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 -> ") }.drop(1).takeWhile{ !it.startsWith( '[INFO]' ) }.size()
-}
+
+assert lines.size() == ( lines[0] == 'classes -> java.base' ? 2 : 3  )