archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1549543 - in /archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload: AbstractDownloadTest.java DownloadArtifactsTest.java
Date Mon, 09 Dec 2013 11:21:16 GMT
Author: olamy
Date: Mon Dec  9 11:21:16 2013
New Revision: 1549543

URL: http://svn.apache.org/r1549543
Log:
[MRM-1761] add unit test

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java
    archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java?rev=1549543&r1=1549542&r2=1549543&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java
Mon Dec  9 11:21:16 2013
@@ -52,7 +52,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.context.ContextLoaderListener;
 
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
 import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
 import org.junit.runner.RunWith;
 
@@ -66,7 +72,7 @@ public abstract class AbstractDownloadTe
 
     protected Logger log = LoggerFactory.getLogger( getClass() );
 
-    static String previousAppServerBase;
+    protected static String previousAppServerBase;
 
     public String authorizationHeader = getAdminAuthzHeader();
 
@@ -283,4 +289,23 @@ public abstract class AbstractDownloadTe
             FakeCreateAdminService.class );
     }
 
+
+    protected List<String> getZipEntriesNames( ZipFile zipFile )
+    {
+        try
+        {
+            List<String> entriesNames = new ArrayList<String>();
+            Enumeration<? extends ZipEntry> entries = zipFile.entries();
+            while ( entries.hasMoreElements() )
+            {
+                entriesNames.add( entries.nextElement().getName() );
+            }
+            return entriesNames;
+        }
+        catch ( Throwable e )
+        {
+            log.info( "fail to get zipEntries {}", e.getMessage(), e );
+        }
+        return Collections.emptyList();
+    }
 }

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java?rev=1549543&r1=1549542&r2=1549543&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java
Mon Dec  9 11:21:16 2013
@@ -183,24 +183,7 @@ public class DownloadArtifactsTest
         file.deleteOnExit();
     }
 
-    private List<String> getZipEntriesNames( ZipFile zipFile )
-    {
-        try
-        {
-            List<String> entriesNames = new ArrayList<String>();
-            Enumeration<? extends ZipEntry> entries = zipFile.entries();
-            while ( entries.hasMoreElements() )
-            {
-                entriesNames.add( entries.nextElement().getName() );
-            }
-            return entriesNames;
-        }
-        catch ( Throwable e )
-        {
-            log.info( "fail to get zipEntries {}", e.getMessage(), e );
-        }
-        return Collections.emptyList();
-    }
+
 
 
     public static class RedirectServlet



Mime
View raw message