You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2016/05/10 23:55:27 UTC

svn commit: r1743287 - in /maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731: verify.bsh verify.groovy

Author: hboutemy
Date: Tue May 10 23:55:27 2016
New Revision: 1743287

URL: http://svn.apache.org/viewvc?rev=1743287&view=rev
Log:
rewrote the verify script as Groovy since the bsh version breaks with NPE on ASF Jenkins without any explanation

Added:
    maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.groovy
      - copied, changed from r1743043, maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.bsh
Removed:
    maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.bsh

Copied: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.groovy (from r1743043, maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.bsh)
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.groovy?p2=maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.groovy&p1=maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.bsh&r1=1743043&r2=1743287&rev=1743287&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.bsh (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-731/verify.groovy Tue May 10 23:55:27 2016
@@ -22,40 +22,15 @@ import java.net.*;
 import org.apache.commons.compress.archivers.zip.ZipFile;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 
-
-
-boolean result = true;
-
-try
-{
-    File zipFile = new File( basedir, "target/project2-0.0.1-SNAPSHOT-deployable.zip" );
+File zipFile = new File( basedir, "target/project2-0.0.1-SNAPSHOT-deployable.zip" );
     
-    if ( !zipFile.exists() || zipFile.isDirectory() )
-    {
-        System.err.println( "zip-file is missing or a directory." );
-        result = false;
-    }
+assert zipFile.exists() && zipFile.isFile()
     
-    ZipFile zf = new ZipFile( zipFile );
-
-    ZipArchiveEntry ze = zf.getEntry( "project2-0.0.1-SNAPSHOT/symlinks/src/symDir" );
-    if ( ze == null )
-    {
-        System.err.println( "symDir is missing." );
-        result = false;
-    }
+ZipFile zf = new ZipFile( zipFile );
 
-    if (!ze.isUnixSymlink()) {
-        System.err.println( "symDir is not a symnlink." );
-        result = false;
-    }
+ZipArchiveEntry ze = zf.getEntry( "project2-0.0.1-SNAPSHOT/symlinks/src/symDir" );
+assert ze != null
 
-    zf.close();
-}
-catch( IOException e )
-{
-    e.printStackTrace();
-    result = false;
-}
+assert ze.isUnixSymlink()
 
-return result;
+zf.close();