diff options
author | Olivier Lamy <olamy@apache.org> | 2012-05-24 16:22:12 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-05-24 16:22:12 +0000 |
commit | 4a2221fc63e8f42515eb3ac524603c22cd23269c (patch) | |
tree | 6cf8fc29f0b689fdaff253a7f6c39531319d222a /archiva-modules | |
parent | dd2be37ed901a784379ef862a1c475fa41bf65cd (diff) | |
download | archiva-4a2221fc63e8f42515eb3ac524603c22cd23269c.tar.gz archiva-4a2221fc63e8f42515eb3ac524603c22cd23269c.zip |
add unit test and a toString method for debug purpose
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1342319 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
3 files changed, 35 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResult.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResult.java index 6b134fd45..f24b71870 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResult.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResult.java @@ -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(); + } } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java index 86181269f..79e1aba95 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java @@ -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 diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/DeleteArtifactAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/DeleteArtifactAction.java index cf75f986d..7a0d0e20c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/DeleteArtifactAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/DeleteArtifactAction.java @@ -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( "'" ); |