<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>
<scope>test</scope>
</dependency>
</dependencies>
+
<distributionManagement>
<repository>
<id>test</id>
</repository>
</distributionManagement>
</project>
+
String secondSnapshotVersion = getText( "//div[@id='download']/div[@id='accordion']/p[1]/a/" );
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,