[MRM-1362] Add simple 'CRUD' pages for project-level metadata along with a "generic metadata" plugin

* added mailingLists, licenses, and dependency in test artifact's pom
* added Selenium test for delete of metadata properties (mailing list, dependency, and license)



git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@948793 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jevica Arianne B. Zurbano 2010-05-27 11:54:24 +00:00
parent da6e920101
commit 2ee860c6a0
2 changed files with 110 additions and 0 deletions

View File

@ -7,7 +7,35 @@
<version>1.0</version>
<name>test</name>
<url>http://maven.apache.org</url>
<licenses>
<license>
<name>Test License</name>
<url>http://www.test.org/test.html</url>
</license>
</licenses>
<mailingLists>
<mailingList>
<name>test user list</name>
<subscribe>http://test.net/lists/listinfo/test-user</subscribe>
<unsubscribe>http://test.net/lists/listinfo/test-user</unsubscribe>
<archive>http://www.test-archive.com/test-user%40lists.test.net/</archive>
</mailingList>
<mailingList>
<name>test developer list</name>
<subscribe>http://test.net/lists/listinfo/test-dev</subscribe>
<unsubscribe>http://test.net/lists/listinfo/test-dev</unsubscribe>
<archive>http://www.test-archive.com/test-dev%40lists.test.net/</archive>
</mailingList>
</mailingLists>
<dependencies>
<dependency>
<groupId>test.group.id</groupId>
<artifactId>testArtifactId</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@ -15,6 +43,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>test</id>
@ -22,3 +51,4 @@
</repository>
</distributionManagement>
</project>

View File

@ -139,6 +139,86 @@ public class BrowseTest
Assert.assertTrue( secondSnapshotVersion.endsWith( "-2" ) );
}
public void testMetadataPageDisplay()
{
goToBrowsePage();
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
clickLinkWithText( getProperty( "ARTIFACT_ARTIFACTID" ) + "/" );
clickLinkWithText( getProperty( "ARTIFACT_VERSION" ) + "/" );
clickLinkWithText( "Metadata" );
assertMinimalMetadataDisplay();
}
public void testDeleteMetadataDependency()
{
String depArtifactId = "testArtifactId";
goToBrowsePage();
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
clickLinkWithText( getProperty( "ARTIFACT_ARTIFACTID" ) + "/" );
clickLinkWithText( getProperty( "ARTIFACT_VERSION" ) + "/" );
clickLinkWithText( "Metadata" );
assertMinimalMetadataDisplay();
assertTextPresent( "dependencies" );
assertTextPresent( depArtifactId );
String xPath = "//li[contains(text(),'" + depArtifactId + "')]/a/img[contains(@src,'delete.gif')]";
clickLinkWithXPath( xPath );
assertTextNotPresent( depArtifactId );
}
public void testDeleteMetadataMailingList()
{
String listName = "test user list";
goToBrowsePage();
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
clickLinkWithText( getProperty( "ARTIFACT_ARTIFACTID" ) + "/" );
clickLinkWithText( getProperty( "ARTIFACT_VERSION" ) + "/" );
clickLinkWithText( "Metadata" );
assertMinimalMetadataDisplay();
assertTextPresent( "mailingLists" );
assertTextPresent( listName );
String xPath = "//li[contains(text(),'" + listName + "')]/a/img[contains(@src,'delete.gif')]";
clickLinkWithXPath( xPath );
assertTextNotPresent( listName );
}
public void testDeleteMetadataLicense()
{
String licenseName = "Test License";
goToBrowsePage();
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
clickLinkWithText( getProperty( "ARTIFACT_ARTIFACTID" ) + "/" );
clickLinkWithText( getProperty( "ARTIFACT_VERSION" ) + "/" );
clickLinkWithText( "Metadata" );
assertMinimalMetadataDisplay();
assertTextPresent( "licenses" );
assertTextPresent( licenseName );
String xPath = "//li[contains(text(),'" + licenseName + "')]/a/img[contains(@src,'delete.gif')]";
clickLinkWithXPath( xPath );
assertTextNotPresent( licenseName );
assertTextNotPresent( "licenses" );
}
private void assertMinimalMetadataDisplay()
{
assertTextPresent( "project.metadata.id=" );
assertTextPresent( "project.url=" );
assertTextPresent( "project.name=" );
assertTextPresent( "project.description=" );
}
private void assertArtifactInfoPage( String version, String artifactInfoRepositoryId, String artifactInfoGroupId,
String artifactInfoArtifactId, String artifactInfoVersion,
String artifactInfoPackaging )