archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1177622 - /archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java
Date Fri, 30 Sep 2011 12:25:33 GMT
Author: olamy
Date: Fri Sep 30 12:25:32 2011
New Revision: 1177622

URL: http://svn.apache.org/viewvc?rev=1177622&view=rev
Log:
add some debug to understand why it fails with 1.5 on jenkins

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java?rev=1177622&r1=1177621&r2=1177622&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java
Fri Sep 30 12:25:32 2011
@@ -24,6 +24,7 @@ import org.apache.archiva.rest.api.servi
 import org.apache.archiva.rest.api.services.RemoteRepositoriesService;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 import org.apache.archiva.webdav.RepositoryServlet;
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
@@ -60,6 +61,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
@@ -230,12 +234,25 @@ public class DownloadArtifactsTest
         IOUtil.copy( is, fw );
         // assert jar contains org/junit/runners/JUnit4.class
         ZipFile zipFile = new ZipFile( file );
+        List<String> entries = getZipEntriesNames( zipFile );
         ZipEntry zipEntry = zipFile.getEntry( "org/junit/runners/JUnit4.class" );
-        assertNotNull( zipEntry );
+        assertNotNull( "cannot find zipEntry org/junit/runners/JUnit4.class, entries: " +
entries + ", content is: "
+                           + FileUtils.readFileToString( file ), zipEntry );
         zipFile.close();
         file.deleteOnExit();
     }
 
+    private List<String> getZipEntriesNames( ZipFile zipFile )
+    {
+        List<String> entriesNames = new ArrayList<String>();
+        Enumeration<? extends ZipEntry> entries = zipFile.entries();
+        while ( entries.hasMoreElements() )
+        {
+            entriesNames.add( entries.nextElement().getName() );
+        }
+        return entriesNames;
+    }
+
     public static class RedirectServlet
         extends HttpServlet
     {



Mime
View raw message