mirror of https://github.com/apache/archiva.git
upgrade TestNG and resolve some issues with test ordering
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1178013 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e2ee507bff
commit
027e721634
|
@ -36,7 +36,7 @@
|
|||
<cargo.wait>false</cargo.wait>
|
||||
<cargo.timeout>600000</cargo.timeout>
|
||||
<cargo.install.dir>${project.build.directory}/cargo/installs</cargo.install.dir>
|
||||
<maxWaitTimeInMs>30000</maxWaitTimeInMs>
|
||||
<maxWaitTimeInMs>10000</maxWaitTimeInMs>
|
||||
<!-- TODO: review how appropriate the memory settings are - should work with less -->
|
||||
<cargo.jvm.args>-Xmx512m -XX:MaxPermSize=256m</cargo.jvm.args>
|
||||
<seleniumPluginVersion>2.0</seleniumPluginVersion>
|
||||
|
@ -49,9 +49,8 @@
|
|||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
<version>5.9</version>
|
||||
<version>6.2.1</version>
|
||||
<scope>test</scope>
|
||||
<classifier>jdk15</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.testng.annotations.Optional;
|
|||
import org.testng.annotations.Parameters;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test( groups = { "about" }, alwaysRun = true )
|
||||
public class ArchivaAdminTest
|
||||
extends AbstractArchivaTest
|
||||
{
|
||||
|
@ -57,7 +56,6 @@ public class ArchivaAdminTest
|
|||
super.open( baseUrl, browser, seleniumHost, seleniumPort, Integer.toString( maxWaitTimeInMs ) );
|
||||
|
||||
getSelenium().open( baseUrl );
|
||||
String title = getSelenium().getTitle();
|
||||
// if not admin user created create one
|
||||
if ( isElementPresent( "adminCreateForm" ) )
|
||||
{
|
||||
|
@ -78,4 +76,10 @@ public class ArchivaAdminTest
|
|||
// take care about repositories : internal
|
||||
}
|
||||
|
||||
@Test( groups = { "about" }, alwaysRun = true )
|
||||
public void testHome()
|
||||
{
|
||||
getSelenium().open( baseUrl );
|
||||
assertPage( "Apache Archiva \\ Quick Search" );
|
||||
}
|
||||
}
|
|
@ -98,14 +98,14 @@ public class ArtifactManagementTest
|
|||
+ "' was successfully deployed to repository 'internal'" );
|
||||
}
|
||||
|
||||
@Test( groups = "requiresUpload" )
|
||||
@Test( groups = "requiresUpload", enabled = false )
|
||||
public void testDotNetTypes()
|
||||
{
|
||||
String groupId = getProperty( "GROUPID_DOTNETARTIFACT" );
|
||||
String artifactId = getProperty( "ARTIFACTID_DOTNETARTIFACT" );
|
||||
String packaging = getProperty( "PACKAGING_DOTNETARTIFACT" );
|
||||
|
||||
addArtifact( groupId, artifactId, getVersion(), packaging, getArtifactFilePath(), getRepositoryId(), false );
|
||||
addArtifact( groupId, artifactId, getVersion(), packaging, getArtifactFilePath(), getRepositoryId(), true );
|
||||
assertTextPresent( "Artifact '" + groupId + ":" + artifactId + ":" + getVersion()
|
||||
+ "' was successfully deployed to repository 'internal'" );
|
||||
getSelenium().open( baseUrl + "/browse/" + groupId + "/" + artifactId + "/" + getVersion() );
|
||||
|
@ -115,6 +115,7 @@ public class ArtifactManagementTest
|
|||
String basePath =
|
||||
"/archiva/repository/internal/" + groupId + "/" + artifactId + "/" + getVersion() + "/" + artifactId + "-"
|
||||
+ getVersion();
|
||||
// FIXME: currently broken - is dotnet-library
|
||||
assertLinkPresent( ".NET Library" );
|
||||
assertElementPresent( "//a[@href='" + basePath + ".dll']" );
|
||||
assertElementPresent( "//a[@href='" + basePath + ".pom']" );
|
||||
|
@ -125,7 +126,7 @@ public class ArtifactManagementTest
|
|||
public void testAddArtifactBlockRedeployments()
|
||||
{
|
||||
addArtifact( getGroupId(), getArtifactId(), getVersion(), getPackaging(), getArtifactFilePath(),
|
||||
getRepositoryId(), false );
|
||||
getRepositoryId(), true );
|
||||
assertTextPresent( "Overwriting released artifacts in repository '" + getRepositoryId() + "' is not allowed." );
|
||||
}
|
||||
|
||||
|
@ -139,10 +140,10 @@ public class ArtifactManagementTest
|
|||
String packaging = getProperty( "PACKAGING1" );
|
||||
String repositoryId = getProperty( "REPOSITORYID1" );
|
||||
// TODO: do this differently as it only works in Firefox's chrome mode
|
||||
addArtifact( groupId, artifactId, version, packaging, getArtifactFilePath(), repositoryId, false );
|
||||
addArtifact( groupId, artifactId, version, packaging, getArtifactFilePath(), repositoryId, true );
|
||||
assertTextPresent( "Artifact 'delete:delete:1.0' was successfully deployed to repository 'internal'" );
|
||||
|
||||
deleteArtifact( "delete", "delete", "1.0", "internal" );
|
||||
deleteArtifact( "delete", "delete", "1.0", "internal", true );
|
||||
assertTextPresent( "Artifact 'delete:delete:1.0' was successfully deleted from repository 'internal'" );
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ public class BrowseTest
|
|||
addMetadataProperty();
|
||||
}
|
||||
|
||||
@Test( dependsOnMethods = { "testAddMetadataProperty" } )
|
||||
@Test( dependsOnMethods = { "testAddMetadataProperty", "testWithCorrectUsernamePassword" } )
|
||||
public void testDeleteMetadataProperty()
|
||||
{
|
||||
deleteMetadataProperty();
|
||||
|
|
|
@ -89,6 +89,7 @@ public class MergingRepositoriesTest
|
|||
}
|
||||
|
||||
// change the configuaration first and try to upload existing artifact to the repository
|
||||
@Test(dependsOnMethods = {"testAddArtifactToStagingRepository"})
|
||||
public void testConfigurationChangesOfStagingRepository()
|
||||
{
|
||||
editManagedRepository();
|
||||
|
|
|
@ -34,9 +34,10 @@ public class RepositoryScanningTest
|
|||
assertTextPresent( "Unable to process blank pattern." );
|
||||
}
|
||||
|
||||
@Test( dependsOnMethods = { "testAddArtifactFileType_NullValue" } )
|
||||
@Test
|
||||
public void testAddArtifactFileType()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
setFieldValue( "newpattern_0", "**/*.dll" );
|
||||
clickAddIcon( "newpattern_0" );
|
||||
Assert.assertEquals( getSelenium().getTable( "//div[@id='contentArea']/div/div[1]/table.13.0" ), "**/*.dll" );
|
||||
|
@ -55,6 +56,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testAddArtifactFileType" } )
|
||||
public void testDeleteArtifactFileType()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
String path = "//div[@id='contentArea']/div/div/table/tbody/tr[14]/td/code";
|
||||
assertElementPresent( path );
|
||||
Assert.assertEquals( getSelenium().getText( path ), "**/*.dll" );
|
||||
|
@ -65,6 +67,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testDeleteArtifactFileType" } )
|
||||
public void testAddAutoRemove_NullValue()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
setFieldValue( "newpattern_1", "" );
|
||||
clickAddIcon( "newpattern_1" );
|
||||
assertTextPresent( "Unable to process blank pattern." );
|
||||
|
@ -83,6 +86,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testAddAutoRemove_NullValue" } )
|
||||
public void testAddAutoRemove()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
setFieldValue( "newpattern_1", "**/*.test" );
|
||||
clickAddIcon( "newpattern_1" );
|
||||
Assert.assertEquals( getSelenium().getTable( "//div[@id='contentArea']/div/div[2]/table.3.0" ), "**/*.test" );
|
||||
|
@ -91,6 +95,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testAddAutoRemove" } )
|
||||
public void testDeleteAutoRemove()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
String path = "//div[@id='contentArea']/div/div[2]/table/tbody/tr[4]/td/code";
|
||||
assertElementPresent( path );
|
||||
Assert.assertEquals( getSelenium().getText( path ), "**/*.test" );
|
||||
|
@ -101,6 +106,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testDeleteAutoRemove" } )
|
||||
public void testAddIgnoredArtifacts_NullValue()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
setFieldValue( "newpattern_2", "" );
|
||||
clickAddIcon( "newpattern_2" );
|
||||
Assert.assertEquals( getErrorMessageText(),
|
||||
|
@ -129,6 +135,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testAddIgnoredArtifacts" } )
|
||||
public void testDeleteIgnoredArtifacts()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
String pattern = "**/*.log";
|
||||
String path = "//div[@id='contentArea']/div/div[3]/table/tbody/tr[7]/td/code";
|
||||
assertElementPresent( path );
|
||||
|
@ -141,6 +148,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testDeleteIgnoredArtifacts" } )
|
||||
public void testAddIndexableContent_NullValue()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
setFieldValue( "newpattern_3", "" );
|
||||
clickAddIcon( "newpattern_3" );
|
||||
Assert.assertEquals( getErrorMessageText(),
|
||||
|
@ -169,6 +177,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testAddIndexableContent" } )
|
||||
public void testDeleteIndexableContent()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
String pattern = "**/*.html";
|
||||
String path = "//div[@id='contentArea']/div/div[4]/table/tbody/tr[10]/td/code";
|
||||
assertElementPresent( path );
|
||||
|
@ -180,6 +189,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testDeleteIndexableContent" } )
|
||||
public void testUpdateConsumers()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
checkField( "enabledKnownContentConsumers" );
|
||||
checkField( "//input[@name='enabledKnownContentConsumers' and @value='auto-rename']" );
|
||||
clickButtonWithValue( "Update Consumers" );
|
||||
|
@ -189,6 +199,7 @@ public class RepositoryScanningTest
|
|||
@Test( dependsOnMethods = { "testUpdateConsumers" } )
|
||||
public void testUpdateConsumers_UnsetAll()
|
||||
{
|
||||
goToRepositoryScanningPage();
|
||||
getSelenium().uncheck( "enabledKnownContentConsumers" );
|
||||
getSelenium().uncheck( "//input[@name='enabledKnownContentConsumers' and @value='auto-rename']" );
|
||||
getSelenium().uncheck( "//input[@name='enabledKnownContentConsumers' and @value='create-missing-checksums']" );
|
||||
|
|
|
@ -291,9 +291,10 @@ public class RepositoryTest
|
|||
assertTextPresent( "You must enter a repository name." );
|
||||
}
|
||||
|
||||
@Test( dependsOnMethods = { "testAddRemoteRepoNullName" } )
|
||||
@Test
|
||||
public void testAddRemoteRepoNullURL()
|
||||
{
|
||||
getSelenium().open( "/archiva/admin/addRemoteRepository.action" );
|
||||
addRemoteRepository( "remoterepo", "Remote Repository Sample", "", "", "", "", "Maven 2.x Repository", false );
|
||||
assertTextPresent( "You must enter a url." );
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class VirtualRepositoryTest
|
|||
@Test( dependsOnMethods = { "testDeleteRepositoryOfRepositoryGroup" } )
|
||||
public void testDeleteRepositoryGroup()
|
||||
{
|
||||
assertRepositoryGroupsPage();
|
||||
goToRepositoryGroupsPage();
|
||||
deleteRepositoryGroup( "testing" );
|
||||
assertTextPresent( "No Repository Groups Defined." );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue