Fix more differences between Java8 on Windows and Linux
authorrfscholte <rfscholte@apache.org>
Wed, 1 Aug 2018 19:00:02 +0000 (21:00 +0200)
committerrfscholte <rfscholte@apache.org>
Wed, 1 Aug 2018 19:00:02 +0000 (21:00 +0200)
src/it/package/verify.groovy
src/it/unsupported-api_main/verify.groovy
src/it/unsupported-api_test/verify.groovy

index 3d210dd..875917c 100644 (file)
  
 def buildLog = new File( basedir, 'build.log' )
 
-if (System.getProperty('java.version').startsWith('1.8.')) {
+if (!System.getProperty('java.version').startsWith('1.8.')) {
+  // 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 if (System.getProperty('os.name').startsWith('Windows')) {
   // 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()
 } else {
+  // classes -> JDK removed internal API
   // 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()
+  //    <unnamed>                                          -> java.io                                            java.base
+  //    <unnamed>                                          -> java.lang                                          java.base
+  //    <unnamed>                                          -> sun.misc                                           JDK internal API (JDK removed internal API)
+  assert 5 == buildLog.readLines().dropWhile{ !it.startsWith("classes -> ") }.drop(1).takeWhile{ !it.startsWith( '[INFO]' ) }.size()
 }
index 44f643d..0a00176 100644 (file)
@@ -22,4 +22,5 @@ def LS = System.getProperty("line.separator")
  \r
 def buildLog = new File( basedir, 'build.log' )\r
 assert buildLog.text.contains( "Found offending packages:${LS} sun.misc -> JDK internal API (java.base)" ) || \r
-       buildLog.text.contains( "Found offending packages:${LS} sun.misc -> JDK internal API (rt.jar)" )
\ No newline at end of file
+       buildLog.text.contains( "Found offending packages:${LS} sun.misc -> JDK internal API (rt.jar)" ) ||\r
+       buildLog.text.contains( "Found offending packages:${LS} sun.misc -> JDK internal API (JDK removed internal API)" )
\ No newline at end of file
index 44f643d..0a00176 100644 (file)
@@ -22,4 +22,5 @@ def LS = System.getProperty("line.separator")
  \r
 def buildLog = new File( basedir, 'build.log' )\r
 assert buildLog.text.contains( "Found offending packages:${LS} sun.misc -> JDK internal API (java.base)" ) || \r
-       buildLog.text.contains( "Found offending packages:${LS} sun.misc -> JDK internal API (rt.jar)" )
\ No newline at end of file
+       buildLog.text.contains( "Found offending packages:${LS} sun.misc -> JDK internal API (rt.jar)" ) ||\r
+       buildLog.text.contains( "Found offending packages:${LS} sun.misc -> JDK internal API (JDK removed internal API)" )
\ No newline at end of file