From 4a2221fc63e8f42515eb3ac524603c22cd23269c Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 24 May 2012 16:22:12 +0000 Subject: 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 --- .../archiva/rest/api/model/BrowseResult.java | 11 ++++++++++ .../archiva/rest/services/BrowseServiceTest.java | 24 ++++++++++++++++++++++ .../archiva/web/action/DeleteArtifactAction.java | 3 --- 3 files changed, 35 insertions(+), 3 deletions(-) (limited to 'archiva-modules') 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( "'" ); -- cgit v1.2.3