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, String classifier, String type)
91 assertAddLegacyArtifactPathPage();
92 setFieldValue( "legacyArtifactPath.path" , path );
93 setFieldValue( "groupId" , groupId );
94 setFieldValue( "artifactId" , artifactId );
95 setFieldValue( "version" , version );
96 setFieldValue( "classifier" , classifier );
97 setFieldValue( "type" , type );
98 clickButtonWithValue( "Add Legacy Artifact Path" );
101 public void assertAddLegacyArtifactPathPage()
103 assertPage( "Apache Archiva \\ Admin: Add Legacy Artifact Path" );
104 assertTextPresent( "Admin: Add Legacy Artifact Path" );
105 assertTextPresent( "Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary." );
106 String element = "addLegacyArtifactPath_legacyArtifactPath_path,addLegacyArtifactPath_groupId,addLegacyArtifactPath_artifactId,addLegacyArtifactPath_version,addLegacyArtifactPath_classifier,addLegacyArtifactPath_type";
107 String[] arrayElement = element.split( "," );
108 for ( String arrayelement : arrayElement )
109 assertElementPresent( arrayelement );
110 assertButtonWithValuePresent( "Add Legacy Artifact Path" );