1 package org.apache.archiva.web.test.parent;
3 public abstract class AbstractArtifactManagementTest
4 extends AbstractArchivaTest
7 public String getGroupId()
9 String groupId = getProperty( "GROUPID" );
13 public String getArtifactId()
15 String artifactId = getProperty( "ARTIFACTID" );
19 public String getVersion()
21 String version = getProperty( "VERSION" );
25 public String getPackaging()
27 String packaging = getProperty( "PACKAGING" );
31 public String getArtifactFilePath()
33 return "src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar";
36 public String getRepositoryId()
38 String repositoryId = getProperty( "REPOSITORYID" );
42 public void goToDeleteArtifactPage()
44 login( getProperty( "ADMIN_USERNAME" ), getProperty( "ADMIN_PASSWORD" ) );
45 clickLinkWithText( "Delete Artifact" );
46 assertDeleteArtifactPage();
49 public void deleteArtifact( String groupId, String artifactId, String version, String repositoryId )
51 goToDeleteArtifactPage();
52 setFieldValue( "groupId", groupId );
53 setFieldValue( "artifactId", artifactId );
54 setFieldValue( "version", version );
55 selectValue( "repositoryId", repositoryId );
56 clickButtonWithValue( "Submit" );
59 public void assertDeleteArtifactPage()
61 assertPage( "Apache Archiva \\ Delete Artifact" );
62 assertTextPresent( "Delete Artifact" );
63 assertTextPresent( "Group Id*:" );
64 assertTextPresent( "Artifact Id*:" );
65 assertTextPresent( "Version*:" );
66 assertTextPresent( "Repository Id:" );
67 assertElementPresent( "groupId" );
68 assertElementPresent( "artifactId" );
69 assertElementPresent( "version" );
70 assertElementPresent( "repositoryId" );
71 assertButtonWithValuePresent( "Submit" );
75 public void goToLegacySupportPage()
77 clickLinkWithText( "Legacy Support" );
78 assertLegacySupportPage();
81 public void assertLegacySupportPage()
83 assertPage( "Apache Archiva \\ Administration - Legacy Support" );
84 assertTextPresent( "Administration - Legacy Artifact Path Resolution" );
85 assertTextPresent( "Path Mappings" );
86 assertLinkPresent( "Add" );
89 public void addLegacyArtifactPath( String path, String groupId, String artifactId, String version,
90 String classifier, String type )
92 assertAddLegacyArtifactPathPage();
93 setFieldValue( "legacyArtifactPath.path", path );
94 setFieldValue( "groupId", groupId );
95 setFieldValue( "artifactId", artifactId );
96 setFieldValue( "version", version );
97 setFieldValue( "classifier", classifier );
98 setFieldValue( "type", type );
99 clickButtonWithValue( "Add Legacy Artifact Path" );
102 public void assertAddLegacyArtifactPathPage()
104 assertPage( "Apache Archiva \\ Admin: Add Legacy Artifact Path" );
105 assertTextPresent( "Admin: Add Legacy Artifact Path" );
106 assertTextPresent( "Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary." );
108 "addLegacyArtifactPath_legacyArtifactPath_path,addLegacyArtifactPath_groupId,addLegacyArtifactPath_artifactId,addLegacyArtifactPath_version,addLegacyArtifactPath_classifier,addLegacyArtifactPath_type";
109 String[] arrayElement = element.split( "," );
110 for ( String arrayelement : arrayElement )
111 assertElementPresent( arrayelement );
112 assertButtonWithValuePresent( "Add Legacy Artifact Path" );