1 package org.apache.archiva.web.test.parent;
5 public abstract class AbstractArtifactManagementTest
6 extends AbstractArchivaTest
9 public String getGroupId()
11 String groupId = getProperty( "GROUPID" ) ;
15 public String getArtifactId()
17 String artifactId = getProperty( "ARTIFACTID" ) ;
21 public String getVersion()
23 String version = getProperty( "VERSION" ) ;
27 public String getPackaging()
29 String packaging = getProperty( "PACKAGING" ) ;
33 public String getArtifactFilePath()
35 File f = new File( "src/test/it-resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar" );
38 return f.getCanonicalPath();
40 catch ( IOException e )
42 return f.getAbsolutePath();
46 public String getRepositoryId()
48 String repositoryId = getProperty( "REPOSITORYID" ) ;
52 public void goToDeleteArtifactPage()
54 clickLinkWithText( "Delete Artifact" );
55 assertDeleteArtifactPage();
58 public void deleteArtifact( String groupId, String artifactId, String version, String repositoryId )
60 goToDeleteArtifactPage();
61 setFieldValue( "groupId" , groupId );
62 setFieldValue( "artifactId" , artifactId );
63 setFieldValue( "version" , version );
64 selectValue( "repositoryId" , repositoryId );
65 clickButtonWithValue( "Submit" ) ;
68 public void assertDeleteArtifactPage()
70 assertPage( "Apache Archiva \\ Delete Artifact" );
71 assertTextPresent( "Delete Artifact" );
72 assertTextPresent( "Group Id*:" );
73 assertTextPresent( "Artifact Id*:" );
74 assertTextPresent( "Version*:" );
75 assertTextPresent( "Repository Id:" );
76 assertElementPresent( "groupId" );
77 assertElementPresent( "artifactId" );
78 assertElementPresent( "version" );
79 assertElementPresent( "repositoryId" );
80 assertButtonWithValuePresent( "Submit" );
84 public void goToLegacySupportPage()
86 clickLinkWithText( "Legacy Support" );
87 assertLegacySupportPage();
90 public void assertLegacySupportPage()
92 assertPage( "Apache Archiva \\ Administration - Legacy Support" );
93 assertTextPresent( "Administration - Legacy Artifact Path Resolution" );
94 assertTextPresent( "Path Mappings" );
95 assertLinkPresent( "Add" );
98 public void addLegacyArtifactPath( String path, String groupId, String artifactId, String version, String classifier, String type)
100 assertAddLegacyArtifactPathPage();
101 setFieldValue( "legacyArtifactPath.path" , path );
102 setFieldValue( "groupId" , groupId );
103 setFieldValue( "artifactId" , artifactId );
104 setFieldValue( "version" , version );
105 setFieldValue( "classifier" , classifier );
106 setFieldValue( "type" , type );
107 clickButtonWithValue( "Add Legacy Artifact Path" );
110 public void assertAddLegacyArtifactPathPage()
112 assertPage( "Apache Archiva \\ Admin: Add Legacy Artifact Path" );
113 assertTextPresent( "Admin: Add Legacy Artifact Path" );
114 assertTextPresent( "Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary." );
115 String element = "addLegacyArtifactPath_legacyArtifactPath_path,addLegacyArtifactPath_groupId,addLegacyArtifactPath_artifactId,addLegacyArtifactPath_version,addLegacyArtifactPath_classifier,addLegacyArtifactPath_type";
116 String[] arrayElement = element.split( "," );
117 for ( String arrayelement : arrayElement )
118 assertElementPresent( arrayelement );
119 assertButtonWithValuePresent( "Add Legacy Artifact Path" );