1 package org.apache.archiva.web.test.parent;
5 public abstract class AbstractArtifactManagementTest
6 extends AbstractArchivaTest
9 public String getGroupId()
11 String groupId = p.getProperty( "GROUPID" ) ;
15 public String getArtifactId()
17 String artifactId = p.getProperty( "GROUPID" ) ;
21 public String getVersion()
23 String version = p.getProperty( "VERSION" ) ;
27 public String getPackaging()
29 String packaging = p.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 = p.getProperty( "REPOSITORYID" ) ;
46 public void goToAddArtifactPage()
48 clickLinkWithText( "Upload Artifact" );
49 assertAddArtifactPage();
52 public void goToDeleteArtifactPage()
54 clickLinkWithText( "Delete Artifact" );
55 assertDeleteArtifactPage();
58 public void addArtifact( String groupId, String artifactId, String version, String packaging, String artifactFilePath, String repositoryId )
60 addArtifact(groupId, artifactId, version, packaging, true, artifactFilePath, repositoryId);
63 public void addArtifact( String groupId, String artifactId, String version, String packaging, boolean generatePom, String artifactFilePath, String repositoryId)
65 goToAddArtifactPage();
66 setFieldValue( "groupId" , groupId );
67 setFieldValue( "artifactId" , artifactId );
68 setFieldValue( "version" , version );
69 setFieldValue( "packaging" , packaging );
73 checkField( "generatePom" );
76 setFieldValue( "artifact" , artifactFilePath );
77 setFieldValue( "repositoryId" , repositoryId );
79 clickButtonWithValue( "Submit" );
82 public void deleteArtifact( String groupId, String artifactId, String version, String repositoryId )
84 goToDeleteArtifactPage();
85 setFieldValue( "groupId" , groupId );
86 setFieldValue( "artifactId" , artifactId );
87 setFieldValue( "version" , version );
88 selectValue( "repositoryId" , repositoryId );
89 clickButtonWithValue( "Submit" ) ;
92 public void assertAddArtifactPage()
94 assertPage( "Apache Archiva \\ Upload Artifact" );
95 assertTextPresent( "Upload Artifact" );
97 String artifact = "Upload Artifact,Group Id*:,Artifact Id*:,Version*:,Packaging*:,Classifier:,Generate Maven 2 POM,Artifact File*:,POM File:,Repository Id:";
98 String[] arrayArtifact = artifact.split( "," );
99 for ( String arrayartifact : arrayArtifact )
100 assertTextPresent( arrayartifact );
102 String artifactElements = "upload_groupId,upload_artifactId,upload_version,upload_packaging,upload_classifier,upload_generatePom,upload_artifact,upload_pom,upload_repositoryId,upload_0";
103 String[] arrayArtifactElements = artifactElements.split( "," );
104 for ( String artifactelements : arrayArtifactElements )
105 assertElementPresent( artifactelements );
108 public void assertDeleteArtifactPage()
110 assertPage( "Apache Archiva \\ Delete Artifact" );
111 assertTextPresent( "Delete Artifact" );
112 assertTextPresent( "Group Id*:" );
113 assertTextPresent( "Artifact Id*:" );
114 assertTextPresent( "Version*:" );
115 assertTextPresent( "Repository Id:" );
116 assertElementPresent( "groupId" );
117 assertElementPresent( "artifactId" );
118 assertElementPresent( "version" );
119 assertElementPresent( "repositoryId" );
120 assertButtonWithValuePresent( "Submit" );