You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/05/15 13:25:10 UTC

svn commit: r1338653 - /archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java

Author: olamy
Date: Tue May 15 11:25:10 2012
New Revision: 1338653

URL: http://svn.apache.org/viewvc?rev=1338653&view=rev
Log:
add an other unit to test directory content with both files and directory

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java?rev=1338653&r1=1338652&r2=1338653&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java Tue May 15 11:25:10 2012
@@ -275,4 +275,33 @@ public class BrowseServiceTest
             new ArtifactContentEntry( "org/apache", false, 1 ) );
         deleteTestRepo( testRepoId );
     }
+
+    @Test
+    public void readArtifactContentEntriesFilesAndDirectories()
+        throws Exception
+    {
+        String testRepoId = "test-repo";
+        // force guest user creation if not exists
+        if ( getUserService( authorizationHeader ).getGuestUser() == null )
+        {
+            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
+        }
+
+        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false );
+
+        BrowseService browseService = getBrowseService( authorizationHeader, true );
+
+        List<ArtifactContentEntry> artifactContentEntries =
+            browseService.getArtifactContentEntries( "commons-logging", "commons-logging", "1.1", null, null,
+                                                     "org/apache/commons/logging/", testRepoId );
+
+        log.info( "artifactContentEntries: {}", artifactContentEntries );
+
+        assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 10 ).contains(
+            new ArtifactContentEntry( "org/apache/commons/logging/impl", false, 4 ),
+            new ArtifactContentEntry( "org/apache/commons/logging/LogSource.class", true, 4 ) );
+        deleteTestRepo( testRepoId );
+    }
+
+
 }