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( "GROUPID" ) ;
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( "" );
36 String artifactFilePath = f.getAbsolutePath();
37 return artifactFilePath + "/src/test/it-resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar" ;
40 public String getRepositoryId()
42 String repositoryId = getProperty( "REPOSITORYID" ) ;
46 public void goToDeleteArtifactPage()
48 clickLinkWithText( "Delete Artifact" );
49 assertDeleteArtifactPage();
52 public void deleteArtifact( String groupId, String artifactId, String version, String repositoryId )
54 goToDeleteArtifactPage();
55 setFieldValue( "groupId" , groupId );
56 setFieldValue( "artifactId" , artifactId );
57 setFieldValue( "version" , version );
58 selectValue( "repositoryId" , repositoryId );
59 clickButtonWithValue( "Submit" ) ;
62 public void assertDeleteArtifactPage()
64 assertPage( "Apache Archiva \\ Delete Artifact" );
65 assertTextPresent( "Delete Artifact" );
66 assertTextPresent( "Group Id*:" );
67 assertTextPresent( "Artifact Id*:" );
68 assertTextPresent( "Version*:" );
69 assertTextPresent( "Repository Id:" );
70 assertElementPresent( "groupId" );
71 assertElementPresent( "artifactId" );
72 assertElementPresent( "version" );
73 assertElementPresent( "repositoryId" );
74 assertButtonWithValuePresent( "Submit" );
78 public void goToLegacySupportPage()
80 clickLinkWithText( "Legacy Support" );
81 assertLegacySupportPage();
84 public void assertLegacySupportPage()
86 assertPage( "Apache Archiva \\ Administration - Legacy Support" );
87 assertTextPresent( "Administration - Legacy Artifact Path Resolution" );
88 assertTextPresent( "Path Mappings" );
89 assertLinkPresent( "Add" );
92 public void addLegacyArtifactPath( String path, String groupId, String artifactId, String version, String classifier, String type)
94 assertAddLegacyArtifactPathPage();
95 setFieldValue( "legacyArtifactPath.path" , path );
96 setFieldValue( "groupId" , groupId );
97 setFieldValue( "artifactId" , artifactId );
98 setFieldValue( "version" , version );
99 setFieldValue( "classifier" , classifier );
100 setFieldValue( "type" , type );
101 clickButtonWithValue( "Add Legacy Artifact Path" );
104 public void assertAddLegacyArtifactPathPage()
106 assertPage( "Apache Archiva \\ Admin: Add Legacy Artifact Path" );
107 assertTextPresent( "Admin: Add Legacy Artifact Path" );
108 assertTextPresent( "Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary." );
109 String element = "addLegacyArtifactPath_legacyArtifactPath_path,addLegacyArtifactPath_groupId,addLegacyArtifactPath_artifactId,addLegacyArtifactPath_version,addLegacyArtifactPath_classifier,addLegacyArtifactPath_type";
110 String[] arrayElement = element.split( "," );
111 for ( String arrayelement : arrayElement )
112 assertElementPresent( arrayelement );
113 assertButtonWithValuePresent( "Add Legacy Artifact Path" );