]> source.dussan.org Git - archiva.git/commitdiff
add unit test and a toString method for debug purpose
authorOlivier Lamy <olamy@apache.org>
Thu, 24 May 2012 16:22:12 +0000 (16:22 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 24 May 2012 16:22:12 +0000 (16:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1342319 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResult.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/DeleteArtifactAction.java

index 6b134fd45ccbee97caa91862bc8dfab1940d5942..f24b71870aac9fec7f25d58fc60f6ab22b58e58a 100644 (file)
@@ -54,4 +54,15 @@ public class BrowseResult
     {
         this.browseResultEntries = browseResultEntries;
     }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "BrowseResult" );
+        sb.append( "{browseResultEntries=" ).append( browseResultEntries );
+        sb.append( ", rootLevel=" ).append( rootLevel );
+        sb.append( '}' );
+        return sb.toString();
+    }
 }
index 86181269f375e29ccb76583fca79e619e481d6c7..79e1aba951162eb9eeb3e9e576b3e980ce65a1bd 100644 (file)
@@ -57,6 +57,7 @@ public class BrowseServiceTest
         return map;
     }
 
+
     @Test
     public void metadatagetthenadd()
         throws Exception
@@ -178,6 +179,29 @@ public class BrowseServiceTest
 
     }
 
+
+    @Test
+    public void browsegroupIdWithReleaseStartNumber()
+        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, false );
+        BrowseResult browseResult = browseService.browseGroupId( "commons-logging.commons-logging", testRepoId );
+        log.info( "browseResult: {}", browseResult );
+
+        deleteTestRepo( testRepoId );
+
+    }
+
     @Test
     public void versionsList()
         throws Exception
index cf75f986d080bd25f988d84be02f15cd9c3a2020..7a0d0e20c459fdb5170b5670f6dfaad6627f13ec 100644 (file)
@@ -226,10 +226,7 @@ public class DeleteArtifactAction
 
         if ( StringUtils.isNotEmpty( classifier ) )
         {
-
             msg.append( ":" ).append( classifier );
-
-
         }
         msg.append( ":" ).append( version ).append( "' was successfully deleted from repository '" ).append(
             repositoryId ).append( "'" );