aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2010-02-12 15:20:38 +0000
committerBrett Porter <brett@apache.org>2010-02-12 15:20:38 +0000
commit20c60cb1c198a08925d0e0c9634a25fc3a39288a (patch)
treea353f2cf2f31d84e48c218e2003056154012d899 /archiva-modules
parentbe5981bf16ae154a2244591eeb260d3fbd1382b3 (diff)
downloadarchiva-20c60cb1c198a08925d0e0c9634a25fc3a39288a.tar.gz
archiva-20c60cb1c198a08925d0e0c9634a25fc3a39288a.zip
[MRM-1304] Query using Group ID field in audit log report uses '/' as a separator instead of '.'
Submitted by: Adelita L. Padilla (applied with modifications to test) git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@909454 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties5
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java23
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ViewAuditLogReportAction.java3
3 files changed, 30 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
index 35bbf8502..beb2ab7d0 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
@@ -106,3 +106,8 @@ NETWORKPROXY_PASSWORD=admin123
# Browse - MRM-1278 test
SNAPSHOTS_REPOSITORY=snapshots
RELEASES_REPOSITORY=releases
+
+# Audit Log Report - MRM-1304
+AUDITLOG_GROUPID=group.id
+AUDITLOG_EXPECTED_ARTIFACT=group/id/test/1.0/test-1.0.jar
+
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java
index fdc26b789..1a1d6314b 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/AuditLogsReportTest.java
@@ -161,4 +161,27 @@ public class AuditLogsReportTest
clickLinkWithText( "Logout" );
login( getProperty( "ADMIN_USERNAME" ), getProperty( "ADMIN_PASSWORD" ) );
}
+
+ @Test (dependsOnMethods = { "testAddArtifactValidValues" }, groups = "requiresUpload")
+ public void testViewAuditLogsReportForGroupId()
+ {
+ String groupId = getProperty("AUDITLOG_GROUPID");
+ String artifactId = getProperty("ARTIFACTID");
+ String version = getProperty("VERSION");
+ String packaging = getProperty("PACKAGING");
+ String repositoryId = getProperty("REPOSITORYID");
+ String expectedArtifact = getProperty("AUDITLOG_EXPECTED_ARTIFACT");
+
+ addArtifact( groupId, artifactId, version, packaging, getProperty( "SNAPSHOT_ARTIFACTFILEPATH" ), repositoryId );
+
+ goToAuditLogReports();
+
+ selectValue( "repository", repositoryId );
+ setFieldValue( "groupId", groupId );
+ submit();
+
+ assertAuditLogsReportPage();
+ assertTextPresent( expectedArtifact );
+ assertTextPresent( repositoryId );
+ }
}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ViewAuditLogReportAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ViewAuditLogReportAction.java
index 5c0aec712..bc121ca1b 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ViewAuditLogReportAction.java
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/ViewAuditLogReportAction.java
@@ -160,7 +160,8 @@ public class ViewAuditLogReportAction
if ( groupId != null && !"".equals( groupId.trim() ) )
{
- artifact = groupId + ( ( artifactId != null && !"".equals( artifactId.trim() ) ) ? ( "/" + artifactId + "/%" ) : "%" );
+ String modifiedGroupId = groupId.replace( ".", "/" );
+ artifact = modifiedGroupId + ( ( artifactId != null && !"".equals( artifactId.trim() ) ) ? ( "/" + artifactId + "/%" ) : "%" );
}
else
{