mirror of https://github.com/apache/archiva.git
[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:
parent
da6e920101
commit
2ee860c6a0
|
@ -7,7 +7,35 @@
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
<name>test</name>
|
<name>test</name>
|
||||||
<url>http://maven.apache.org</url>
|
<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>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>test.group.id</groupId>
|
||||||
|
<artifactId>testArtifactId</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
@ -15,6 +43,7 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>test</id>
|
<id>test</id>
|
||||||
|
@ -22,3 +51,4 @@
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,86 @@ public class BrowseTest
|
||||||
String secondSnapshotVersion = getText( "//div[@id='download']/div[@id='accordion']/p[1]/a/" );
|
String secondSnapshotVersion = getText( "//div[@id='download']/div[@id='accordion']/p[1]/a/" );
|
||||||
Assert.assertTrue( secondSnapshotVersion.endsWith( "-2" ) );
|
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,
|
private void assertArtifactInfoPage( String version, String artifactInfoRepositoryId, String artifactInfoGroupId,
|
||||||
String artifactInfoArtifactId, String artifactInfoVersion,
|
String artifactInfoArtifactId, String artifactInfoVersion,
|
||||||
|
|
Loading…
Reference in New Issue