]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1761] add unit test
authorOlivier Lamy <olamy@apache.org>
Mon, 9 Dec 2013 11:21:16 +0000 (11:21 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 9 Dec 2013 11:21:16 +0000 (11:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1549543 13f79535-47bb-0310-9956-ffa450edef68

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

index eda732dba0ac128a193fdbc626f783cd0b105b1d..03dd1d229780fc96b388f88ba890421a8c0a6642 100644 (file)
@@ -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 AbstractDownloadTest
 
     protected Logger log = LoggerFactory.getLogger( getClass() );
 
-    static String previousAppServerBase;
+    protected static String previousAppServerBase;
 
     public String authorizationHeader = getAdminAuthzHeader();
 
@@ -283,4 +289,23 @@ public abstract class AbstractDownloadTest
             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();
+    }
 }
index c0d491d69fc3e89bd823175174be6f5484a70fdc..105c6d035f4b098412ff082d749f8c130bc66479 100644 (file)
@@ -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