archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r776772 - in /archiva/trunk/archiva-modules/archiva-web: ./ archiva-webapp-test/src/test/resources/ archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/
Date Wed, 20 May 2009 17:26:30 GMT
Author: wsmoak
Date: Wed May 20 17:26:30 2009
New Revision: 776772

URL: http://svn.apache.org/viewvc?rev=776772&view=rev
Log:
[MRM-1164] Improve the Selenium tests so testng.properties no longer needs to be modified
(patch #4
Submitted by: Marecor Baclay
Also changed the webapp-test profile id to 'it' (integration test). Run with -Pit to include
this module.

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java
    archiva/trunk/archiva-modules/archiva-web/pom.xml

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties?rev=776772&r1=776771&r2=776772&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties
Wed May 20 17:26:30 2009
@@ -21,8 +21,8 @@
 ARTIFACT_PACKAGING=jar
 # Reports
 REPOSITORY_NAME=internal
-START_DATE=04/01/2009
-END_DATE=04/30/2009
+START_DATE=05/01/2009
+END_DATE=05/30/2009
 # Add Valid Artifact
 
 
@@ -68,5 +68,13 @@
 ARTIFACTID=test
 VERSION=1.0
 PACKAGING=jar
-ARTIFACTFILEPATH=/path/to/artifact/file
+ARTIFACTFILEPATH=test
 REPOSITORYID=internal
+
+GROUPID1=delete
+ARTIFACTID1=delete
+VERSION1=1.0
+PACKAGING1=jar
+ARTIFACTFILEPATH1=test
+# /home/cora/Documents/MAESTRO/installers/maestro-2.1.1/project-server/core/activation-1.1.jar
+REPOSITORYID1=internal

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java?rev=776772&r1=776771&r2=776772&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
Wed May 20 17:26:30 2009
@@ -7,6 +7,7 @@
 public class ArtifactManagementTest
 	extends AbstractArtifactManagementTest
 {
+
 	
 	public void testAddArtifactNullValues()
 	{
@@ -30,6 +31,7 @@
 	@Test(dependsOnMethods = { "testAddArtifactNoGroupId" } )
 	public void testAddArtifactNoArtifactId()
 	{
+		
 		addArtifact( getGroupId() , " ", getVersion(), getPackaging() , getArtifactFilePath(),
getRepositoryId() );
 		assertTextPresent( "You must enter an artifactId." );
 	}
@@ -42,6 +44,13 @@
 	}
 	
 	@Test(dependsOnMethods = { "testAddArtifactNoGroupId" } )
+	public void testAddArtifactInvalidVersion()
+	{
+		addArtifact( getGroupId() , getArtifactId(), "asdf", getPackaging() , getArtifactFilePath(),
getRepositoryId() );
+		assertTextPresent( "Invalid version." );
+	}
+	
+	@Test(dependsOnMethods = { "testAddArtifactNoGroupId" } )
 	public void testAddArtifactNoPackaging()
 	{
 		addArtifact( getGroupId() , getArtifactId(), getVersion(), " " , getArtifactFilePath(),
getRepositoryId() );
@@ -60,4 +69,47 @@
 		addArtifact( getGroupId() , getArtifactId(), getVersion(), getPackaging() , getArtifactFilePath(),
getRepositoryId() );
 		assertTextPresent( "Artifact 'test:test:1.0' was successfully deployed to repository 'internal'"
);
 	}
+	
+	public void testAddArtifactValidValues1()
+	{
+		String groupId = p.getProperty( "GROUPID1" );
+		String artifactId = p.getProperty( "ARTIFACTID1" );
+		String version = p.getProperty( "VERSION1" );
+		String packaging = p.getProperty( "PACKAGING1" );
+		String repositoryId = p.getProperty( "REPOSITORYID1" );
+		addArtifact( groupId , artifactId, version, packaging , getArtifactFilePath(), repositoryId
);
+		assertTextPresent( "Artifact 'delete:delete:1.0' was successfully deployed to repository
'internal'" );
+	}
+	
+	@Test(dependsOnMethods = { "testAddArtifactValidValues1" } )
+	public void testDeleteArtifact()
+	{
+		deleteArtifact( "delete", "delete", "1.0", "internal");
+		assertTextPresent( "Artifact 'delete:delete:1.0' was successfully deleted from repository
'internal'" );
+	}
+	
+	public void testDeleteArtifactNoGroupId()
+	{
+		deleteArtifact( " ", "delete", "1.0", "internal");
+		assertTextPresent( "You must enter a groupId." );
+	}
+	
+	public void testDeleteArtifactNoArtifactId()
+	{
+		deleteArtifact( "delete", " ", "1.0", "internal");
+		assertTextPresent( "You must enter an artifactId." );
+	}
+	
+	public void testDeleteArtifactNoVersion()
+	{
+		deleteArtifact( "delete", "delete", " ", "internal");
+		assertTextPresent( "Invalid version." );
+		assertTextPresent( "You must enter a version." );
+	}
+	
+	public void testDeleteArtifactInvalidVersion()
+	{
+		deleteArtifact( "delete", "delete", "asdf", "internal");
+		assertTextPresent( "Invalid version." );
+	}
 }

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java?rev=776772&r1=776771&r2=776772&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java
Wed May 20 17:26:30 2009
@@ -22,7 +22,7 @@
 import org.apache.archiva.web.test.parent.AbstractBrowseTest;
 import org.testng.annotations.Test;
 
-@Test( groups = { "browse" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
+@Test( groups = { "browse" }, dependsOnMethods = { "testAddArtifactNullValues" } )
 public class BrowseTest 
 	extends AbstractBrowseTest
 {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java?rev=776772&r1=776771&r2=776772&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java
Wed May 20 17:26:30 2009
@@ -36,14 +36,14 @@
 		assertTextPresent( "Please select a repository (or repositories) from the list." );
 	}
 	
-/*	@Test(dependsOnMethods = { "testRepoStatisticsWithoutRepoCompared" } )
+	@Test(dependsOnMethods = { "testRepoStatisticsWithoutRepoCompared" } )
 	public void testRepositoryStatisticsWithoutDate()
 	{
 		String repositoryName = p.getProperty( "REPOSITORY_NAME" ) ;
 		compareRepositories( "label=" + repositoryName, "", "" );
 		//TODO
-		assertTextPresent( "Statistics Report" );
-	}*/
+		//assertTextPresent( "Statistics Report" );
+	}
 	
 	@Test(dependsOnMethods = { "testRepoStatisticsWithoutRepoCompared" } )
 	public void testRepositoryStatisticsEndEarlierThanStart()
@@ -57,7 +57,7 @@
 		assertTextPresent( "Start Date must be earlier than the End Date" );
 	}
 		
-/*	@Test(dependsOnMethods = { "testAddArtifactValidValues" } )	
+	@Test(dependsOnMethods = { "testAddArtifactValidValues" } )	
 	public void testRepositoryStatistics()
 	{
 		String repositoryName = p.getProperty( "REPOSITORY_NAME" ) ;
@@ -65,19 +65,19 @@
 		String endDate = p.getProperty( "END_DATE" );
 		compareRepositories( "label=" + repositoryName, startDate, endDate );
 		//assertTextPresent( "Statistics for Repository '" + repositoryName + "'" );
-		assertPage( "Apache Archiva \\ Reports" );
-		assertTextPresent( "Statistics Report" );
-	}*/
+		//assertPage( "Apache Archiva \\ Reports" );
+		//assertTextPresent( "Statistics Report" );
+	}
 	
-/*	@Test(dependsOnMethods = { "testAddArtifactValidValues" } )
+	/* @Test( dependsOnMethods = { "testRepositoryStatistics" } )
 	public void testRepositoriesStatisticComparisonReport()
 	{
-		goToReportsPage();
+		//goToReportsPage();
 		clickButtonWithValue( "-->>" , false );
 		clickButtonWithValue( "View Statistics" );
 		assertTextPresent( "Statistics Report" );
 	}
-	*/
+	
 	@Test(dependsOnMethods = { "testAddArtifactValidValues" } )
 	public void testRepositoryHealthWithoutDefect()
 	{
@@ -89,10 +89,10 @@
 		assertTextPresent( "The operation generated an empty report." );
 	}
 	
-/*	@Test(dependsOnMethods = { "testAddArtifactValidValues" } )
+	@Test(dependsOnMethods = { "testAddArtifactValidValues" } )
 	public void testRepositoryHealthWithoutGroupId()
 	{
-		//goToReportsPage();
+		goToReportsPage();
 		clickButtonWithValue( "Show Report" );
 		assertPage( "Apache Archiva \\ Reports" );
 		assertTextPresent( "The operation generated an empty report." );
@@ -102,4 +102,4 @@
 	
 	
 	
-}
\ No newline at end of file
+}

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java?rev=776772&r1=776771&r2=776772&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java
Wed May 20 17:26:30 2009
@@ -1,5 +1,7 @@
 package org.apache.archiva.web.test.parent;
 
+import java.io.File;
+
 public abstract class AbstractArtifactManagementTest 
 	extends AbstractArchivaTest
 {
@@ -30,8 +32,9 @@
 	
 	public String getArtifactFilePath()
 	{
-		String artifactFilePath = p.getProperty( "ARTIFACTFILEPATH" ) ;
-		return artifactFilePath;
+		File f = new File( "" );
+		String artifactFilePath = f.getAbsolutePath();
+		return artifactFilePath + "/src/test/it-resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar"
;
 	}
 	
 	public String getRepositoryId()
@@ -51,7 +54,7 @@
 		clickLinkWithText( "Delete Artifact" );
 		assertDeleteArtifactPage();
 	}
-	
+		
 	public void addArtifact( String groupId, String artifactId, String version, String packaging,
String artifactFilePath, String repositoryId )
 	{
 		addArtifact(groupId, artifactId, version, packaging, true,  artifactFilePath, repositoryId);
@@ -78,7 +81,7 @@
 	
 	public void deleteArtifact( String groupId, String artifactId, String version, String repositoryId
)
 	{
-		goToAddArtifactPage();
+		goToDeleteArtifactPage();
 		setFieldValue( "groupId" , groupId );
 		setFieldValue( "artifactId" , artifactId );
 		setFieldValue( "version" , version );

Modified: archiva/trunk/archiva-modules/archiva-web/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/pom.xml?rev=776772&r1=776771&r2=776772&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/pom.xml (original)
+++ archiva/trunk/archiva-modules/archiva-web/pom.xml Wed May 20 17:26:30 2009
@@ -39,7 +39,7 @@
 
   <profiles>
     <profile>
-      <id>webapp-test</id>
+      <id>it</id>
       <modules>
         <module>archiva-webapp-test</module>        
       </modules>



Mime
View raw message